mirror of
https://github.com/xemu-project/imgui.git
synced 2024-11-27 04:00:22 +00:00
Columns: Refactor: Moved ColumnsSet[] to window out of DC as they are persistent data for most + fix for pre C++11 compilers. (#125, #1499)
This commit is contained in:
parent
b016215c80
commit
4ae5c7e227
10
imgui.cpp
10
imgui.cpp
@ -10935,12 +10935,12 @@ void ImGui::PushColumnClipRect(int column_index)
|
||||
|
||||
static ImGuiColumnsSet* FindOrAddColumnsSet(ImGuiWindow* window, ImGuiID id)
|
||||
{
|
||||
for (int n = 0; n < window->DC.ColumnsSets.Size; n++)
|
||||
if (window->DC.ColumnsSets[n].ID == id)
|
||||
return &window->DC.ColumnsSets[n];
|
||||
for (int n = 0; n < window->ColumnsStorage.Size; n++)
|
||||
if (window->ColumnsStorage[n].ID == id)
|
||||
return &window->ColumnsStorage[n];
|
||||
|
||||
window->DC.ColumnsSets.push_back(ImGuiColumnsSet());
|
||||
ImGuiColumnsSet* columns = &window->DC.ColumnsSets.back();
|
||||
window->ColumnsStorage.push_back(ImGuiColumnsSet());
|
||||
ImGuiColumnsSet* columns = &window->ColumnsStorage.back();
|
||||
columns->ID = id;
|
||||
return columns;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ enum ImGuiColumnsFlags_
|
||||
ImGuiColumnsFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers
|
||||
ImGuiColumnsFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns
|
||||
ImGuiColumnsFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window
|
||||
ImGuiColumnsFlags_GrowParentContentsSize= 1 << 4, // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
|
||||
ImGuiColumnsFlags_GrowParentContentsSize= 1 << 4 // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
|
||||
};
|
||||
|
||||
enum ImGuiSelectableFlagsPrivate_
|
||||
@ -701,8 +701,7 @@ struct IMGUI_API ImGuiDrawContext
|
||||
float IndentX; // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
|
||||
float GroupOffsetX;
|
||||
float ColumnsOffsetX; // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
|
||||
ImGuiColumnsSet* ColumnsSet;
|
||||
ImVector<ImGuiColumnsSet> ColumnsSets;
|
||||
ImGuiColumnsSet* ColumnsSet; // Current columns set
|
||||
|
||||
ImGuiDrawContext()
|
||||
{
|
||||
@ -784,6 +783,7 @@ struct IMGUI_API ImGuiWindow
|
||||
float ItemWidthDefault;
|
||||
ImGuiSimpleColumns MenuColumns; // Simplified columns storage for menu items
|
||||
ImGuiStorage StateStorage;
|
||||
ImVector<ImGuiColumnsSet> ColumnsStorage;
|
||||
float FontWindowScale; // Scale multiplier per-window
|
||||
ImDrawList* DrawList;
|
||||
ImGuiWindow* ParentWindow; // If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
|
||||
|
Loading…
Reference in New Issue
Block a user