mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-12 15:59:54 +02:00
Tables: Honor width/weight passed to TableSetupColumn() after .ini load since we don't actually restore that data currently.
Demo: Remove filter from Advanced Table demo since it's breaking with clipping.
This commit is contained in:
@ -585,7 +585,9 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
else
|
||||
{
|
||||
IM_ASSERT(column->Flags & ImGuiTableColumnFlags_WidthStretch);
|
||||
IM_ASSERT(column->ResizeWeight > 0.0f);
|
||||
const int init_size = (column->ResizeWeight < 0.0f);
|
||||
if (init_size)
|
||||
column->ResizeWeight = 1.0f;
|
||||
total_weights += column->ResizeWeight;
|
||||
if (table->LeftMostStretchedColumnDisplayOrder == -1)
|
||||
table->LeftMostStretchedColumnDisplayOrder = (ImS8)column->IndexDisplayOrder;
|
||||
@ -1378,7 +1380,8 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags,
|
||||
flags = column->Flags;
|
||||
|
||||
// Initialize defaults
|
||||
if (table->IsInitializing && !table->IsSettingsLoaded)
|
||||
// FIXME-TABLE: We don't restore widths/weight so let's avoid using IsSettingsLoaded for now
|
||||
if (table->IsInitializing && column->WidthRequested < 0.0f && column->ResizeWeight < 0.0f)// && !table->IsSettingsLoaded)
|
||||
{
|
||||
// Init width or weight
|
||||
// Disable auto-fit if a default fixed width has been specified
|
||||
@ -1396,7 +1399,9 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags,
|
||||
{
|
||||
column->ResizeWeight = 1.0f;
|
||||
}
|
||||
|
||||
}
|
||||
if (table->IsInitializing && !table->IsSettingsLoaded)
|
||||
{
|
||||
// Init default visibility/sort state
|
||||
if (flags & ImGuiTableColumnFlags_DefaultHide)
|
||||
column->IsActive = column->NextIsActive = false;
|
||||
|
Reference in New Issue
Block a user