mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Merge branch 'master' into docking
# Conflicts: # imgui.cpp
This commit is contained in:
@ -18,6 +18,7 @@ Index of this file:
|
||||
// [SECTION] Generic helpers
|
||||
// [SECTION] ImDrawList support
|
||||
// [SECTION] Widgets support: flags, enums, data structures
|
||||
// [SECTION] Clipper support
|
||||
// [SECTION] Navigation support
|
||||
// [SECTION] Columns support
|
||||
// [SECTION] Multi-select support
|
||||
@ -1182,6 +1183,34 @@ struct ImGuiPtrOrIndex
|
||||
ImGuiPtrOrIndex(int index) { Ptr = NULL; Index = index; }
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] Clipper support
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
struct ImGuiListClipperRange
|
||||
{
|
||||
int Min;
|
||||
int Max;
|
||||
bool PosToIndexConvert; // Begin/End are absolute position (will be converted to indices later)
|
||||
ImS8 PosToIndexOffsetMin; // Add to Min after converting to indices
|
||||
ImS8 PosToIndexOffsetMax; // Add to Min after converting to indices
|
||||
|
||||
static ImGuiListClipperRange FromIndices(int min, int max) { ImGuiListClipperRange r = { min, max, false, 0, 0 }; return r; }
|
||||
static ImGuiListClipperRange FromPositions(float y1, float y2, int off_min, int off_max) { ImGuiListClipperRange r = { (int)y1, (int)y2, true, (ImS8)off_min, (ImS8)off_max }; return r; }
|
||||
};
|
||||
|
||||
// Temporary clipper data, buffers shared/reused between instances
|
||||
struct ImGuiListClipperData
|
||||
{
|
||||
ImGuiListClipper* ListClipper;
|
||||
int StepNo;
|
||||
int ItemsFrozen;
|
||||
ImVector<ImGuiListClipperRange> Ranges;
|
||||
|
||||
ImGuiListClipperData() { memset(this, 0, sizeof(*this)); }
|
||||
void Reset(ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] Navigation support
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -1767,6 +1796,7 @@ struct ImGuiContext
|
||||
ImGuiDir NavMoveDirForDebug;
|
||||
ImGuiDir NavMoveClipDir; // FIXME-NAV: Describe the purpose of this better. Might want to rename?
|
||||
ImRect NavScoringRect; // Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
|
||||
ImRect NavScoringNoClipRect; // Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted
|
||||
int NavScoringDebugCount; // Metrics for debugging
|
||||
int NavTabbingInputableRemaining; // >0 when counting items for tabbing
|
||||
ImGuiNavItemData NavMoveResultLocal; // Best move request candidate within NavWindow
|
||||
@ -1811,6 +1841,10 @@ struct ImGuiContext
|
||||
ImVector<unsigned char> DragDropPayloadBufHeap; // We don't expose the ImVector<> directly, ImGuiPayload only holds pointer+size
|
||||
unsigned char DragDropPayloadBufLocal[16]; // Local buffer for small payloads
|
||||
|
||||
// Clipper
|
||||
int ClipperTempDataStacked;
|
||||
ImVector<ImGuiListClipperData> ClipperTempData;
|
||||
|
||||
// Table
|
||||
ImGuiTable* CurrentTable;
|
||||
int TablesTempDataStacked; // Temporary table data size (because we leave previous instances undestructed, we generally don't use TablesTempData.Size)
|
||||
@ -2011,6 +2045,8 @@ struct ImGuiContext
|
||||
DragDropHoldJustPressedId = 0;
|
||||
memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
|
||||
|
||||
ClipperTempDataStacked = 0;
|
||||
|
||||
CurrentTable = NULL;
|
||||
TablesTempDataStacked = 0;
|
||||
CurrentTabBar = NULL;
|
||||
|
Reference in New Issue
Block a user