lapce / floem

A native Rust UI library with fine-grained reactivity
https://docs.rs/floem
MIT License
2.77k stars 128 forks source link

Text input improvements #28

Open 0HyperCube opened 1 year ago

0HyperCube commented 1 year ago
presiyan-ivanov commented 1 year ago

I will look into the word-based actions and clicking at a glyph

moon989 commented 1 year ago

I Love Floem Project , It's a great idea for Rust GUI

thewizzy commented 11 months ago

Updated list based on my testing. I have started work on the remaining ones https://github.com/thewizzy/floem/tree/select_delete_range (also https://discord.com/channels/946858761413328946/1176271038653415444)

dominikwilkowski commented 10 months ago

Some notes here about mac compatibility

Numpad del to delete the character after the cursor (Ctrl deletes the word) Two things:

  1. On mac a user would expect Opt + Delete to delete words left from the cursor instead of Ctrl
  2. This seems to be already working now with Ctrl + Delete

Ctrl + Arrow key to move by word Opt + arrow keys would move the cursor by word (right now Ctrl + arrow keys is tied by default to "spaces" on mac which moves the screen). On mac you also get Shift + Opt + Arrow key to select word for word (which right now is implemented but with Ctrl instead of Opt

On mac you also usually get:

pieterdd commented 9 months ago

This open task is working for me on Windows and Wayland on GNOME:

Double click to select a word

Can you break down what needs to happen for IME support? ~Is this about enabling user input of special characters like łéçô? Is right-to-left support in scope? One thing I noticed during my testing is that a test application crashed when inputting é twice in a row. The issue does not trigger when I paste the é character twice from clipboard, only with direct input.~ (Edit: I opened https://github.com/lapce/floem/issues/235 for the é bug and I hope to submit a fix this weekend.)

jrmoulton commented 9 months ago

Another issue is being able to align/justify text. Text inside of TextInput doesn't respect alignment and justification

dominikwilkowski commented 9 months ago

I'd also like to add that request_focus() on an input field should put the cursor at the end of the input field text. right now it's at position 0 no matter how much is already inside the field.

csc-chicken commented 7 months ago

Just want to know how to interact with linux IM_MODULE using rust?? I only see tutorials about C.

dwuertz commented 5 months ago

I'd also like to add that request_focus() on an input field should put the cursor at the end of the input field text. right now it's at position 0 no matter how much is already inside the field.

I'd rather have the current text selected in this case. This is generally more useful (e.g. makes the common case easy, which is to replace the entire text) and is in line with established UI frameworks/patterns (e.g. GTK, QT, Windows).

dominikwilkowski commented 5 months ago

Let's make sure what happens in input fields is what each OS is expecting to happen. It sounds like windows has a different behavior than macos etc. Nothing is worse than editing something and your cursor is jumping around in unexpected ways.