fix(color): pressing a key may cause unnecessary page reload (#6996)

This commit is contained in:
philmoz
2026-01-20 17:27:27 +10:00
committed by GitHub
parent 049d7d5e2c
commit 1ef26b96b8
3 changed files with 4 additions and 4 deletions
@@ -400,7 +400,7 @@ void PageGroupBase::doKeyShortcut(event_t event)
if (pg == QM_OPEN_QUICK_MENU) {
if (!quickMenu) openMenu();
} else {
if (QuickMenu::pageIcon(pg) == icon) {
if (QuickMenu::subMenuIcon(pg) == icon) {
setCurrentTab(QuickMenu::pageIndex(pg));
} else {
onCancel();
@@ -366,7 +366,7 @@ void QuickMenu::openPage(QMPage page)
}
}
EdgeTxIcon QuickMenu::pageIcon(QMPage page)
EdgeTxIcon QuickMenu::subMenuIcon(QMPage page)
{
for (int i = FIRST_SEARCH_IDX; qmTopItems[i].icon != EDGETX_ICONS_COUNT; i += 1) {
if (qmTopItems[i].pageAction == QM_ACTION) {
@@ -377,7 +377,7 @@ EdgeTxIcon QuickMenu::pageIcon(QMPage page)
PageDef* sub = qmTopItems[i].subMenuItems;
for (int j = 0; sub[j].icon != EDGETX_ICONS_COUNT; j += 1) {
if (sub[j].qmPage == page) {
return sub[j].icon;
return qmTopItems[i].icon;
}
}
}
@@ -70,7 +70,7 @@ class QuickMenu : public NavWindow
static void shutdownQuickMenu();
static void selected();
static void openPage(QMPage page);
static EdgeTxIcon pageIcon(QMPage page);
static EdgeTxIcon subMenuIcon(QMPage page);
static int pageIndex(QMPage page);
static std::vector<std::string> menuPageNames(bool forFavorites);