mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-27 02:40:05 +00:00
Merge branch 'master' into viewport
# Conflicts: # imgui.h
This commit is contained in:
commit
2a1e903f43
5 changed files with 232 additions and 183 deletions
|
|
@ -6223,7 +6223,10 @@ bool ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags f
|
|||
ImGuiTabBar* tab_bar = g.CurrentTabBar.back();
|
||||
bool ret = TabItemEx(tab_bar, label, p_open, flags);
|
||||
if (ret && !(flags & ImGuiTabItemFlags_NoPushId))
|
||||
PushID(tab_bar->Tabs[tab_bar->LastTabItemIdx].ID);
|
||||
{
|
||||
ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
|
||||
g.CurrentWindow->IDStack.push_back(tab->ID); // We already hashed 'label' so push into the ID stack directly instead of doing another hash through PushID(label)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -6237,7 +6240,7 @@ void ImGui::EndTabItem()
|
|||
ImGuiTabBar* tab_bar = g.CurrentTabBar.back();
|
||||
ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
|
||||
if (!(tab->Flags & ImGuiTabItemFlags_NoPushId))
|
||||
PopID();
|
||||
g.CurrentWindow->IDStack.pop_back();
|
||||
}
|
||||
|
||||
bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags)
|
||||
|
|
@ -6345,6 +6348,8 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
|
|||
|
||||
// Click to Select a tab
|
||||
ImGuiButtonFlags button_flags = (ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_AllowItemOverlap);
|
||||
if (g.DragDropActive)
|
||||
button_flags |= ImGuiButtonFlags_PressedOnDragDropHold;
|
||||
bool hovered, held;
|
||||
bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags);
|
||||
hovered |= (g.HoveredId == id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue