You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tables: decent support for auto-resize of stretch columns (trickier than it sounds)
Four cases:
1. visible columns are all stretch, resize all : "size all to default" reset to default weight
2. visible columns are all stretch, resize one: "size one to fit" set weight, reapply weight (todo: improve weight redistribution in case of >1 siblings)
3. visible columns are mixed, resize all: "size all to fit/default" reset stretchs to default weight, set fixed to auto width
4. visible columns are mixed, resize one: "size one to fit", redistribute weight the same way as a manual resize
+ TableSetupColumn() more consistently clear AutoFitQueue.
+ zero-clear RowCellData buffer.
//ImGui::CheckboxFlags("ImGuiTableFlags_ScrollX", &flags, ImGuiTableFlags_ScrollX); // FIXME-TABLE: Explain or fix the effect of enable Scroll on outer_size
int ColumnsCount; // Number of columns declared in BeginTable()
1972
-
int ColumnsVisibleCount; // Number of non-hidden columns (<= ColumnsCount)
1973
1972
int CurrentRow;
1974
1973
int CurrentColumn;
1975
1974
ImS16 InstanceCurrent; // Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple table with same ID look are multiple tables, they are just synched.
@@ -2018,9 +2017,12 @@ struct ImGuiTable
2018
2017
ImVector<ImGuiTableSortSpecsColumn> SortSpecsData; // FIXME-OPT: Fixed-size array / small-vector pattern, optimize for single sort spec
2019
2018
ImGuiTableSortSpecs SortSpecs; // Public facing sorts specs, this is what we return in TableGetSortSpecs()
2020
2019
ImS8 SortSpecsCount;
2020
+
ImS8 ColumnsVisibleCount; // Number of non-hidden columns (<= ColumnsCount)
2021
+
ImS8 ColumnsVisibleFixedCount; // Number of non-hidden columns (<= ColumnsCount)
2021
2022
ImS8 DeclColumnsCount; // Count calls to TableSetupColumn()
2022
2023
ImS8 HoveredColumnBody; // Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
2023
2024
ImS8 HoveredColumnBorder; // Index of column whose right-border is being hovered (for resizing).
2025
+
ImS8 AutoFitSingleStretchColumn; // Index of single stretch column requesting auto-fit.
2024
2026
ImS8 ResizedColumn; // Index of column being resized. Reset when InstanceCurrent==0.
2025
2027
ImS8 LastResizedColumn; // Index of column being resized from previous frame.
2026
2028
ImS8 HeldHeaderColumn; // Index of column header being held.
@@ -2287,7 +2289,8 @@ namespace ImGui
2287
2289
IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);
2288
2290
IMGUI_API constchar* TableGetColumnName(const ImGuiTable* table, int column_n);
2289
2291
IMGUI_API ImGuiID TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no = 0);
2290
-
IMGUI_API voidTableSetColumnAutofit(ImGuiTable* table, int column_n);
2292
+
IMGUI_API voidTableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);
0 commit comments