mirror of https://github.com/WerWolv/ImHex
fix: ImGui assert due to trying to select tab bar button
This commit is contained in:
parent
98e9729267
commit
265360229f
|
|
@ -192,9 +192,16 @@ namespace hex::plugin::builtin {
|
|||
}
|
||||
|
||||
static void selectFirstTabItem() {
|
||||
auto tabBar = ImGui::GetCurrentTabBar();
|
||||
if (tabBar != nullptr && tabBar->Tabs.Size > 0) {
|
||||
tabBar->SelectedTabId = tabBar->Tabs.front().ID;
|
||||
auto *tabBar = ImGui::GetCurrentTabBar();
|
||||
if (tabBar != nullptr) {
|
||||
for (const auto &tab : tabBar->Tabs) {
|
||||
if (tab.Flags & ImGuiTabItemFlags_Button) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tabBar->SelectedTabId = tab.ID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue