Internals: Extracted some of the tab bar shrinking code into a ShrinkWidths() function so columns/table can use it.

This commit is contained in:
omar
2019-05-23 20:36:30 +02:00
parent 3fda90d6a7
commit ec3ec24157
2 changed files with 36 additions and 30 deletions

View File

@ -811,7 +811,7 @@ struct ImGuiNextItemData
// Tabs
//-----------------------------------------------------------------------------
struct ImGuiTabBarSortItem
struct ImGuiShrinkWidthItem
{
int Index;
float Width;
@ -976,7 +976,7 @@ struct ImGuiContext
ImPool<ImGuiTabBar> TabBars;
ImGuiTabBar* CurrentTabBar;
ImVector<ImGuiTabBarRef> CurrentTabBarStack;
ImVector<ImGuiTabBarSortItem> TabSortByWidthBuffer;
ImVector<ImGuiShrinkWidthItem> ShrinkWidthBuffer;
// Widget state
ImVec2 LastValidMousePos;
@ -1495,6 +1495,7 @@ namespace ImGui
IMGUI_API void PopItemFlag();
IMGUI_API bool IsItemToggledSelection(); // was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
IMGUI_API ImVec2 GetWorkRectMax();
IMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess);
// Logging/Capture
IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth); // -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.