diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-01-15 12:31:20 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-01-15 12:31:20 +1100 |
| commit | 7cdcd44e0ca10ebdc796638190ed1d9b45d99ef0 (patch) | |
| tree | 637b43848d17c9dbdc1688cb4733eb235f223e37 /src/ui/screen.cpp | |
| parent | 0e04eb918ec976017276306181282769d8896c83 (diff) | |
| download | tangara-fw-7cdcd44e0ca10ebdc796638190ed1d9b45d99ef0.tar.gz | |
Begin migration of remaining screens to Lua
Diffstat (limited to 'src/ui/screen.cpp')
| -rw-r--r-- | src/ui/screen.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/ui/screen.cpp b/src/ui/screen.cpp index 9ac5ec0e..3e4f8e42 100644 --- a/src/ui/screen.cpp +++ b/src/ui/screen.cpp @@ -13,8 +13,6 @@ #include "hal/lv_hal_disp.h" #include "misc/lv_area.h" #include "misc/lv_color.h" -#include "model_top_bar.hpp" -#include "widget_top_bar.hpp" namespace ui { @@ -49,43 +47,4 @@ Screen::~Screen() { lv_obj_del(root_); } -auto Screen::CreateTopBar(lv_obj_t* parent, - const widgets::TopBar::Configuration& config, - models::TopBar& model) -> widgets::TopBar* { - assert(top_bar_ == nullptr); - top_bar_ = std::make_unique<widgets::TopBar>(parent, config, model); - if (top_bar_->button()) { - lv_group_add_obj(group_, top_bar_->button()); - } - return top_bar_.get(); -} - -MenuScreen::MenuScreen(models::TopBar& top_bar_model, - const std::pmr::string& title, - bool show_back_button) - : Screen() { - lv_group_set_wrap(group_, false); - - lv_obj_set_layout(content_, LV_LAYOUT_FLEX); - lv_obj_set_flex_flow(content_, LV_FLEX_FLOW_COLUMN); - lv_obj_set_flex_align(content_, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, - LV_FLEX_ALIGN_CENTER); - - widgets::TopBar::Configuration config{ - .show_back_button = show_back_button, - .title = title.c_str(), - }; - CreateTopBar(content_, config, top_bar_model); - - content_ = lv_obj_create(content_); - lv_obj_set_flex_grow(content_, 1); - lv_obj_set_width(content_, lv_pct(100)); - lv_obj_set_layout(content_, LV_LAYOUT_FLEX); - lv_obj_set_flex_flow(content_, LV_FLEX_FLOW_COLUMN); - lv_obj_set_flex_align(content_, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, - LV_FLEX_ALIGN_START); - - lv_obj_set_style_pad_all(content_, 4, LV_PART_MAIN); -} - } // namespace ui |
