|
4 | 4 | * SPDX-License-Identifier: MIT |
5 | 5 | */ |
6 | 6 | #include "view.h" |
7 | | -#include <lvgl.h> |
| 7 | + |
| 8 | +#include <apps/utils/audio/audio.h> |
| 9 | +#include <assets/assets.h> |
8 | 10 | #include <hal/hal.h> |
| 11 | +#include <lvgl.h> |
9 | 12 | #include <mooncake_log.h> |
10 | | -#include <assets/assets.h> |
11 | 13 | #include <smooth_lvgl.h> |
12 | 14 | #include <smooth_ui_toolkit.h> |
13 | | -#include <apps/utils/audio/audio.h> |
14 | 15 |
|
15 | | -#include "custom/integration/settings_controller.h" |
16 | | -#include "custom/ui/pages/ui_page_settings.h" |
| 16 | +#include "integration/settings_controller.h" |
| 17 | +#include "ui/pages/ui_page_settings.h" |
17 | 18 | #include "ui/ui_root.h" |
18 | 19 |
|
19 | 20 | using namespace launcher_view; |
@@ -57,17 +58,20 @@ void LauncherView::init() |
57 | 58 | _panels.push_back(std::make_unique<PanelMusic>()); |
58 | 59 | _panels.push_back(std::make_unique<PanelComMonitor>()); |
59 | 60 |
|
60 | | - for (auto& panel : _panels) { |
| 61 | + for (auto& panel : _panels) |
| 62 | + { |
61 | 63 | panel->init(); |
62 | 64 | } |
63 | 65 |
|
64 | | - if (_ui_root != nullptr) { |
| 66 | + if (_ui_root != nullptr) |
| 67 | + { |
65 | 68 | _settings_controller.reset(); |
66 | 69 | ui_root_destroy(_ui_root); |
67 | 70 | _ui_root = nullptr; |
68 | 71 | } |
69 | 72 | _ui_root = ui_root_create(); |
70 | | - if (_ui_root != nullptr) { |
| 73 | + if (_ui_root != nullptr) |
| 74 | + { |
71 | 75 | _settings_controller = std::make_unique<SettingsController>(); |
72 | 76 |
|
73 | 77 | ui_page_settings_actions_t actions{}; |
@@ -185,15 +189,17 @@ void LauncherView::update() |
185 | 189 | { |
186 | 190 | LvglLockGuard lock; |
187 | 191 |
|
188 | | - for (auto& panel : _panels) { |
| 192 | + for (auto& panel : _panels) |
| 193 | + { |
189 | 194 | panel->update(_is_stacked); |
190 | 195 | } |
191 | 196 | } |
192 | 197 |
|
193 | 198 | LauncherView::~LauncherView() |
194 | 199 | { |
195 | 200 | _settings_controller.reset(); |
196 | | - if (_ui_root != nullptr) { |
| 201 | + if (_ui_root != nullptr) |
| 202 | + { |
197 | 203 | ui_root_destroy(_ui_root); |
198 | 204 | _ui_root = nullptr; |
199 | 205 | } |
|
0 commit comments