|
@@ -410,6 +410,8 @@
|
|
|
- window: get size/pos helpers given names (see discussion in #249)
|
|
- window: get size/pos helpers given names (see discussion in #249)
|
|
|
- window: a collapsed window can be stuck behind the main menu bar?
|
|
- window: a collapsed window can be stuck behind the main menu bar?
|
|
|
- window: detect extra End() call that pop the "Debug" window out and assert at call site instead of later.
|
|
- window: detect extra End() call that pop the "Debug" window out and assert at call site instead of later.
|
|
|
|
|
+ - window/tooltip: allow to set the width of a tooltip to allow TextWrapped() etc. while keeping the height automatic.
|
|
|
|
|
+ - draw-list: maintaining bounding box per command would allow to merge draw command when clipping isn't relied on (typical non-scrolling window or non-overflowing column would merge with previous command).
|
|
|
!- scrolling: allow immediately effective change of scroll if we haven't appended items yet
|
|
!- scrolling: allow immediately effective change of scroll if we haven't appended items yet
|
|
|
- splitter: formalize the splitter idiom into an official api (we want to handle n-way split)
|
|
- splitter: formalize the splitter idiom into an official api (we want to handle n-way split)
|
|
|
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc.
|
|
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc.
|
|
@@ -1626,7 +1628,7 @@ void ImGui::ItemSize(const ImVec2& size, float text_offset_y)
|
|
|
const float line_height = ImMax(window->DC.CurrentLineHeight, size.y);
|
|
const float line_height = ImMax(window->DC.CurrentLineHeight, size.y);
|
|
|
const float text_base_offset = ImMax(window->DC.CurrentLineTextBaseOffset, text_offset_y);
|
|
const float text_base_offset = ImMax(window->DC.CurrentLineTextBaseOffset, text_offset_y);
|
|
|
window->DC.CursorPosPrevLine = ImVec2(window->DC.CursorPos.x + size.x, window->DC.CursorPos.y);
|
|
window->DC.CursorPosPrevLine = ImVec2(window->DC.CursorPos.x + size.x, window->DC.CursorPos.y);
|
|
|
- window->DC.CursorPos = ImVec2((float)(int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX), (float)(int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y));
|
|
|
|
|
|
|
+ window->DC.CursorPos = ImVec2((float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX), (float)(int)(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y));
|
|
|
window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
|
|
window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
|
|
|
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
|
|
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
|
|
|
|
|
|
|
@@ -3947,9 +3949,9 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Setup drawing context
|
|
// Setup drawing context
|
|
|
- window->DC.ColumnsStartX = 0.0f + window->WindowPadding.x - window->Scroll.x;
|
|
|
|
|
|
|
+ window->DC.IndentX = 0.0f + window->WindowPadding.x - window->Scroll.x;
|
|
|
window->DC.ColumnsOffsetX = 0.0f;
|
|
window->DC.ColumnsOffsetX = 0.0f;
|
|
|
- window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.ColumnsStartX + window->DC.ColumnsOffsetX, window->TitleBarHeight() + window->MenuBarHeight() + window->WindowPadding.y - window->Scroll.y);
|
|
|
|
|
|
|
+ window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.IndentX + window->DC.ColumnsOffsetX, window->TitleBarHeight() + window->MenuBarHeight() + window->WindowPadding.y - window->Scroll.y);
|
|
|
window->DC.CursorPos = window->DC.CursorStartPos;
|
|
window->DC.CursorPos = window->DC.CursorStartPos;
|
|
|
window->DC.CursorPosPrevLine = window->DC.CursorPos;
|
|
window->DC.CursorPosPrevLine = window->DC.CursorPos;
|
|
|
window->DC.CursorMaxPos = window->DC.CursorStartPos;
|
|
window->DC.CursorMaxPos = window->DC.CursorStartPos;
|
|
@@ -3971,8 +3973,8 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
|
|
window->DC.ColorEditMode = ImGuiColorEditMode_UserSelect;
|
|
window->DC.ColorEditMode = ImGuiColorEditMode_UserSelect;
|
|
|
window->DC.ColumnsCurrent = 0;
|
|
window->DC.ColumnsCurrent = 0;
|
|
|
window->DC.ColumnsCount = 1;
|
|
window->DC.ColumnsCount = 1;
|
|
|
- window->DC.ColumnsStartPos = window->DC.CursorPos;
|
|
|
|
|
- window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY = window->DC.ColumnsStartPos.y;
|
|
|
|
|
|
|
+ window->DC.ColumnsStartPosY = window->DC.CursorPos.y;
|
|
|
|
|
+ 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;
|
|
|
window->DC.GroupStack.resize(0);
|
|
window->DC.GroupStack.resize(0);
|
|
@@ -4697,6 +4699,7 @@ void ImGui::SetNextWindowFocus()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// In window space (not screen space!)
|
|
// In window space (not screen space!)
|
|
|
|
|
+// FIXME-OPT: Could cache and maintain it (pretty much only change on columns change)
|
|
|
ImVec2 ImGui::GetContentRegionMax()
|
|
ImVec2 ImGui::GetContentRegionMax()
|
|
|
{
|
|
{
|
|
|
ImGuiWindow* window = GetCurrentWindowRead();
|
|
ImGuiWindow* window = GetCurrentWindowRead();
|
|
@@ -8573,7 +8576,7 @@ void ImGui::Separator()
|
|
|
float x1 = window->Pos.x;
|
|
float x1 = window->Pos.x;
|
|
|
float x2 = window->Pos.x + window->Size.x;
|
|
float x2 = window->Pos.x + window->Size.x;
|
|
|
if (!window->DC.GroupStack.empty())
|
|
if (!window->DC.GroupStack.empty())
|
|
|
- x1 += window->DC.ColumnsStartX;
|
|
|
|
|
|
|
+ x1 += window->DC.IndentX;
|
|
|
|
|
|
|
|
const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y));
|
|
const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y));
|
|
|
ItemSize(ImVec2(0.0f, 0.0f)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit // FIXME: Height should be 1.0f not 0.0f ?
|
|
ItemSize(ImVec2(0.0f, 0.0f)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit // FIXME: Height should be 1.0f not 0.0f ?
|
|
@@ -8630,13 +8633,13 @@ void ImGui::BeginGroup()
|
|
|
ImGuiGroupData& group_data = window->DC.GroupStack.back();
|
|
ImGuiGroupData& group_data = window->DC.GroupStack.back();
|
|
|
group_data.BackupCursorPos = window->DC.CursorPos;
|
|
group_data.BackupCursorPos = window->DC.CursorPos;
|
|
|
group_data.BackupCursorMaxPos = window->DC.CursorMaxPos;
|
|
group_data.BackupCursorMaxPos = window->DC.CursorMaxPos;
|
|
|
- group_data.BackupColumnsStartX = window->DC.ColumnsStartX;
|
|
|
|
|
|
|
+ group_data.BackupIndentX = window->DC.IndentX;
|
|
|
group_data.BackupCurrentLineHeight = window->DC.CurrentLineHeight;
|
|
group_data.BackupCurrentLineHeight = window->DC.CurrentLineHeight;
|
|
|
group_data.BackupCurrentLineTextBaseOffset = window->DC.CurrentLineTextBaseOffset;
|
|
group_data.BackupCurrentLineTextBaseOffset = window->DC.CurrentLineTextBaseOffset;
|
|
|
group_data.BackupLogLinePosY = window->DC.LogLinePosY;
|
|
group_data.BackupLogLinePosY = window->DC.LogLinePosY;
|
|
|
group_data.AdvanceCursor = true;
|
|
group_data.AdvanceCursor = true;
|
|
|
|
|
|
|
|
- window->DC.ColumnsStartX = window->DC.CursorPos.x - window->Pos.x;
|
|
|
|
|
|
|
+ window->DC.IndentX = window->DC.CursorPos.x - window->Pos.x;
|
|
|
window->DC.CursorMaxPos = window->DC.CursorPos;
|
|
window->DC.CursorMaxPos = window->DC.CursorPos;
|
|
|
window->DC.CurrentLineHeight = 0.0f;
|
|
window->DC.CurrentLineHeight = 0.0f;
|
|
|
window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;
|
|
window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;
|
|
@@ -8659,7 +8662,7 @@ void ImGui::EndGroup()
|
|
|
window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos);
|
|
window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos);
|
|
|
window->DC.CurrentLineHeight = group_data.BackupCurrentLineHeight;
|
|
window->DC.CurrentLineHeight = group_data.BackupCurrentLineHeight;
|
|
|
window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset;
|
|
window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset;
|
|
|
- window->DC.ColumnsStartX = group_data.BackupColumnsStartX;
|
|
|
|
|
|
|
+ window->DC.IndentX = group_data.BackupIndentX;
|
|
|
window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;
|
|
window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;
|
|
|
|
|
|
|
|
if (group_data.AdvanceCursor)
|
|
if (group_data.AdvanceCursor)
|
|
@@ -8719,7 +8722,8 @@ void ImGui::NextColumn()
|
|
|
window->DC.ColumnsCellMaxY = ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
|
|
window->DC.ColumnsCellMaxY = ImMax(window->DC.ColumnsCellMaxY, window->DC.CursorPos.y);
|
|
|
if (++window->DC.ColumnsCurrent < window->DC.ColumnsCount)
|
|
if (++window->DC.ColumnsCurrent < window->DC.ColumnsCount)
|
|
|
{
|
|
{
|
|
|
- window->DC.ColumnsOffsetX = ImGui::GetColumnOffset(window->DC.ColumnsCurrent) - window->DC.ColumnsStartX + g.Style.ItemSpacing.x;
|
|
|
|
|
|
|
+ // Columns 1+ cancel out IndentX
|
|
|
|
|
+ window->DC.ColumnsOffsetX = ImGui::GetColumnOffset(window->DC.ColumnsCurrent) - window->DC.IndentX + g.Style.ItemSpacing.x;
|
|
|
window->DrawList->ChannelsSetCurrent(window->DC.ColumnsCurrent);
|
|
window->DrawList->ChannelsSetCurrent(window->DC.ColumnsCurrent);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -8729,13 +8733,13 @@ void ImGui::NextColumn()
|
|
|
window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY;
|
|
window->DC.ColumnsCellMinY = window->DC.ColumnsCellMaxY;
|
|
|
window->DrawList->ChannelsSetCurrent(0);
|
|
window->DrawList->ChannelsSetCurrent(0);
|
|
|
}
|
|
}
|
|
|
- window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX);
|
|
|
|
|
|
|
+ window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX);
|
|
|
window->DC.CursorPos.y = window->DC.ColumnsCellMinY;
|
|
window->DC.CursorPos.y = window->DC.ColumnsCellMinY;
|
|
|
window->DC.CurrentLineHeight = 0.0f;
|
|
window->DC.CurrentLineHeight = 0.0f;
|
|
|
window->DC.CurrentLineTextBaseOffset = 0.0f;
|
|
window->DC.CurrentLineTextBaseOffset = 0.0f;
|
|
|
|
|
|
|
|
PushColumnClipRect();
|
|
PushColumnClipRect();
|
|
|
- ImGui::PushItemWidth(ImGui::GetColumnWidth() * 0.65f); // FIXME
|
|
|
|
|
|
|
+ ImGui::PushItemWidth(ImGui::GetColumnWidth() * 0.65f); // FIXME: Move on columns setup
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -8754,7 +8758,7 @@ int ImGui::GetColumnsCount()
|
|
|
static float GetDraggedColumnOffset(int column_index)
|
|
static float GetDraggedColumnOffset(int column_index)
|
|
|
{
|
|
{
|
|
|
// Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing
|
|
// Active (dragged) column always follow mouse. The reason we need this is that dragging a column to the right edge of an auto-resizing
|
|
|
- // window creates a feedback loop because we store normalized positions/ So while dragging we enforce absolute positioning
|
|
|
|
|
|
|
+ // window creates a feedback loop because we store normalized positions. So while dragging we enforce absolute positioning.
|
|
|
ImGuiState& g = *GImGui;
|
|
ImGuiState& g = *GImGui;
|
|
|
ImGuiWindow* window = ImGui::GetCurrentWindowRead();
|
|
ImGuiWindow* window = ImGui::GetCurrentWindowRead();
|
|
|
IM_ASSERT(column_index > 0); // We cannot drag column 0. If you get this assert you may have a conflict between the ID of your columns and another widgets.
|
|
IM_ASSERT(column_index > 0); // We cannot drag column 0. If you get this assert you may have a conflict between the ID of your columns and another widgets.
|
|
@@ -8780,33 +8784,24 @@ float ImGui::GetColumnOffset(int column_index)
|
|
|
return GetDraggedColumnOffset(column_index);
|
|
return GetDraggedColumnOffset(column_index);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Read from cache
|
|
|
|
|
- IM_ASSERT(column_index < window->DC.ColumnsOffsetsT.Size);
|
|
|
|
|
- const float t = window->DC.ColumnsOffsetsT[column_index];
|
|
|
|
|
-
|
|
|
|
|
- const float content_region_width = window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x;
|
|
|
|
|
- const float min_x = window->DC.ColumnsStartX;
|
|
|
|
|
- const float max_x = content_region_width - window->Scroll.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarSize);// - window->WindowPadding().x;
|
|
|
|
|
- const float x = min_x + t * (max_x - min_x);
|
|
|
|
|
- return (float)(int)x;
|
|
|
|
|
|
|
+ IM_ASSERT(column_index < window->DC.ColumnsData.Size);
|
|
|
|
|
+ const float t = window->DC.ColumnsData[column_index].OffsetNorm;
|
|
|
|
|
+ const float x_offset = window->DC.ColumnsMinX + t * (window->DC.ColumnsMaxX - window->DC.ColumnsMinX);
|
|
|
|
|
+ return (float)(int)x_offset;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ImGui::SetColumnOffset(int column_index, float offset)
|
|
void ImGui::SetColumnOffset(int column_index, float offset)
|
|
|
{
|
|
{
|
|
|
- ImGuiState& g = *GImGui;
|
|
|
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
if (column_index < 0)
|
|
if (column_index < 0)
|
|
|
column_index = window->DC.ColumnsCurrent;
|
|
column_index = window->DC.ColumnsCurrent;
|
|
|
|
|
|
|
|
- IM_ASSERT(column_index < window->DC.ColumnsOffsetsT.Size);
|
|
|
|
|
- const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index);
|
|
|
|
|
|
|
+ IM_ASSERT(column_index < window->DC.ColumnsData.Size);
|
|
|
|
|
+ const float t = (offset - window->DC.ColumnsMinX) / (window->DC.ColumnsMaxX - window->DC.ColumnsMinX);
|
|
|
|
|
+ window->DC.ColumnsData[column_index].OffsetNorm = t;
|
|
|
|
|
|
|
|
- const float content_region_width = window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x;
|
|
|
|
|
- const float min_x = window->DC.ColumnsStartX;
|
|
|
|
|
- const float max_x = content_region_width - window->Scroll.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarSize);// - window->WindowPadding().x;
|
|
|
|
|
- const float t = (offset - min_x) / (max_x - min_x);
|
|
|
|
|
|
|
+ const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index);
|
|
|
window->DC.StateStorage->SetFloat(column_id, t);
|
|
window->DC.StateStorage->SetFloat(column_id, t);
|
|
|
- window->DC.ColumnsOffsetsT[column_index] = t;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
float ImGui::GetColumnWidth(int column_index)
|
|
float ImGui::GetColumnWidth(int column_index)
|
|
@@ -8834,6 +8829,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
|
|
{
|
|
{
|
|
|
ImGuiState& g = *GImGui;
|
|
ImGuiState& g = *GImGui;
|
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
|
|
+ IM_ASSERT(columns_count >= 1);
|
|
|
|
|
|
|
|
if (window->DC.ColumnsCount != 1)
|
|
if (window->DC.ColumnsCount != 1)
|
|
|
{
|
|
{
|
|
@@ -8850,7 +8846,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
|
|
// Draw columns borders and handle resize at the time of "closing" a columns set
|
|
// Draw columns borders and handle resize at the time of "closing" a columns set
|
|
|
if (window->DC.ColumnsCount != columns_count && window->DC.ColumnsCount != 1 && window->DC.ColumnsShowBorders && !window->SkipItems)
|
|
if (window->DC.ColumnsCount != columns_count && window->DC.ColumnsCount != 1 && window->DC.ColumnsShowBorders && !window->SkipItems)
|
|
|
{
|
|
{
|
|
|
- const float y1 = window->DC.ColumnsStartPos.y;
|
|
|
|
|
|
|
+ const float y1 = window->DC.ColumnsStartPosY;
|
|
|
const float y2 = window->DC.CursorPos.y;
|
|
const float y2 = window->DC.CursorPos.y;
|
|
|
for (int i = 1; i < window->DC.ColumnsCount; i++)
|
|
for (int i = 1; i < window->DC.ColumnsCount; i++)
|
|
|
{
|
|
{
|
|
@@ -8881,29 +8877,36 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Set state for first column
|
|
|
|
|
- ImGui::PushID(0x11223344); // Differentiate column ID with an arbitrary/random prefix for cases where users name their columns set the same as another non-scope widget
|
|
|
|
|
- window->DC.ColumnsSetID = window->GetID(id ? id : "");
|
|
|
|
|
|
|
+ // Differentiate column ID with an arbitrary prefix for cases where users name their columns set the same as another widget.
|
|
|
|
|
+ // In addition, when an identifier isn't explicitly provided we include the number of columns in the hash to make it uniquer.
|
|
|
|
|
+ ImGui::PushID(0x11223347 + (id ? 0 : columns_count));
|
|
|
|
|
+ window->DC.ColumnsSetID = window->GetID(id ? id : "columns");
|
|
|
ImGui::PopID();
|
|
ImGui::PopID();
|
|
|
|
|
+
|
|
|
|
|
+ // Set state for first column
|
|
|
window->DC.ColumnsCurrent = 0;
|
|
window->DC.ColumnsCurrent = 0;
|
|
|
window->DC.ColumnsCount = columns_count;
|
|
window->DC.ColumnsCount = columns_count;
|
|
|
window->DC.ColumnsShowBorders = border;
|
|
window->DC.ColumnsShowBorders = border;
|
|
|
- window->DC.ColumnsStartPos = window->DC.CursorPos;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const float content_region_width = window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x;
|
|
|
|
|
+ window->DC.ColumnsMinX = window->DC.IndentX; // 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.ColumnsStartPosY = window->DC.CursorPos.y;
|
|
|
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.ColumnsStartX + window->DC.ColumnsOffsetX);
|
|
|
|
|
|
|
+ window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX);
|
|
|
|
|
|
|
|
if (window->DC.ColumnsCount != 1)
|
|
if (window->DC.ColumnsCount != 1)
|
|
|
{
|
|
{
|
|
|
// Cache column offsets
|
|
// Cache column offsets
|
|
|
- window->DC.ColumnsOffsetsT.resize(columns_count + 1);
|
|
|
|
|
|
|
+ window->DC.ColumnsData.resize(columns_count + 1);
|
|
|
for (int column_index = 0; column_index < columns_count + 1; column_index++)
|
|
for (int column_index = 0; column_index < columns_count + 1; column_index++)
|
|
|
{
|
|
{
|
|
|
const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index);
|
|
const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index);
|
|
|
KeepAliveID(column_id);
|
|
KeepAliveID(column_id);
|
|
|
const float default_t = column_index / (float)window->DC.ColumnsCount;
|
|
const float default_t = column_index / (float)window->DC.ColumnsCount;
|
|
|
const float t = window->DC.StateStorage->GetFloat(column_id, default_t); // Cheaply store our floating point value inside the integer (could store an union into the map?)
|
|
const float t = window->DC.StateStorage->GetFloat(column_id, default_t); // Cheaply store our floating point value inside the integer (could store an union into the map?)
|
|
|
- window->DC.ColumnsOffsetsT[column_index] = t;
|
|
|
|
|
|
|
+ window->DC.ColumnsData[column_index].OffsetNorm = t;
|
|
|
}
|
|
}
|
|
|
window->DrawList->ChannelsSplit(window->DC.ColumnsCount);
|
|
window->DrawList->ChannelsSplit(window->DC.ColumnsCount);
|
|
|
PushColumnClipRect();
|
|
PushColumnClipRect();
|
|
@@ -8911,9 +8914,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- window->DC.ColumnsOffsetsT.resize(2);
|
|
|
|
|
- window->DC.ColumnsOffsetsT[0] = 0.0f;
|
|
|
|
|
- window->DC.ColumnsOffsetsT[1] = 1.0f;
|
|
|
|
|
|
|
+ window->DC.ColumnsData.resize(0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -8921,16 +8922,16 @@ void ImGui::Indent()
|
|
|
{
|
|
{
|
|
|
ImGuiState& g = *GImGui;
|
|
ImGuiState& g = *GImGui;
|
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
- window->DC.ColumnsStartX += g.Style.IndentSpacing;
|
|
|
|
|
- window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
|
|
|
|
|
|
|
+ window->DC.IndentX += g.Style.IndentSpacing;
|
|
|
|
|
+ window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ImGui::Unindent()
|
|
void ImGui::Unindent()
|
|
|
{
|
|
{
|
|
|
ImGuiState& g = *GImGui;
|
|
ImGuiState& g = *GImGui;
|
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
ImGuiWindow* window = GetCurrentWindow();
|
|
|
- window->DC.ColumnsStartX -= g.Style.IndentSpacing;
|
|
|
|
|
- window->DC.CursorPos.x = window->Pos.x + window->DC.ColumnsStartX + window->DC.ColumnsOffsetX;
|
|
|
|
|
|
|
+ window->DC.IndentX -= g.Style.IndentSpacing;
|
|
|
|
|
+ window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ImGui::TreePush(const char* str_id)
|
|
void ImGui::TreePush(const char* str_id)
|