-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input Method Support #2777
Input Method Support #2777
Conversation
Seems related to #1858. |
Yes. Trying to resolve same problem with |
Hey, thanks! I think we can work with this. Let me make some changes. |
3322aee
to
043efc0
Compare
043efc0
to
0c6d4eb
Compare
Thank you for reviewing. If you happy with my proposal and code, I'll update this branch. Current PR is not ready for merge for me, I have some TODO items on this branch like:
One or two minor improvements I want to do, but it may be in another PRs. |
I'm not happy with the code. I am changing it. We can discuss further fixes later. |
OK, thank you taking time to brush up my code! Should I wait your changes will be force-pushed on this branch? Or can I work on my another branch and show what needs to be added? I assume the latter. |
I don't recommend you to keep working on this code, since I'm rewriting the whole API. The changes you mention should be easy to add later on. Wait a bit, I'm almost done. |
Almost done, just a couple more things. |
Alright! So I have refactored things a bit and also have implemented both of the features you mentioned, @kenz-gelsoft:
Far from perfect, but it's a start. Test it out and let me know! |
I looked through your refactoring changes. Looks great. Opt-out by InputMethod::Open with preedit=None is clean and reasonable. Clamping preedit inside window's viewport is what I want to do! I can't test this in my office hours, I will test this and feedback later. Please wait. |
Start typing when there is text selection before showing candidate window at the first time, then it fails to place candidate window at correct position. This occured only on macOS. I guess this is macOS winit's bug that worked around here https://github.com/iced-rs/iced/pull/1858/files#diff-a595007c8791daf8513eded932e3a5a9cb14bd3bae92637b7b2fcd086125f56dR45 in previous PR #1858 macOS specific problem may be worked on another PR I think. ![]() |
@hecrj We need to call request_redraw() just after drawing preedit. This fixes slow redraw problem I described in #2777 (comment). Slow redraw and stop redrawing when we have text selection is the same problem. It is redrawed only when caret blinks. diff --git a/winit/src/program/window_manager.rs b/winit/src/program/window_manager.rs
index ae214e7c..ddd39587 100644
--- a/winit/src/program/window_manager.rs
+++ b/winit/src/program/window_manager.rs
@@ -266,6 +266,7 @@ where
self.state.viewport().logical_size(),
),
);
+ self.raw.request_redraw();
}
}
} |
We just need to call
Good catch. This should be fixed by 141290c.
|
@hecrj I confirmed two problems fixed. I couldn't find more bugs. It is now usable enough to merge! Here we go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kenz-gelsoft Awesome! Thanks for all the work and testing!
Next step is implementing on-the-spot pre-edits, but I'm still quite happy iced
is now somewhat usable for a lot more people.
Let's ship it! 🚢
It's a great leap for |
This is a PoC draft of my API Design proposal for CJK Input method.
https://discourse.iced.rs/t/api-design-proposal-cjk-input-method-support/862
This is not finished yet, but I believe this helps discussion on the above post.
I'll update this or create new PR if my proposal is welcomed.
(Or feel free other experienced iced developer finish or supercede my work!)
This PR implements CJK Input Method support on iced. Integrates it into
TextInput
andTextEditor
widgets in iced_widget crate, so theoretically all examples support input method.I tested combo_box, todos, markdown examples in my development.