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

feat(color): add Slider & Choice widget option types #5518

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Sep 8, 2024

Changes:

  • Adds two new types for widget options - SLIDER and CHOICE.
  • Fix ALIGNMENT widget option type.
  • Add missing Lua constants for fonts and widget option types.
  • Cleanup up widget code.

New Lua contants:

  • STDSIZE - default FONT (STD size)
  • STDBOLD - bold FONT (STD size)
  • INTVAL - Number edit widget option type
  • SRCVAL - Source select widget option type
  • SLIDER - Slider widget option type
  • CHOICE - Choice popup widget option type

Slider widget option:

  { "Slider", SLIDER, 0, 0, 19 }

Parameters are name, type, default value, min value and max value.
Option value is a number between min & max,
Screenshot 2024-09-08 at 1 09 00 PM

Choice widget option:

  { "Choice", CHOICE, 1, {"LiPo", "Li-Ion", "NiMH"} }

Parameters are name, type, default value, and table of choice names.
Option value is a number from 1 - number of entries in the table of names.
Screenshot 2024-09-08 at 1 11 59 PM
Screenshot 2024-09-08 at 1 12 07 PM

@philmoz philmoz added this to the 2.11 milestone Sep 8, 2024
@philmoz philmoz added enhancement ✨ New feature or request color Related generally to color LCD radios lua-api Lua API related lua labels Sep 8, 2024
@pfeerick pfeerick changed the title feat(color): add new widget option types (Slider & Choice). feat(color): add Slider & Choice widget option types Sep 11, 2024
@pfeerick
Copy link
Member

New option types are looking handy... Think Offer will like those for his widgets ;)

The only "problem" I see with the slider, which could be be said for other places in the UI, but probably less of an issue there, is if for instance you want to use it for say cell count, you don't know the specific value selected... not sure how to resolve that... other than perhaps being able to draw it on the slider itself for a duration after changing it?

@pfeerick pfeerick merged commit ecfa1e1 into main Sep 11, 2024
51 checks passed
@pfeerick pfeerick deleted the philmoz/widget-options branch September 11, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
color Related generally to color LCD radios enhancement ✨ New feature or request lua lua-api Lua API related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants