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

refactor(color): Use LVGL styles and objects for UI, legacy cleanup #4407

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Dec 12, 2023

This is a big refactor of the color UI code - hopefully without breaking too much; but there are bound to be some teething problems.

Main goals:

  • Use LVGL styles and objects for UI
  • Consistency
  • Cleanup legacy code
  • Groundwork for 3.0

For the most part things should look pretty much the same; however there are a few UI changes to note.

Focus border has been made thicker to be more visible:
Screenshot 2023-12-12 at 11 31 04 am

Text color on active item is PRIMARY1:
Screenshot 2023-12-12 at 11 32 01 am

Tick marks on sliders display over slider bar:
Screenshot 2023-12-11 at 5 26 03 pm

When editing screen layouts the selected widget has the solid border and the others have a dashed border:
Screenshot 2023-12-11 at 4 25 18 pm

Topbar battery icon shows battery level as a colored bar - green >= 60%, amber 25% - 59%, red < 25% (these are LVGL, not theme colors):
Screenshot 2023-12-11 at 4 23 32 pm

Timer widget count up/down bar uses an LVGL arc instead of a PNG image.:
Screenshot 2023-12-11 at 4 24 10 pm

Guage widget % value moved to above the bar - LVGL has no equivalent to the invertRect() function previously used.
Screenshot 2023-12-11 at 4 24 46 pm

@pfeerick pfeerick added the color Related generally to color LCD radios label Dec 12, 2023
@pfeerick
Copy link
Member

From the screenshots, a lot of this looks better. However, till will have to wait until we branch off for 2.10 for merge, given the amount of change involved.

@JimB40 I noticed in #3220 you never did anything for the mixer lines... any thoughts re: changing the active mixer line font color to PRIMARY1?

@pfeerick pfeerick changed the title chore(color): Color UI refactor. refactor(color): Use LVGL styles and objects for UI and legacy cleanup Dec 12, 2023
@pfeerick pfeerick changed the title refactor(color): Use LVGL styles and objects for UI and legacy cleanup refactor(color): Use LVGL styles and objects for UI, legacy cleanup Dec 12, 2023
@philmoz
Copy link
Collaborator Author

philmoz commented Dec 12, 2023

Updated USB SD connected display:
screen-2023-12-12-191605

@pfeerick pfeerick linked an issue Dec 12, 2023 that may be closed by this pull request
@pfeerick pfeerick added this to the 2.11 milestone Dec 12, 2023
@raphaelcoeffic
Copy link
Member

@philmoz looks good to me! Looks like tremendous amount of work!

@philmoz
Copy link
Collaborator Author

philmoz commented Dec 13, 2023

As of last commit this is now 18K smaller than current main on TX16S.

@philmoz
Copy link
Collaborator Author

philmoz commented Dec 16, 2023

Using one of the debug tools in LVGL it's possible to visualise the screen redraw/refresh overhead.
In the videos below, LVGL changes the color of any screen area that is being redrawn.

2.9 - yikes!:
https://github.com/EdgeTX/edgetx/assets/9474356/26149f2f-d7cc-4c3a-b9d9-daf25420d57e

2.10 main branch - better:
https://github.com/EdgeTX/edgetx/assets/9474356/874db46c-eb3d-4312-bd28-3dcfa9a0de7f

This PR:
https://github.com/EdgeTX/edgetx/assets/9474356/e9838ac8-3148-4cd6-bfd4-402d31efa682

Lua widgets still redraw every 100ms (or so) - we really need a better display API for Lua apps.

@richardclli
Copy link
Collaborator

So there will be a performance boost after this PR is applied?

Using one of the debug tools in LVGL it's possible to visualise the screen redraw/refresh overhead. In the videos below, LVGL changes the color of any screen area that is being redrawn.

@philmoz
Copy link
Collaborator Author

philmoz commented Dec 18, 2023

So there will be a performance boost after this PR is applied?

Well the CPU will be doing less work refreshing stuff so there should be some improvement.
How much is hard to determine - there are some pages that take a while to build; but this is LVGL overhead so they don't change.

On my TX16S this PR feels more responsive overall; but that could be my imagination :)

@XuNeo
Copy link

XuNeo commented Dec 19, 2023

Hi @philmoz ,

Lua widgets still redraw every 100ms (or so) - we really need a better display API for Lua apps.

I have developed a lua lvgl binding. It's not 100% finished yet, but I would love to hear from your input to make it better.

The binding will be upgraded to lvgl v9 soon, which has been improved a bit for bindings using the new property APIs.

@philmoz
Copy link
Collaborator Author

philmoz commented Dec 19, 2023

I have developed a lua lvgl binding. It's not 100% finished yet, but I would love to hear from your input to make it better.

The binding will be upgraded to lvgl v9 soon, which has been improved a bit for bindings using the new property APIs.

Thanks, it is on my radar to look all - does it support lvgl 8.2?

@XuNeo
Copy link

XuNeo commented Dec 19, 2023

I have just pushed a fix to make it compatible with v8.2. Not fully tested but the basic function can work now.

@philmoz philmoz force-pushed the color-UI-refactor branch 3 times, most recently from 9ba670e to b4340dc Compare December 22, 2023 05:19
@philmoz philmoz force-pushed the color-UI-refactor branch 4 times, most recently from d3fa509 to 216d222 Compare January 3, 2024 22:03
@philmoz philmoz force-pushed the color-UI-refactor branch from 216d222 to 0c56a3a Compare January 4, 2024 10:41
@3DRacer
Copy link

3DRacer commented Jan 4, 2024

My RM TX16S with DE language freezes when trying to display the SD card contents. Key SYS--> Open SD card directory. Only by removing the battery can it be revived. Is this known?

@philmoz
Copy link
Collaborator Author

philmoz commented Jan 4, 2024

My RM TX16S with DE language freezes when trying to display the SD card contents. Key SYS--> Open SD card directory. Only by removing the battery can it be revived. Is this known?

Are you using the latest version of this PR?
Does it happen with the current nightly version?
Can you try a different SD card?

@3DRacer
Copy link

3DRacer commented Jan 5, 2024

My RM TX16S with DE language freezes when trying to display the SD card contents. Key SYS--> Open SD card directory. Only by removing the battery can it be revived. Is this known?

Are you using the latest version of this PR? Does it happen with the current nightly version? Can you try a different SD card?

  • yes, that is the version from January 4th. Same problem with previous versions of this PR
  • SD content view is fine with latest nightly fa12b27
  • My SD is a sandisk16GB, formatted in 4GB with 4KB cluster
  • With another SD 16GB with FAT32 standard formatting the channel also freezes

Note: The problem occurs with several themes. With the edgetx standard themes (tested with blue) the display of the SD card content works perfectly.

@philmoz philmoz force-pushed the color-UI-refactor branch from 0c56a3a to 254c4f4 Compare January 7, 2024 03:30
@offer-shmuely
Copy link
Contributor

can the "title scroll up" be part of this changes?
as describe in #3667

@philmoz
Copy link
Collaborator Author

philmoz commented Feb 19, 2024

can the "title scroll up" be part of this changes? as describe in #3667

Not planned (by me) at this stage. I have not looked at it closely enough yet to say how feasible it will be.

@philmoz philmoz force-pushed the color-UI-refactor branch 2 times, most recently from d78dca1 to f826ecd Compare February 26, 2024 04:07
@philmoz philmoz force-pushed the color-UI-refactor branch 3 times, most recently from 5226f44 to 1d28a66 Compare March 11, 2024 02:33
@philmoz philmoz force-pushed the color-UI-refactor branch 4 times, most recently from 2fcbf69 to 18d6cdf Compare March 22, 2024 19:59
@philmoz philmoz force-pushed the color-UI-refactor branch 4 times, most recently from 8ccefad to df6c64a Compare March 29, 2024 09:16
@philmoz philmoz force-pushed the color-UI-refactor branch from df6c64a to 1fd9858 Compare April 1, 2024 01:45
@philmoz philmoz force-pushed the color-UI-refactor branch from 1fd9858 to fdae027 Compare April 3, 2024 02:38
@pfeerick
Copy link
Member

pfeerick commented Apr 3, 2024

When editing screen layouts the selected widget has the solid border and the others have a dashed border:
Screenshot 2023-12-11 at 4 25 18 pm

When you first go in, the first box has both dotted and solid border.

Topbar battery icon shows battery level as a colored bar - green >= 60%, amber 25% - 59%, red < 25% (these are LVGL, not theme colors):
Screenshot 2023-12-11 at 4 23 32 pm

I do like this for the the default theme, but I wonder if it will become a problem for other themes... ie.. when the top bar is red or green...

I also like how there is now a "dimming" for disabled controls, and also when you touch/ENTER on controls (i.e. giving feedback).

In Model Setup, the fields for the model image and name are shorter... the former isn't such an issue, but the latter should be longer so you can see more of the name.

Other visual changes look fine. Performance wise, having just come from 2.10-rc2, this actually feels more sluggish.
Also, when you are in the channel monitor, you can actually see the channel bars and text rebuilt, whereas 2.10 has no delay/artifacts.

@philmoz
Copy link
Collaborator Author

philmoz commented Apr 3, 2024

When editing screen layouts the selected widget has the solid border and the others have a dashed border:
When you first go in, the first box has both dotted and solid border.

Thanks, may have lost something in one of the rebases. Will look into it.

In Model Setup, the fields for the model image and name are shorter... the former isn't such an issue, but the latter should be longer so you can see more of the name.

The boxes should resize to fit the name - they do on my TX16S.

Performance wise, having just come from 2.10-rc2, this actually feels more sluggish. Also, when you are in the channel monitor, you can actually see the channel bars and text rebuilt, whereas 2.10 has no delay/artifacts.

Which radio?
The channel monitor has no issues on my TX16S, and overall performance does not seem slower to me.
Can you record a video of the channel monitor.
I did timing tests between 2.9 and this PR a while ago but have not done any recently - they were pretty similar across the board.

@pfeerick
Copy link
Member

pfeerick commented Apr 3, 2024

TX16S. you'll see on the radio on the left the lag and also the shorter than model name field.

Video may still be unavailable for a few minutes as was still running through copyright checks... https://youtu.be/gg5X17oLii8

Performance updates.
Make model name input field longer.
Fix initialisation of various items.
@philmoz
Copy link
Collaborator Author

philmoz commented Apr 4, 2024

I've fixed the channel monitor and the model name field size plus made a few performance improvements.
I still have to do some work on the Mixes and Outputs pages as they are slightly slower than 2.10; but the rest of the UI should perform similarly to 2.10 as far as I can tell.

@pfeerick
Copy link
Member

pfeerick commented Apr 5, 2024

Much better... it's still a little more sluggish than 2.10 but much better than it was. Did you want to work on this more or merge and keep going? One less PR to rebase ;)

@philmoz
Copy link
Collaborator Author

philmoz commented Apr 5, 2024

Much better... it's still a little more sluggish than 2.10 but much better than it was. Did you want to work on this more or merge and keep going? One less PR to rebase ;)

If you're ready to go with big 2.11 changes then I'd like to get this in.

@pfeerick pfeerick merged commit f28c115 into EdgeTX:main Apr 5, 2024
44 checks passed
@pfeerick
Copy link
Member

pfeerick commented Apr 5, 2024

Your wish is granted. I'm crossing fingers 2.10 won't be needing any major changes by this point in the RC cycle so cherrypicking anything needed for it not too... painful?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change USB screen to preserve radio battery
8 participants