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

Revised Logical Switches layout #3019

Merged
merged 19 commits into from
Jan 27, 2023
Merged

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Jan 12, 2023

Summary of changes:

This PR changes the logical switch page with the same style of changes as the special/global functions page in PR 2992 .

  • Use LVGL flex layout for the list and edit views
  • Fixed height for buttons
  • Move switch name into the switch button so the entire row acts as a button
  • Group unused switches in rows where possible
  • Make button behaviour consistent by always opening pop up menu
  • Remember selected button and reselect after edit.

@JimB40
Copy link
Collaborator

JimB40 commented Jan 12, 2023

screen-shots?

@JimB40 JimB40 added color Related generally to color LCD radios UX-UI Related to user experience (UX) or user interface (UI) behaviour labels Jan 12, 2023
@JimB40 JimB40 added this to the 2.9 milestone Jan 12, 2023
@philmoz
Copy link
Collaborator Author

philmoz commented Jan 12, 2023

Screen Shot 2023-01-12 at 7 38 52 pm

Screen Shot 2023-01-12 at 7 39 09 pm

@JimB40
Copy link
Collaborator

JimB40 commented Jan 12, 2023

Okay. Here I will instist to fit list item's data in one line.
Logical Switches are often configured in groups so it's very important to see as much as possible how they are activated.

LS_List

To my check on whiteboard if we use more tight styling.

  • list item height is 38px
  • list item background height is 36px
  • list item data background height is 32px
    We will be able to fit 5 items.
    And with 3.0 where screen name will move to the topbar even 6 lines

@gagarinlg
Copy link
Member

You can look at the gvar LVGL PR, there I fiddled with paddings until I got a density similar to pre LVGL

@JimB40
Copy link
Collaborator

JimB40 commented Jan 12, 2023

LS_List_Data

Okay here are data fields fixings for all LS functions types with max data length

  1. a=x, a<x etc
  • V1 - switch
  • V2 - numeric value <-100,100> format ##
  • AND switch - switch
  • Duration - numeric value <0.0,25.0> format ##.#
  • Delay - numeric value <0.0,25.0> format ##.#
  1. AND ,OR etc
  • V1 - switch
  • V2 - switch
  • AND switch - switch
  • Duration - numeric value <0.0,25.0> format ##.#
  • Delay - numeric value <0.0,25.0> format ##.#
  1. Edge (exception for V2 posotioning as Edge has two V2 values, and Delay that is not applicable)
  • V1 - switch
  • V2 - numeric value <0.0,175.0> format ##.#
  • V2b -mixed value. Either string '<<' or numeric value <0.0,275.0> format ##.#
  • AND switch - switch
  • Duration - numeric value <0.0,25.0> format ##.#
  • Delay - N/A - not displayed.
  1. Timer
  • V1 - numeric value <0.0,175.0> format ##.#
  • V2 - numeric value <0,1750> format ####
  • V2b -mixed value. Either string '<<' or numeric value <0.0,275.0> format ##.#
  • AND switch - switch
  • Duration - numeric value <0.0,25.0> format ##.#
  • Delay - numeric value <0.0,25.0> format ##.#
  1. Sticky (same as 2 ie AND, OR, XOR)

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 12, 2023

My concern with the nested rounded rectangles is that the whole line looks like a button; but does not act like one.

Nothing happens if you tap on the switch name.

@gagarinlg
Copy link
Member

The nested stuff is only needed when you eve sub-rows. I would not do this for lists where the entries have no sub-rows.

If this really has to be there, the outer part could get the darker background color

@JimB40
Copy link
Collaborator

JimB40 commented Jan 12, 2023

That's a good point. Names are actually non-touchable (non-focusable labels)
It behaves the same in Inputs & Mixes but difrently in Outputs where list item is grouped together with output name (label)
Let me think a while how can we solve it to unify UI.
Most probably styling change will be enough.

@JimB40
Copy link
Collaborator

JimB40 commented Jan 12, 2023

We may consider this styling change.
Group 2

So list's item has a frame to group multi-lines list's items but no background that indicates focusable-touchable UI element.

@eshifri
Copy link
Contributor

eshifri commented Jan 12, 2023

How about vertical screens (NV14)? Will it be two lines?

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 12, 2023

We may consider this styling change. Group 2

So list's item has a frame to group multi-lines list's items but no background that indicates focusable-touchable UI element.

With the current 'active switch' color being the same light blue this will make active switches blend into the label section which I think will look a bit odd.

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 13, 2023

I've updated the landscape layout to display on a single line. Portrait layout is two lines.
At this stage I've left it as a single button including the switch name (no nested rectangles).

Screen Shot 2023-01-13 at 10 19 54 am

Screen Shot 2023-01-13 at 10 15 51 am

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 13, 2023

I have remove all the empty switch buttons and added a single '+' button to match the inputs and mixes pages.

The '+' button will pop up the view to select an empty logical switch unless 'Copy' has been previously selected on another switch. In that case it will show a menu to allow pasting to an empty switch (or creating a new one).

Screen Shot 2023-01-14 at 10 41 54 am

Screen Shot 2023-01-14 at 10 42 05 am

Screen Shot 2023-01-14 at 10 42 18 am

@pfeerick
Copy link
Member

Discussion point: What about two buttons at the bottom... one for new, one for paste? i.e. 2 half-width buttons.

Either way, I think we need the same thing done here for the mixes and inputs pages as well.

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 14, 2023

Paste is only active if a copy has already been done so you would have a hidden button or one that did nothing.

@philmoz philmoz force-pushed the logical-switches-layout branch from f0787ff to 38e7083 Compare January 15, 2023 08:57
@philmoz
Copy link
Collaborator Author

philmoz commented Jan 15, 2023

I have added a long press handler to quickly access the '+' button functions.

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 16, 2023

I have changed the logical switch overview to display the switch function and parameters as an expression (like the special functions PR).

I think this makes the switch operation easier to understand in the overview.

Also added a 's' suffix to time values in the overview and edit pages.

Screen Shot 2023-01-16 at 11 12 50 am

Screen Shot 2023-01-16 at 11 01 57 am

@JimB40
Copy link
Collaborator

JimB40 commented Jan 16, 2023

@

I have changed the logical switch overview to display the switch function and parameters as an expression (like the special functions PR).

I think this makes the switch operation easier to understand in the overview.

I don't think it will work this way .

  1. Readiness decreased

  2. Have you proofed it with max length data values?
    212042683-1d280fa1-c9c1-4fc1-8c10-ce130a70bafe
    As you can see there is not much fee space, so after adding ON/OFF labels clipping or other layout breaks will occur.

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 16, 2023

These are the widest values I can find:

Screen Shot 2023-01-16 at 5 53 29 pm

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 16, 2023

Maybe it's just me; but I find this:

Screen Shot 2023-01-16 at 6 16 21 pm

is easier to understand than this:

Screen Shot 2023-01-16 at 6 16 10 pm

@JimB40
Copy link
Collaborator

JimB40 commented Jan 16, 2023

Widest value is negated max telemetry sensor "!WWWW+"

But plaese don't change as there are much more data variances that will cause layout to break.
IE telemetry sensors have unit that can be pretty long and will not fit in any way.
Changig V1 and V2 to ON/OFF is not so simple too plus we have to change docs.

Most important is to see on list properly

  • switch/source icon & name
  • value

LS List

I've tried labels with TINSIZE font but this can decrese UI speed and makes overview cluttered anyway.
LS List Labels

We may try to fit in 3.0 header with column names but this will not work for vertical screen anyway.

@Eldenroot
Copy link
Contributor

I've tried labels with TINSIZE font but this can decrese UI speed and makes overview cluttered anyway. LS List Labels

We may try to fit in 3.0 header with column names but this will not work for vertical screen anyway.

Anyway, I love it! Really no way to get this? :)

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 17, 2023

@JimB40 Here is another idea to make more room (not sure about the labels as translation could be a problem).

Screen Shot 2023-01-17 at 1 00 33 pm

@philmoz philmoz force-pushed the logical-switches-layout branch 2 times, most recently from 088809a to f3ee00b Compare January 18, 2023 10:45
@philmoz philmoz force-pushed the logical-switches-layout branch from bd73ff3 to 48f7500 Compare January 25, 2023 07:55
@JimB40
Copy link
Collaborator

JimB40 commented Jan 26, 2023

@philmoz Logical Switches labels are only ones that do not follow XX00 pattern.
CH01,CH02,..
TR01,TR02,..
SF1,SF2,...
GV1,GV2,...
FM1,FM2

Can we adjust Logic Switches labels to LS01, LS02 instead of L01,L02

@pfeerick
Copy link
Member

pfeerick commented Jan 26, 2023

While I do agree, that probably should be material for a different PR. You're talking about a system-wide change (probably also with a Companion UI component also), rather than effectively just the LS LVGL page conversion.

edit: Also need to consider B&W UI, as the same terminology should be used for both colorlcd and B&W.

Phil Mitchell added 18 commits January 26, 2023 20:57
- Use LVGL flex / grid layout
- Same height for all buttons
- Display logical switch name inside button so entire row acts as button
- Consistent press handler for buttons (always show popup menu)
- Group buttons for empty switch in lines to utilise space
- Remember selected button and reselect after edit.
@philmoz philmoz force-pushed the logical-switches-layout branch from 48f7500 to 0a6b966 Compare January 26, 2023 09:58
@pfeerick pfeerick merged commit d77389d into EdgeTX:main Jan 27, 2023
mha1 pushed a commit to mha1/edgetx that referenced this pull request Jan 27, 2023
* Update logical switch layout:
- Use LVGL flex / grid layout
- Same height for all buttons
- Display logical switch name inside button so entire row acts as button
- Consistent press handler for buttons (always show popup menu)
- Group buttons for empty switch in lines to utilise space
- Remember selected button and reselect after edit.

* Fix incorrect switch being selected when changing tabs.

* Fix selection of focussed button when using 'Clear', and switching tabs.

* Reorganise logical switch edit code.

* Change button style to match input/mixes/outputs pages.

* Single line overview on landscape LCD layout. Convert to using grid and lgvl objects for overview buttons.

* Remove redundant flag.

* Remove logic that tries to center scroll around selected button (not working).

* Remove empty buttons and add a single '+' button at the bottom to match inputs and mixes.

* Remove unused code.

* Correct string usage.

* Add long press handler for quick access to the '+' button functions.

* Display logical switch operation and parameters as an expression. Add 's' suffix to time values.

* Adjust spacing.

* Set V2 number edit control to automatically resize and fit content to prevent clipping of large values.

* Revert to fixed column layout.

* Adjust grid spacing.

* Convert the logical switch view in the channel monitor to LVGL flex.

* chore: Formatting

Co-authored-by: Phil Mitchell <[email protected]>
Co-authored-by: Peter Feerick <[email protected]>
@JimB40 JimB40 mentioned this pull request Feb 21, 2023
23 tasks
@philmoz philmoz deleted the logical-switches-layout branch September 20, 2023 02:46
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 UX-UI Related to user experience (UX) or user interface (UI) behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants