diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-09-28 10:43:48 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-09-28 10:43:48 +1000 |
| commit | 6a47edcd35884095946f761fa3aa2367c7c26442 (patch) | |
| tree | 5b34e1bf14759dcc78b6611b1b6538dc03119860 /src/ui/include/screen.hpp | |
| parent | f09ba5ffd53bf7d28e0dc516c00a8f69ca7efae9 (diff) | |
| download | tangara-fw-6a47edcd35884095946f761fa3aa2367c7c26442.tar.gz | |
Use databinding for the top bar. It's so nice now!
Diffstat (limited to 'src/ui/include/screen.hpp')
| -rw-r--r-- | src/ui/include/screen.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/include/screen.hpp b/src/ui/include/screen.hpp index ac7b19f8..e9eaeeb0 100644 --- a/src/ui/include/screen.hpp +++ b/src/ui/include/screen.hpp @@ -16,6 +16,7 @@ #include "core/lv_obj_tree.h" #include "event_binding.hpp" #include "lvgl.h" +#include "model_top_bar.hpp" #include "nod/nod.hpp" #include "widget_top_bar.hpp" @@ -37,8 +38,6 @@ class Screen { */ virtual auto Tick() -> void {} - auto UpdateTopBar(const widgets::TopBar::State& state) -> void; - auto root() -> lv_obj_t* { return root_; } auto content() -> lv_obj_t* { return content_; } @@ -52,8 +51,9 @@ class Screen { } protected: - auto CreateTopBar(lv_obj_t* parent, const widgets::TopBar::Configuration&) - -> widgets::TopBar*; + auto CreateTopBar(lv_obj_t* parent, + const widgets::TopBar::Configuration&, + models::TopBar& model) -> widgets::TopBar*; std::pmr::vector<bindey::scoped_binding> data_bindings_; std::pmr::vector<std::unique_ptr<EventBinding>> event_bindings_; @@ -78,7 +78,9 @@ class Screen { class MenuScreen : public Screen { public: - MenuScreen(const std::pmr::string& title, bool show_back_button = true); + MenuScreen(models::TopBar&, + const std::pmr::string& title, + bool show_back_button = true); }; } // namespace ui |
