Tabs: Non-docking tab bars are storing names to allow tab list button + whole style scaling. Added ImGuiTabBarFlags_TabListPopupButton flag to show a popup button on manual tab bars. Locking FramePadding for the scope of a tab-bar to avoid sheering/clipping of tab item. Made scaling of tab ellipsis less awkward. (#261, #351)
ImGuiTabBarFlags_Reorderable=1<<0,// Allow manually dragging tabs to re-order them + New tabs are appended at the end of list
ImGuiTabBarFlags_AutoSelectNewTabs=1<<1,// Automatically select new tabs when they appear
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_TabListPopupButton =1<<2,
ImGuiTabBarFlags_NoCloseWithMiddleMouseButton=1<<3,// 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_NoTabListScrollingButtons=1<<4,
ImGuiTabBarFlags_NoTooltip=1<<5,// Disable tooltips when hovering a tab
ImGuiTabBarFlags_FittingPolicyResizeDown=1<<6,// Resize tabs when they don't fit
ImGuiTabBarFlags_DockNode=1<<20,// [Docking: Unused in Master Branch] Part of a dock node
ImGuiTabBarFlags_DockNodeIsDockSpace=1<<21,// [Docking: Unused in Master Branch] Part of an explicit dockspace node node
ImGuiTabBarFlags_IsFocused=1<<22,
ImGuiTabBarFlags_SaveSettings=1<<23// FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
ImGuiTabBarFlags_DockNode=1<<20,// Part of a dock node
ImGuiTabBarFlags_IsFocused=1<<21,
ImGuiTabBarFlags_SaveSettings=1<<22// FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
};
enumImGuiTabItemFlagsPrivate_
{
ImGuiTabItemFlags_NoCloseButton=1<<20// Store whether p_open is set or not, which we need to recompute WidthContents during layout.
};
// Storage for one active tab item (sizeof() 26~32 bytes)
@ -1258,11 +1262,12 @@ struct ImGuiTabItem
ImGuiTabItemFlagsFlags;
intLastFrameVisible;
intLastFrameSelected;// This allows us to infer an ordered list of the last activated tabs with little maintenance
intNameOffset;// When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
floatOffset;// Position relative to beginning of tab
floatWidth;// Width currently displayed
floatWidthContents;// Width of actual contents, stored during BeginTabItem() call
// AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
// Refresh tab width immediately if we can (for manual tab bar, WidthContent will lag by one frame which is mostly noticeable when changing style.FramePadding.x)
// Refresh tab width immediately, otherwise changes of style e.g. style.FramePadding.x would noticeably lag in the tab bar.
// Additionally, when using TabBarAddTab() to manipulate tab bar order we occasionally insert new tabs that don't have a width yet,
// and we cannot wait for the next BeginTabItem() call. We cannot compute this width within TabBarAddTab() because font size depends on the active window.