Tab Bar: Tidying up. Rework ShrinkWidths to allow marking tabs as not shrinkable (unused yet) + don't unnecessarily move data within ShrinkWidthBuffer. (#3291)

This commit is contained in:
ocornut
2020-09-22 11:18:22 +02:00
parent 99f69eb185
commit 6b76781c66
2 changed files with 40 additions and 31 deletions

View File

@ -1729,11 +1729,10 @@ struct ImGuiTabBarSection
{
int TabStartIndex; // Index of first tab in this section.
int TabCount; // Number of tabs in this section.
float Width; // Width of this section (after shrinking down)
float Width; // Sum of width of tabs in this section (after shrinking down)
float Spacing; // Horizontal spacing at the end of the section.
ImGuiTabBarSection(){ memset(this, 0, sizeof(*this)); }
float WidthWithSpacing() const { return Width + Spacing; }
};
// Storage for a tab bar (sizeof() 92~96 bytes)