Skip to content
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

GUI: NumberInput small improvements #3840

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

Willy-JL
Copy link
Contributor

What's new

  • I really liked the idea of a number input and already had a use for it, but found a detail that did not fit my use case:
    When showing NumberInput, there is always a number there
    You can set current number to 0, but then if you want to have a minimum value, current number is changed to minimum value, so user gets default text of the minimum value and they need to erase this then input their number
    My use case would work better where you can start typing, and the save button is enabled when the number is within bounds
  • This PR allows passing 0 as current number, which will mean the input is empty by default
  • Also, manually pressing 0 when input is empty shows the number 0 instead of doing nothing, to avoid confusion
  • Also aligned the input bar to keyboard bar, it was probably misaligned due to taking the skeleton of ByteInput, which has arrows on sides of input bar

Verification

  • Using example_number_input app:
    • Set number to zero
    • Click change again, input is empty due to current number being 0
    • Click 0 when input is empty, 0 is displayed
    • Check that input bar is vertically aligned to keyboard buttons

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@hedger hedger added the UI Affects UI label Aug 14, 2024
@skotopes
Copy link
Member

skotopes commented Sep 5, 2024

image

got some side effects when you set max to INT_MIN and then input number.

@skotopes skotopes marked this pull request as draft September 5, 2024 17:27
@skotopes
Copy link
Member

@Willy-JL do you need help with this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Affects UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants