fix(color): Main view numbering (#3357)

* fix(ui): Main view numbering #3073

* Fix max last tab focus.
This commit is contained in:
Risto
2023-03-17 10:27:47 +10:00
committed by GitHub
parent 816a823727
commit 150f341a23
17 changed files with 35 additions and 21 deletions
+10 -5
View File
@@ -46,7 +46,16 @@ void ScreenMenu::updateTabs(int8_t tabIdx)
if (customScreens[index]) {
auto tab = new ScreenSetupPage(this, getTabs(), index);
std::string title(STR_MAIN_VIEW_X);
title.back() = index + '1';
if (index >= 9)
{
title[title.size() - 2] = '1';
title.back() = (index - 9) + '0';
}
else
{
title[title.size() - 2] = index + '1';
title.back() = ' ';
}
tab->setTitle(title);
tab->setIcon(ICON_THEME_VIEW1 + index);
@@ -66,9 +75,5 @@ void ScreenMenu::updateTabs(int8_t tabIdx)
tab = tabIdx;
}
auto tabs = getTabs();
if (tab >= tabs - 1) {
tab = tabs - 2;
}
setCurrentTab(tab);
}
+10 -1
View File
@@ -138,7 +138,16 @@ void ScreenAddPage::build(FormWindow * window)
auto tab = new ScreenSetupPage(menu, pageIndex, newIdx);
std::string title(STR_MAIN_VIEW_X);
title.back() = newIdx + '1';
if (newIdx >= 9)
{
title[title.size() - 2] = '1';
title.back() = (newIdx - 9) + '0';
}
else
{
title[title.size() - 2] = newIdx + '1';
title.back() = ' ';
}
tab->setTitle(title);
tab->setIcon(ICON_THEME_VIEW1 + newIdx);