From 3b3bc64d19715c418f407d5231795ca5a2c2fa71 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 25 Aug 2023 10:13:37 +1000 Subject: Add modal dialog support --- src/ui/lvgl_task.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ui/lvgl_task.cpp') diff --git a/src/ui/lvgl_task.cpp b/src/ui/lvgl_task.cpp index a77efa85..7d4024e5 100644 --- a/src/ui/lvgl_task.cpp +++ b/src/ui/lvgl_task.cpp @@ -35,6 +35,7 @@ #include "misc/lv_color.h" #include "misc/lv_style.h" #include "misc/lv_timer.h" +#include "modal.hpp" #include "relative_wheel.hpp" #include "tasks.hpp" #include "touchwheel.hpp" @@ -75,6 +76,7 @@ void LvglMain(std::weak_ptr weak_touch_wheel, TouchWheelEncoder encoder(weak_touch_wheel); std::shared_ptr current_screen; + lv_group_t* current_group = nullptr; auto* events = events::queues::Ui(); while (1) { while (events->Service(0)) { @@ -88,6 +90,11 @@ void LvglMain(std::weak_ptr weak_touch_wheel, current_screen = screen; } + if (current_screen->group() != current_group) { + current_group = current_screen->group(); + lv_indev_set_group(encoder.registration(), current_group); + } + if (current_screen) { current_screen->Tick(); } -- cgit v1.2.3