Skip to content

Commit bdc8cf0

Browse files
authored
fix(color): quick menu does not close when screen tapped outside quick menu area (#7124)
1 parent 21811a6 commit bdc8cf0

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

radio/src/gui/colorlcd/setup_menus/quick_menu.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,35 +223,37 @@ void QuickMenu::shutdownQuickMenu()
223223
}
224224

225225
QuickMenu::QuickMenu() :
226-
NavWindow(MainWindow::instance(), {QM_X, QM_Y, QM_W, QM_H})
226+
NavWindow(MainWindow::instance(), {0, 0, LCD_W, LCD_H})
227227
{
228228
setWindowFlag(OPAQUE);
229229

230-
etx_obj_add_style(lvobj, styles->bg_opacity_90, LV_PART_MAIN);
231-
etx_bg_color(lvobj, COLOR_THEME_QM_BG_INDEX);
230+
Window* w = new Window(this, {QM_X, QM_Y, QM_W, QM_H});
232231

233-
auto sep = lv_obj_create(lvobj);
232+
etx_obj_add_style(w->getLvObj(), styles->bg_opacity_90, LV_PART_MAIN);
233+
etx_bg_color(w->getLvObj(), COLOR_THEME_QM_BG_INDEX);
234+
235+
auto sep = lv_obj_create(w->getLvObj());
234236
etx_solid_bg(sep, COLOR_THEME_QM_FG_INDEX);
235237
lv_obj_set_size(sep, QM_W, PAD_THREE);
236238

237239
auto mask = getBuiltinIcon(ICON_TOP_LOGO);
238-
new StaticIcon(this, (QM_W - mask->width) / 2, 0, ICON_TOP_LOGO, COLOR_THEME_QM_FG_INDEX);
240+
new StaticIcon(w, (QM_W - mask->width) / 2, 0, ICON_TOP_LOGO, COLOR_THEME_QM_FG_INDEX);
239241

240242
new ButtonBase(
241-
this, {0, 0, QM_W, EdgeTxStyles::UI_ELEMENT_HEIGHT},
243+
w, {0, 0, QM_W, EdgeTxStyles::UI_ELEMENT_HEIGHT},
242244
[=]() -> uint8_t {
243245
inSubMenu = false;
244246
onCancel();
245247
return 0;
246248
},
247249
window_create);
248250

249-
auto box = new Window(this, {QM_MAIN_X, QM_MAIN_Y, QM_MAIN_W, QM_MAIN_H});
251+
auto box = new Window(w, {QM_MAIN_X, QM_MAIN_Y, QM_MAIN_W, QM_MAIN_H});
250252

251253
mainMenu = new QuickMenuGroup(box);
252254

253255
#if VERSION_MAJOR > 2
254-
box = new Window(this, {QM_SUB_X, QM_SUB_Y, QM_SUB_W, QM_SUB_H});
256+
box = new Window(w, {QM_SUB_X, QM_SUB_Y, QM_SUB_W, QM_SUB_H});
255257

256258
int f = 0;
257259
for (int i = 0; i < MAX_QM_FAVORITES; i += 1) {

radio/src/gui/colorlcd/setup_menus/quick_menu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class QuickMenu : public NavWindow
137137

138138
void focusMainMenu();
139139

140+
void onClicked() override { onCancel(); }
140141
void deleteLater(bool detach = true, bool trash = true) override;
141142

142143
#if VERSION_MAJOR > 2

0 commit comments

Comments
 (0)