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
Copy file name to clipboardExpand all lines: imgui.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1896,8 +1896,8 @@ struct ImGuiPayload
1896
1896
structImGuiTableSortSpecsColumn
1897
1897
{
1898
1898
ImGuiID ColumnUserID; // User id of the column (if specified by a TableSetupColumn() call)
1899
-
ImU8 ColumnIndex; // Index of the column
1900
-
ImU8 SortOrder; // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
1899
+
ImS16 ColumnIndex; // Index of the column
1900
+
ImS16 SortOrder; // Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
1901
1901
ImGuiSortDirection SortDirection : 8; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function)
Copy file name to clipboardExpand all lines: imgui_internal.h
+48-44Lines changed: 48 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -1893,6 +1893,10 @@ struct ImGuiTabBar
1893
1893
#defineIMGUI_TABLE_MAX_COLUMNS64// sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64.
1894
1894
#defineIMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2) // See TableSetupDrawChannels()
1895
1895
1896
+
// Our current column maximum is 64 but we may raise that in the future.
1897
+
typedef ImS8 ImGuiTableColumnIdx;
1898
+
typedef ImU8 ImGuiTableDrawChannelIdx;
1899
+
1896
1900
// [Internal] sizeof() ~ 104
1897
1901
// We use the terminology "Visible" to refer to a columns that are not Hidden by user or settings. However it may still be out of view and clipped (and IsClipped would be set).
1898
1902
// This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use "Visible" to mean "not clipped".
@@ -1917,22 +1921,22 @@ struct ImGuiTableColumn
1917
1921
float ContentMaxXHeadersUsed; // Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls
1918
1922
float ContentMaxXHeadersIdeal;
1919
1923
ImS16 NameOffset; // Offset into parent ColumnsNames[]
1924
+
ImGuiTableColumnIdx DisplayOrder; // Index within Table's IndexToDisplayOrder[] (column may be reordered by users)
1925
+
ImGuiTableColumnIdx IndexWithinEnabledSet; // Index within enabled/visible set (<= IndexToDisplayOrder)
1926
+
ImGuiTableColumnIdx PrevEnabledColumn; // Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column
1927
+
ImGuiTableColumnIdx NextEnabledColumn; // Index of next enabled/visible column within Columns[], -1 if last enabled/visible column
1928
+
ImGuiTableColumnIdx SortOrder; // Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort
1929
+
ImGuiTableDrawChannelIdx DrawChannelCurrent; // Index within DrawSplitter.Channels[]
1930
+
ImGuiTableDrawChannelIdx DrawChannelFrozen;
1931
+
ImGuiTableDrawChannelIdx DrawChannelUnfrozen;
1920
1932
bool IsEnabled; // Is the column not marked Hidden by the user? (even if off view, e.g. clipped by scrolling).
1921
1933
bool IsEnabledNextFrame;
1922
1934
bool IsClipped; // Is not actually in view (e.g. not overlapping the host window clipping rectangle).
1923
1935
bool IsSkipItems; // Do we want item submissions to this column to be ignored early on.
1924
1936
ImS8 NavLayerCurrent; // ImGuiNavLayer in 1 byte
1925
-
ImS8 DisplayOrder; // Index within Table's IndexToDisplayOrder[] (column may be reordered by users)
1926
-
ImS8 IndexWithinEnabledSet; // Index within enabled/visible set (<= IndexToDisplayOrder)
1927
-
ImS8 PrevEnabledColumn; // Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column
1928
-
ImS8 NextEnabledColumn; // Index of next enabled/visible column within Columns[], -1 if last enabled/visible column
1929
-
ImS8 SortOrder; // Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort
1930
1937
ImS8 SortDirection; // ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending
1931
1938
ImU8 AutoFitQueue; // Queue of 8 values for the next 8 frames to request auto-fit
1932
1939
ImU8 CannotSkipItemsQueue; // Queue of 8 values for the next 8 frames to disable Clipped/SkipItem
1933
-
ImU8 DrawChannelCurrent; // Index within DrawSplitter.Channels[]
1934
-
ImU8 DrawChannelFrozen;
1935
-
ImU8 DrawChannelUnfrozen;
1936
1940
1937
1941
ImGuiTableColumn()
1938
1942
{
@@ -1952,8 +1956,8 @@ struct ImGuiTableColumn
1952
1956
// sizeof() ~ 6
1953
1957
structImGuiTableCellData
1954
1958
{
1955
-
ImU32 BgColor;// Actual color
1956
-
ImS8Column;// Column number
1959
+
ImU32 BgColor;// Actual color
1960
+
ImGuiTableColumnIdx Column;// Column number
1957
1961
};
1958
1962
1959
1963
structImGuiTable
@@ -1962,7 +1966,7 @@ struct ImGuiTable
1962
1966
ImGuiTableFlags Flags;
1963
1967
void* RawData; // Single allocation to hold Columns[], DisplayOrderToIndex[] and RowCellData[]
1964
1968
ImSpan<ImGuiTableColumn> Columns; // Point within RawData[]
1965
-
ImSpan<ImS8> DisplayOrderToIndex; // Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
1969
+
ImSpan<ImGuiTableColumnIdx> DisplayOrderToIndex; // Point within RawData[]. Store display order of columns (when not reordered, the values are 0...Count-1)
1966
1970
ImSpan<ImGuiTableCellData> RowCellData; // Point within RawData[]. Store cells background requests for current row.
1967
1971
ImU64 EnabledMaskByIndex; // Column Index -> IsEnabled map (== not hidden by user/api) in a format adequate for iterating column without touching cold data
ImDrawListSplitter DrawSplitter; // We carry our own ImDrawList splitter to allow recursion (FIXME: could be stored outside, worst case we need 1 splitter per recursing table)
2021
2025
ImVector<ImGuiTableSortSpecsColumn> SortSpecsData; // FIXME-OPT: Fixed-size array / small-vector pattern, optimize for single sort spec
2022
2026
ImGuiTableSortSpecs SortSpecs; // Public facing sorts specs, this is what we return in TableGetSortSpecs()
2023
-
ImS8 SortSpecsCount;
2024
-
ImS8 ColumnsEnabledCount; // Number of enabled columns (<= ColumnsCount)
2025
-
ImS8 ColumnsEnabledFixedCount; // Number of enabled columns (<= ColumnsCount)
2026
-
ImS8 DeclColumnsCount; // Count calls to TableSetupColumn()
2027
-
ImS8 HoveredColumnBody; // Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
2028
-
ImS8 HoveredColumnBorder; // Index of column whose right-border is being hovered (for resizing).
2029
-
ImS8 AutoFitSingleStretchColumn; // Index of single stretch column requesting auto-fit.
2030
-
ImS8 ResizedColumn; // Index of column being resized. Reset when InstanceCurrent==0.
2031
-
ImS8 LastResizedColumn; // Index of column being resized from previous frame.
2032
-
ImS8 HeldHeaderColumn; // Index of column header being held.
2033
-
ImS8 ReorderColumn; // Index of column being reordered. (not cleared)
2034
-
ImS8 ReorderColumnDir; // -1 or +1
2035
-
ImS8 RightMostEnabledColumn; // Index of right-most non-hidden column.
2036
-
ImS8 LeftMostStretchedColumnDisplayOrder; // Display order of left-most stretched column.
2037
-
ImS8 ContextPopupColumn; // Column right-clicked on, of -1 if opening context menu from a neutral/empty spot
ImU8 Bg1DrawChannelCurrent; // For Selectable() and other widgets drawing accross columns after the freezing line. Index within DrawSplitter.Channels[]
2045
-
ImU8 Bg1DrawChannelUnfrozen;
2027
+
ImGuiTableColumnIdx SortSpecsCount;
2028
+
ImGuiTableColumnIdx ColumnsEnabledCount; // Number of enabled columns (<= ColumnsCount)
2029
+
ImGuiTableColumnIdx ColumnsEnabledFixedCount; // Number of enabled columns (<= ColumnsCount)
2030
+
ImGuiTableColumnIdx DeclColumnsCount; // Count calls to TableSetupColumn()
2031
+
ImGuiTableColumnIdx HoveredColumnBody; // Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
2032
+
ImGuiTableColumnIdx HoveredColumnBorder; // Index of column whose right-border is being hovered (for resizing).
2033
+
ImGuiTableColumnIdx AutoFitSingleStretchColumn; // Index of single stretch column requesting auto-fit.
2034
+
ImGuiTableColumnIdx ResizedColumn; // Index of column being resized. Reset when InstanceCurrent==0.
2035
+
ImGuiTableColumnIdx LastResizedColumn; // Index of column being resized from previous frame.
2036
+
ImGuiTableColumnIdx HeldHeaderColumn; // Index of column header being held.
2037
+
ImGuiTableColumnIdx ReorderColumn; // Index of column being reordered. (not cleared)
2038
+
ImGuiTableColumnIdx ReorderColumnDir; // -1 or +1
2039
+
ImGuiTableColumnIdx RightMostEnabledColumn; // Index of right-most non-hidden column.
2040
+
ImGuiTableColumnIdx LeftMostStretchedColumnDisplayOrder; // Display order of left-most stretched column.
2041
+
ImGuiTableColumnIdx ContextPopupColumn; // Column right-clicked on, of -1 if opening context menu from a neutral/empty spot
ImGuiTableDrawChannelIdx Bg1DrawChannelCurrent; // For Selectable() and other widgets drawing accross columns after the freezing line. Index within DrawSplitter.Channels[]
2049
+
ImGuiTableDrawChannelIdx Bg1DrawChannelUnfrozen;
2046
2050
bool IsLayoutLocked; // Set by TableUpdateLayout() which is called when beginning the first row.
2047
2051
bool IsInsideRow; // Set when inside TableBeginRow()/TableEndRow().
2048
2052
bool IsInitializing;
@@ -2064,14 +2068,14 @@ struct ImGuiTable
2064
2068
// sizeof() ~ 12
2065
2069
structImGuiTableColumnSettings
2066
2070
{
2067
-
float WidthOrWeight;
2068
-
ImGuiID UserID;
2069
-
ImS8 Index;
2070
-
ImS8 DisplayOrder;
2071
-
ImS8 SortOrder;
2072
-
ImU8 SortDirection : 2;
2073
-
ImU8 IsEnabled : 1; // "Visible" in ini file
2074
-
ImU8 IsStretch : 1;
2071
+
floatWidthOrWeight;
2072
+
ImGuiID UserID;
2073
+
ImGuiTableColumnIdx Index;
2074
+
ImGuiTableColumnIdx DisplayOrder;
2075
+
ImGuiTableColumnIdx SortOrder;
2076
+
ImU8 SortDirection : 2;
2077
+
ImU8 IsEnabled : 1; // "Visible" in ini file
2078
+
ImU8 IsStretch : 1;
2075
2079
2076
2080
ImGuiTableColumnSettings()
2077
2081
{
@@ -2091,8 +2095,8 @@ struct ImGuiTableSettings
2091
2095
ImGuiID ID; // Set to 0 to invalidate/delete the setting
2092
2096
ImGuiTableFlags SaveFlags; // Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..)
2093
2097
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
2094
-
ImS8 ColumnsCount;
2095
-
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
2098
+
ImGuiTableColumnIdx ColumnsCount;
2099
+
ImGuiTableColumnIdx ColumnsCountMax; // Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher
2096
2100
bool WantApply; // Set when loaded from .ini data (to enable merging/loading .ini data into an already running context)
0 commit comments