Tables: Rescale fixed widths when font size change to support varying dpi scale at runtime and on .ini reload.

This commit is contained in:
omar
2020-05-24 20:07:21 +02:00
committed by ocornut
parent 6bc0bbccf3
commit fec9d7d226
2 changed files with 28 additions and 1 deletions

View File

@ -1985,6 +1985,7 @@ struct ImGuiTable
float ColumnsTotalWidth; // Sum of current column width
float ColumnsAutoFitWidth; // Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window
float ResizedColumnNextWidth;
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
ImRect OuterRect; // Note: OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable().
ImRect WorkRect;
ImRect InnerClipRect;
@ -2070,6 +2071,7 @@ struct ImGuiTableSettings
{
ImGuiID ID; // Set to 0 to invalidate/delete the setting
ImGuiTableFlags SaveFlags; // Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..)
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
ImS8 ColumnsCount;
ImS8 ColumnsCountMax; // Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher
bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)