1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-02-02 03:40:06 +00:00

Merge branch 'master' into docking

# Conflicts:
#	imgui.cpp
#	imgui.h
#	imgui_internal.h
#	imgui_widgets.cpp
This commit is contained in:
ocornut 2022-12-08 21:18:35 +01:00
commit c191faf0ba
7 changed files with 223 additions and 100 deletions

View file

@ -7722,7 +7722,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
window->DC.IdealMaxPos.x = ImMax(window->DC.IdealMaxPos.x, tab_bar->BarRect.Min.x + tab_bar->WidthAllTabsIdeal);
}
// Dockable uses Name/ID in the global namespace. Non-dockable items use the ID stack.
// Dockable windows uses Name/ID in the global namespace. Non-dockable items use the ID stack.
static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label, ImGuiWindow* docked_window)
{
if (docked_window != NULL)
@ -8178,18 +8178,17 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
tab->Flags = flags;
tab->Window = docked_window;
// Append name with zero-terminator
// Append name _WITH_ the zero-terminator
// (regular tabs are permitted in a DockNode tab bar, but window tabs not permitted in a non-DockNode tab bar)
if (tab->Window != NULL)
if (docked_window != NULL)
{
IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_DockNode);
tab->NameOffset = -1;
}
else
{
IM_ASSERT(tab->Window == NULL);
tab->NameOffset = (ImS32)tab_bar->TabsNames.size();
tab_bar->TabsNames.append(label, label + strlen(label) + 1); // Append name _with_ the zero-terminator.
tab_bar->TabsNames.append(label, label + strlen(label) + 1);
}
// Update selected tab