From d51e5d28985a52bc0cd7061710bc180afeecb360 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 21 Jun 2022 17:20:06 +0200 Subject: [PATCH] TabItem: revert support for SetNextItemOpen(true) at it creates too much ambiguity with p_open/close button vs Selected state. (#5262) Revert a small part of 4b97296. --- docs/CHANGELOG.txt | 2 +- imgui_widgets.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 339e5c0b..1fec90da 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -105,7 +105,7 @@ Other Changes: merging drawcall of the last column didn't always work (regression since 1.87). (#4843, #4844) [@rokups] - Inputs: Fixed IsMouseClicked() repeat mode rate being half of keyboard repeat rate. - ColorEdit: Fixed text baseline alignment after a SameLine() after a ColorEdit() with visible label. -- TabBar: TabItem() now reacts to SetNextItemWidth() and SetNextItemOpen(true). (#5262) +- TabBar: TabItem() now reacts to SetNextItemWidth(). (#5262) - TabBar: Tweak shrinking policy so that while resizing tabs that don't need shrinking keep their initial width more precisely (without the occasional +1 worth of width). - Menus: Adjusted BeginMenu() closing logic so hovering void or non-MenuItem() in parent window diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index ac1d47d7..98fec844 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -8105,11 +8105,6 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, tab_bar->NextSelectedTabId = id; // New tabs gets activated if ((flags & ImGuiTabItemFlags_SetSelected) && (tab_bar->SelectedTabId != id)) // _SetSelected can only be passed on explicit tab bar tab_bar->NextSelectedTabId = id; - if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasOpen) - { - IM_ASSERT(g.NextItemData.OpenVal == true && g.NextItemData.OpenCond == ImGuiCond_Always); // SetNextItemOpen(true, ImGuiCond_Always) is supported but other combinations are not. - tab_bar->NextSelectedTabId = id; - } } // Lock visibility