UI: Implement initial document stack logic

This commit is contained in:
Luke Street
2026-04-30 17:21:55 -06:00
parent 1c9e1c0a66
commit 62edb3abc6
9 changed files with 64 additions and 61 deletions
+9
View File
@@ -58,6 +58,15 @@ void TabBar::add_tab(const Rml::String& title, TabCallback callback) {
}
bool TabBar::set_active_tab(int index) {
if (index == -1) {
// Clear currently selected tab
for (int i = 0; i < static_cast<int>(mTabs.size()); ++i) {
mTabs[i].button.set_selected(false);
}
mProps.selectedTabIndex = -1;
return true;
}
if (index < 0 || index >= mTabs.size() || index == mProps.selectedTabIndex) {
return false;
}