mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +00:00
This commit is contained in:
parent
50faccf764
commit
1ae7f88495
5
imgui.h
5
imgui.h
@ -806,8 +806,9 @@ enum ImGuiTabBarFlags_
|
||||
ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 1 << 2, // Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You can still repro this behavior on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
|
||||
ImGuiTabBarFlags_NoTabListPopupButton = 1 << 3,
|
||||
ImGuiTabBarFlags_NoTabListScrollingButtons = 1 << 4,
|
||||
ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 5, // Resize tabs when they don't fit
|
||||
ImGuiTabBarFlags_FittingPolicyScroll = 1 << 6, // Add scroll buttons when tabs don't fit
|
||||
ImGuiTabBarFlags_NoTooltip = 1 << 5, // Disable tooltips when hovering a tab
|
||||
ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, // Resize tabs when they don't fit
|
||||
ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, // Add scroll buttons when tabs don't fit
|
||||
ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll,
|
||||
ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown
|
||||
};
|
||||
|
@ -6241,6 +6241,7 @@ void ImGui::EndTabItem()
|
||||
|
||||
IM_ASSERT(g.CurrentTabBar.Size > 0 && "Needs to be called between BeginTabBar() and EndTabBar()!");
|
||||
ImGuiTabBar* tab_bar = g.CurrentTabBar.back();
|
||||
IM_ASSERT(tab_bar->LastTabItemIdx >= 0 && "Needs to be called between BeginTabItem() and EndTabItem()");
|
||||
ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
|
||||
if (!(tab->Flags & ImGuiTabItemFlags_NoPushId))
|
||||
g.CurrentWindow->IDStack.pop_back();
|
||||
@ -6422,7 +6423,8 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
|
||||
|
||||
// Tooltip (FIXME: Won't work over the close button because ItemOverlap systems messes up with HoveredIdTimer)
|
||||
if (g.HoveredId == id && !held && g.HoveredIdNotActiveTimer > 0.50f)
|
||||
SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
|
||||
if (!(tab_bar->Flags & ImGuiTabBarFlags_NoTooltip))
|
||||
SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
|
||||
|
||||
return tab_contents_visible;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user