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
Spinner Widget [draft/work in progress] #711
Conversation
…y widget and two buttons in a border layout
1174f11
to
ea61088
Compare
I would also handled focus lost event with Enter.
That's because it's usual view for Spinner (although it doesn't mean that every GUI library should use only such way). As for size - each button just takes ((height of entry)/2 - minus some border value) |
Sure, this is what we want, but not sure how to enforce this. |
Thanks for working on this. As you'll be seeing I guess that getting API right is a lot more work than composing existing APIs.
Perhaps some of this would be made easier if we implement the proposed #709 Simple Widget (as you could pass a container in to that so it's fully encapsulated?) |
Anything we can do to help with this pull request? |
Hi @DerThorsten. Have you had the time to look at this again? You have done some good work on this spinner widget and it is definitely something that would be useful in the toolkit if you ask me :) |
The Entry widget now has ActionItem that might allow this to be implemented more easily (like the password show/hide button). |
Hi @DerThorsten. I hope that you are doing well and continuing to enjoy using Fyne. We have recently opened a new community contributions repository (https://github.com/fyne-io/fyne-x) where new widgets can be added faster and then possibly move into here over time. We would recommend that this PR be updated and re-opened over there. Hopefully we can continue the discussion there 🙂 |
Description:
Spinner Widget implementation composed of button and entry widget + border layout
Fixes #(issue)
Missing Spinner Widget
entry.OnChanged
instead of relying on a press ofEnter
. ButOnChanged
does not work well with a spinner, because while entering a valid number one generates text which does not encode a number inbetween (for instance when typing10.0
one has a10.
at some point, or for1e-4
one has1e
. Therefore I think enter is more appropriate. When spinner.GetValue() is called the current text is also evaluated (even without a press of enter).