mirror of
https://github.com/ocornut/imgui.git
synced 2025-01-29 19:17:24 +01:00
Columns: A set of column (and most importantly the right-most column) do not register its content to the parent, not affecting the window contents size. (#519, #125, #913)
This commit is contained in:
parent
7f0063f858
commit
1c83b073c6
@ -4345,6 +4345,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
|
|||||||
window->DC.ColumnsCurrent = 0;
|
window->DC.ColumnsCurrent = 0;
|
||||||
window->DC.ColumnsCount = 1;
|
window->DC.ColumnsCount = 1;
|
||||||
window->DC.ColumnsStartPosY = window->DC.CursorPos.y;
|
window->DC.ColumnsStartPosY = window->DC.CursorPos.y;
|
||||||
|
window->DC.ColumnsStartMaxPosX = window->DC.CursorMaxPos.x;
|
||||||
window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.ColumnsStartPosY;
|
window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.ColumnsStartPosY;
|
||||||
window->DC.TreeDepth = 0;
|
window->DC.TreeDepth = 0;
|
||||||
window->DC.StateStorage = &window->StateStorage;
|
window->DC.StateStorage = &window->StateStorage;
|
||||||
@ -10051,6 +10052,7 @@ void ImGui::BeginColumns(const char* id, int columns_count, ImGuiColumnsFlags fl
|
|||||||
window->DC.ColumnsMinX = window->DC.IndentX - g.Style.ItemSpacing.x; // Lock our horizontal range
|
window->DC.ColumnsMinX = window->DC.IndentX - g.Style.ItemSpacing.x; // Lock our horizontal range
|
||||||
window->DC.ColumnsMaxX = content_region_width - window->Scroll.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarSize);// - window->WindowPadding().x;
|
window->DC.ColumnsMaxX = content_region_width - window->Scroll.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarSize);// - window->WindowPadding().x;
|
||||||
window->DC.ColumnsStartPosY = window->DC.CursorPos.y;
|
window->DC.ColumnsStartPosY = window->DC.CursorPos.y;
|
||||||
|
window->DC.ColumnsStartMaxPosX = window->DC.CursorMaxPos.x;
|
||||||
window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.CursorPos.y;
|
window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.CursorPos.y;
|
||||||
window->DC.ColumnsOffsetX = 0.0f;
|
window->DC.ColumnsOffsetX = 0.0f;
|
||||||
window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX);
|
window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX);
|
||||||
@ -10084,6 +10086,7 @@ void ImGui::EndColumns()
|
|||||||
|
|
||||||
window->DC.ColumnsCellMaxY = ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
|
window->DC.ColumnsCellMaxY = ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
|
||||||
window->DC.CursorPos.y = window->DC.ColumnsCellMaxY;
|
window->DC.CursorPos.y = window->DC.ColumnsCellMaxY;
|
||||||
|
window->DC.CursorMaxPos.x = ImMax(window->DC.ColumnsStartMaxPosX, window->DC.ColumnsMaxX); // Columns don't grow parent
|
||||||
|
|
||||||
// Draw columns borders and handle resize
|
// Draw columns borders and handle resize
|
||||||
if (!(window->DC.ColumnsFlags & ImGuiColumnsFlags_NoBorder) && !window->SkipItems)
|
if (!(window->DC.ColumnsFlags & ImGuiColumnsFlags_NoBorder) && !window->SkipItems)
|
||||||
|
@ -605,6 +605,7 @@ struct IMGUI_API ImGuiDrawContext
|
|||||||
float ColumnsMinX;
|
float ColumnsMinX;
|
||||||
float ColumnsMaxX;
|
float ColumnsMaxX;
|
||||||
float ColumnsStartPosY;
|
float ColumnsStartPosY;
|
||||||
|
float ColumnsStartMaxPosX; // Backup of CursorMaxPos
|
||||||
float ColumnsCellMinY;
|
float ColumnsCellMinY;
|
||||||
float ColumnsCellMaxY;
|
float ColumnsCellMaxY;
|
||||||
ImGuiColumnsFlags ColumnsFlags;
|
ImGuiColumnsFlags ColumnsFlags;
|
||||||
@ -638,6 +639,7 @@ struct IMGUI_API ImGuiDrawContext
|
|||||||
ColumnsCount = 1;
|
ColumnsCount = 1;
|
||||||
ColumnsMinX = ColumnsMaxX = 0.0f;
|
ColumnsMinX = ColumnsMaxX = 0.0f;
|
||||||
ColumnsStartPosY = 0.0f;
|
ColumnsStartPosY = 0.0f;
|
||||||
|
ColumnsStartMaxPosX = 0.0f;
|
||||||
ColumnsCellMinY = ColumnsCellMaxY = 0.0f;
|
ColumnsCellMinY = ColumnsCellMaxY = 0.0f;
|
||||||
ColumnsFlags = 0;
|
ColumnsFlags = 0;
|
||||||
ColumnsSetId = 0;
|
ColumnsSetId = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user