-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add OnMenuNavigation to CompletionEntry #31
base: master
Are you sure you want to change the base?
Conversation
Allow to bind when the user is navigating the menu entry
If the user hits enter and nothing was selected Note, this use a fyne-x fork as soon as fyne-io/fyne-x#31 is merged
I'm not sure what this is for - can you expand on the use-case? |
I need to have an hook when the user is navigating the menu. At the moment, OnChanged is hooked on the Entry widget, which fires only when the user types something in the entry box. My use case is the following: a user could hit Enter on the keyboard while typing something but without navigating the menu (with keyboard, or mouse, etc) - how can I tell when this happens? The PR adds a hook when the user actually navigates the menu, with the argument passed as the item ID. In https://github.com/mudler/golauncher makes sense because the user might no need to navigate the menu at all, but still the intention behind it is to select the first matched entry |
If the
Hmm, is |
I'm not totally sure if it's actually a bug. by looking at the widget , it composes several ones into one, and the hook I'm interested in this case is on the List widget created by it, but since the widget extends Entry
for the enter pass yes indeed that's what I end up using, but at that point I cannot query the status if the selection happened or not, so still I need an event to capture the menu selection, which is under the hood a list created by this widget. |
Our widget APIs should be based on behaviour not implementation detail. Forget how it is built internally and base your thoughts on how it should function :)
The thing I still don't understand is what is the difference of whether the item was in the list or was written by hand? SelectEntry does not care so to add this we really need to understand the use-case properly to get naming or workflow right. |
This is an interesting idea... we could mirror the It avoids implying that this is navigation... or a menu ;). |
Sounds Good~ Currently, I have achieved a similar effect by extend CompletionEnty. I'm looking forward to FyneX can have a more elegant solution~ |
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.
I think this should have been "request changes" when the naming conflict was mentioned earlier.
The function allows to bind when the user is navigating the menu entry.
I'm pretty sure this isn't aligned up with the code style, so I'm opening the PR to have feedback if this is something worth to add (I'd like to upstream this, as otherwise I'd be forced for some workarounds in https://github.com/mudler/golauncher ) !
Thank you!