Fix issue with the current tab not being saved through screen recreation

This commit is contained in:
Henrik Rydgård committed 2026-05-12 10:13:00 +02:00
1 parent e0d6664e85
commit 59f545e804
4 files changed
+16 -9

No files matched your search

+4 -1
View File
@@ -209,7 +209,10 @@ bool TabHolder::SetCurrentTab(int tab, bool skipTween) {
tabs_[tab]->SetVisibility(V_VISIBLE);
currentTab_ = tab;
UI::EventParams e{};
e.v = this;
e.a = currentTab_;
OnChangeTab.Trigger(e);
return created;
}
+2
View File
@@ -52,6 +52,8 @@ public:
}
bool EnsureTab(int index); // return true if it actually created a tab.
Event OnChangeTab;
private:
void AddTabContents(std::string_view title, ImageID imageId, ViewGroup *tabContents);
void OnTabClick(EventParams &e);