MultiSelect: added support for nested/stacked BeginMultiSelect().

Mimicking table logic, reusing amortized buffers.
This commit is contained in:
ocornut
2024-07-18 18:19:17 +02:00
parent b747d6fe59
commit 0af6fbb51d
4 changed files with 19 additions and 7 deletions
+4 -2
View File
@@ -2200,8 +2200,9 @@ struct ImGuiContext
ImVector<ImGuiShrinkWidthItem> ShrinkWidthBuffer;
// Multi-Select state
ImGuiMultiSelectTempData* CurrentMultiSelect; // FIXME-MULTISELECT: We currently don't support recursing/stacking multi-select
ImGuiMultiSelectTempData MultiSelectTempData[1];
ImGuiMultiSelectTempData* CurrentMultiSelect;
int MultiSelectTempDataStacked; // Temporary multi-select data size (because we leave previous instances undestructed, we generally don't use MultiSelectTempData.Size)
ImVector<ImGuiMultiSelectTempData> MultiSelectTempData;
ImPool<ImGuiMultiSelectState> MultiSelectStorage;
// Hover Delay system
@@ -2445,6 +2446,7 @@ struct ImGuiContext
TablesTempDataStacked = 0;
CurrentTabBar = NULL;
CurrentMultiSelect = NULL;
MultiSelectTempDataStacked = 0;
HoverItemDelayId = HoverItemDelayIdPreviousFrame = HoverItemUnlockedStationaryId = HoverWindowUnlockedStationaryId = 0;
HoverItemDelayTimer = HoverItemDelayClearTimer = 0.0f;