mirror of
https://github.com/ocornut/imgui.git
synced 2026-06-02 03:00:39 +08:00
Tables: columns freeze doesn't enforce a particular order + rework changelog for clarity. (#9312)
This commit is contained in:
+6
-6
@@ -97,12 +97,12 @@ Other Changes:
|
|||||||
- Context menu now presents columns in display order. (#9312)
|
- Context menu now presents columns in display order. (#9312)
|
||||||
- Fixed and clarified the behavior of using TableSetupScrollFreeze() with columns>1,
|
- Fixed and clarified the behavior of using TableSetupScrollFreeze() with columns>1,
|
||||||
and where some of the columns within that range were Hidable.
|
and where some of the columns within that range were Hidable.
|
||||||
- Before: TableSetupScrollFreeze(N, 0) made the first N _visible_ columns
|
- Before: TableSetupScrollFreeze(N, 0): include the N left-most visible columns as
|
||||||
part of the scroll freeze. So if you intentionally hide columns <N
|
part of the scroll freeze. So if you intentionally hide columns <N, the scroll
|
||||||
the scroll freeze area would encompass the subsequent right columns.
|
freeze area would start covering the subsequent/following columns (N+1) etc.
|
||||||
- After: TableSetupScrollFreeze(N, 0) makes the first N _declared_ columns
|
- After: TableSetupScrollFreeze(N, 0): include the N left-most columns (regardless of visibility),
|
||||||
part of the scroll freeze. So if you intentionally hide columns <N
|
as part of the scroll freeze. So if you intentionally hide columns <N, the scroll
|
||||||
the scroll freeze area will cover less columns.
|
freeze area will cover less columns.
|
||||||
- This is generally more sane and logical.
|
- This is generally more sane and logical.
|
||||||
- Fixed dragging a header to reorder outside of visible bounds (due to horizontal scrolling)
|
- Fixed dragging a header to reorder outside of visible bounds (due to horizontal scrolling)
|
||||||
from losing active id.
|
from losing active id.
|
||||||
|
|||||||
@@ -1695,19 +1695,6 @@ void ImGui::TableSetupScrollFreeze(int columns, int rows)
|
|||||||
table->FreezeRowsRequest = (table->Flags & ImGuiTableFlags_ScrollY) ? (ImGuiTableColumnIdx)rows : 0;
|
table->FreezeRowsRequest = (table->Flags & ImGuiTableFlags_ScrollY) ? (ImGuiTableColumnIdx)rows : 0;
|
||||||
table->FreezeRowsCount = (table->InnerWindow->Scroll.y != 0.0f) ? table->FreezeRowsRequest : 0;
|
table->FreezeRowsCount = (table->InnerWindow->Scroll.y != 0.0f) ? table->FreezeRowsRequest : 0;
|
||||||
table->IsUnfrozenRows = (table->FreezeRowsCount == 0); // Make sure this is set before TableUpdateLayout() so ImGuiListClipper can benefit from it.b
|
table->IsUnfrozenRows = (table->FreezeRowsCount == 0); // Make sure this is set before TableUpdateLayout() so ImGuiListClipper can benefit from it.b
|
||||||
|
|
||||||
// Ensure frozen columns are ordered in their section. We still allow multiple frozen columns to be reordered.
|
|
||||||
// FIXME-TABLE: This work for preserving 2143 into 21|43. How about 4321 turning into 21|43? (preserve relative order in each section)
|
|
||||||
for (int column_n = 0; column_n < table->FreezeColumnsRequest; column_n++)
|
|
||||||
{
|
|
||||||
int order_n = table->DisplayOrderToIndex[column_n];
|
|
||||||
if (order_n != column_n && order_n >= table->FreezeColumnsRequest)
|
|
||||||
{
|
|
||||||
ImSwap(table->Columns[table->DisplayOrderToIndex[order_n]].DisplayOrder, table->Columns[table->DisplayOrderToIndex[column_n]].DisplayOrder);
|
|
||||||
ImSwap(table->DisplayOrderToIndex[order_n], table->DisplayOrderToIndex[column_n]);
|
|
||||||
table->IsSettingsDirty = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user