Commit graph

12 commits

Author SHA1 Message Date
MatthewColvin
f9dd87fbe7 push Display settings page on a tem button press 2023-10-07 19:54:05 -05:00
MatthewColvin
235d8e043f Convert Lvgl resource manager to recursive mutex to allow re locking in thread.
This helps with creation and getting values and should be safe since it still keeps lvgl on  one thread at a time.

Add OnLvglEvent to UIElement that allows foreasy place for UI Elements  to respond to LVGL events .

Add button  class that can react to being presssed via a  callback function.

Add GetBottom() api to allow easy grabbing of bottom Y coordinate.

use some new stuff in the settings  page to sort test it all out.
2023-10-06 22:11:15 -05:00
MatthewColvin
a11b78c540 boiler plate code for Pop up Screen to UI to allow for quick way to launch pages.
This will be huge for RAM saving as the page will de alloc when closed.
2023-10-06 14:25:05 -05:00
MatthewColvin
6343a48be1 Add align to api to UIElement
fix settings page bug where silder were not getting correct Y value set
2023-10-06 13:19:11 -05:00
MatthewColvin
4a5c83c8b9 fully implement Key press handeling in HAL for esp32 hardware and switch hardware to use the refactored UI
make UI add widgets on button presses as a demo
2023-10-05 09:53:07 -05:00
MatthewColvin
94d75fa4d5 Make Key press sim use SDL event watcher for key event grabbing.
Create a mutex for UI that will help make it possible to run handlers that update UI elements on seprate threads.

its far from perfect but should hold up for now.
2023-10-02 20:41:42 -05:00
MatthewColvin
3bd2b1a98a propigate key events around UI
use key events to add and remove sliders from settings as example
2023-10-01 18:53:25 -05:00
MatthewColvin
a44e92ea5d Add boiler plate Key Handling Into the UI code for UI elements 2023-09-29 16:03:51 -05:00
Matthew Colvin
0796176a0e Add Getters and setters for X and Y values
had to make sure the getters properly calculated layout before retrieving values.

Add a Tab class to allow for better control of adding content into the tabs and managing the contents once its in there.

Use setting class to do a quick demo of the OnShow code abilities. This could be useful for things like settings pages that need to load up HW resources when they are shown but then can power them down when they are hidden.
2023-09-23 01:06:06 -05:00
Matthew Colvin
7c089e395a Add an Helper in UIElement that converts lvgl object into UIElements or children via a static cast.
Make Tabview a friend of Base Page to allow it to notify pages that they are hidden or showing.

Implement the notification in Tabview to allow pages to know they are showing.
2023-09-22 23:36:25 -05:00
Matthew Colvin
1cc65594a9 Added concept of Background Screen that allows for construction of pages before knowing the final parent.
This will allow for easy creation of "pages" that can be layed out internally and passed to different screens and cleaned up when screens are cleaned up by the screen manager

add set width and height to base elements that allow for easy resizing

Create a settings page and make it red.
Test adding 2 tabs with the Page

this currently does not do anything fantastic on simulator but it sets a strong foundation for managing multiple pages
2023-09-22 19:59:24 -05:00
MatthewColvin
7fd53ef2f8 switching computers so just commiting 2023-09-21 19:31:51 -05:00