Tables: separate bg0 and bg1 draw channels, selectable above bg color + will facilitate drawing of borders in EndTable().

+ unused code to strip out dummy draw channel calls.
This commit is contained in:
ocornut
2020-11-12 15:55:26 +01:00
parent 52f24df668
commit 197e9c085b
2 changed files with 44 additions and 23 deletions

View File

@ -1890,7 +1890,7 @@ struct ImGuiTabBar
#define IM_COL32_DISABLE IM_COL32(0,0,0,1) // Special sentinel code which cannot be used as a regular color.
#define IMGUI_TABLE_MAX_COLUMNS 64 // sizeof(ImU64) * 8. This is solely because we frequently encode columns set in a ImU64.
#define IMGUI_TABLE_MAX_DRAW_CHANNELS (1 + 2 + 64 * 2) // See TableUpdateDrawChannels()
#define IMGUI_TABLE_MAX_DRAW_CHANNELS (4 + 64 * 2) // See TableUpdateDrawChannels()
// [Internal] sizeof() ~ 100
// We use the terminology "Visible" to refer to a column that is not Hidden by user or settings. However it may still be out of view and clipped (see IsClipped).
@ -2035,7 +2035,8 @@ struct ImGuiTable
ImS8 FreezeColumnsCount; // Actual frozen columns count (== FreezeColumnsRequest, or == 0 when no scrolling offset)
ImS8 RowCellDataCurrent; // Index of current RowCellData[] entry in current row
ImU8 DummyDrawChannel; // Redirect non-visible columns here.
ImU8 BgDrawChannelUnfrozen; // Index within DrawSplitter.Channels[]
ImU8 Bg1DrawChannelCurrent; // For Selectable() and other widgets drawing accross columns after the freezing line. Index within DrawSplitter.Channels[]
ImU8 Bg1DrawChannelUnfrozen;
bool IsLayoutLocked; // Set by TableUpdateLayout() which is called when beginning the first row.
bool IsInsideRow; // Set when inside TableBeginRow()/TableEndRow().
bool IsInitializing;