fix(color): Main view numbering (#3357)
* fix(ui): Main view numbering #3073 * Fix max last tab focus.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user