Resolve RmlUi deprecation warning, add L1/R1 tabbing to MenuBar

This commit is contained in:
Irastris
2026-05-07 13:48:12 -04:00
parent ff054f6f47
commit cf12d19860
4 changed files with 17 additions and 7 deletions
+11 -1
View File
@@ -212,6 +212,15 @@ bool TabBar::handle_nav_command(Rml::Event& event, NavCommand cmd) {
if (activeTab != -1) {
currentComponent = activeTab;
}
} else {
int activeTab = tab_containing(event.GetTargetElement());
if (activeTab != -1) {
currentComponent = activeTab;
} else if (mLastFocusedTabIndex >= 0 &&
mLastFocusedTabIndex < static_cast<int>(mTabs.size()))
{
currentComponent = mLastFocusedTabIndex;
}
}
int direction = isNext ? 1 : -1;
if (currentComponent == -1) {
@@ -221,8 +230,9 @@ bool TabBar::handle_nav_command(Rml::Event& event, NavCommand cmd) {
return false;
}
currentComponent = -1;
} else if (cmd == NavCommand::Next) {
currentComponent = -1;
} else {
// Next/Previous require a currently selected tab to navigate from
return false;
}
}