From 6a47edcd35884095946f761fa3aa2367c7c26442 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 28 Sep 2023 10:43:48 +1000 Subject: Use databinding for the top bar. It's so nice now! --- src/ui/include/screen.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/ui/include/screen.hpp') 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 data_bindings_; std::pmr::vector> 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 -- cgit v1.2.3