Internals: Menus: minor tidying up + renaming in ImGuiMenuColumns + removing extraneous offset field which is always zero + using smaller types.

sizeof() 36 -> 20
This commit is contained in:
ocornut
2021-07-07 19:03:10 +02:00
parent baa4caf9e3
commit 3512f2c2c2
4 changed files with 34 additions and 39 deletions

View File

@ -1035,14 +1035,15 @@ struct IMGUI_API ImGuiGroupData
// Simple column measurement, currently used for MenuItem() only.. This is very short-sighted/throw-away code and NOT a generic helper.
struct IMGUI_API ImGuiMenuColumns
{
float Spacing;
float Width, NextWidth;
float Pos[3], NextWidths[3];
ImU32 TotalWidth;
ImU32 NextTotalWidth;
ImU16 Spacing;
ImU16 Offsets[2]; // Offset of: Shortcut, Check mark (locked in Update)
ImU16 Widths[3]; // Width of: Label, Shortcut, Check mark (accumulator for current frame)
ImGuiMenuColumns() { memset(this, 0, sizeof(*this)); }
void Update(int count, float spacing, bool clear);
float DeclColumns(float w0, float w1, float w2);
float CalcExtraSpace(float avail_w) const;
void Update(float spacing, bool window_reappearing);
float DeclColumns(float w_label, float w_shortcut, float w_checkmark);
};
// Internal state of the currently focused/edited text input box