Internals: Menus: Naming offset field + fix spacing/offset computation to handle more offsets.

This commit is contained in:
ocornut
2021-07-07 20:45:15 +02:00
parent 3512f2c2c2
commit 696d3e056e
3 changed files with 38 additions and 21 deletions

View File

@ -1038,12 +1038,14 @@ struct IMGUI_API ImGuiMenuColumns
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)
ImU16 OffsetShortcut; // Offsets are locked in Update()
ImU16 OffsetMark;
ImU16 Widths[3]; // Width of: Label, Shortcut, Mark (accumulators for current frame)
ImGuiMenuColumns() { memset(this, 0, sizeof(*this)); }
void Update(float spacing, bool window_reappearing);
float DeclColumns(float w_label, float w_shortcut, float w_checkmark);
float DeclColumns(float w_label, float w_shortcut, float w_mark);
void CalcNextTotalWidth(bool update_offsets);
};
// Internal state of the currently focused/edited text input box