mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Misc comments, internal renaming, added disable indentation option to Columns demo section.
This commit is contained in:
@ -2367,6 +2367,13 @@ static void ShowDemoWindowColumns()
|
||||
|
||||
ImGui::PushID("Columns");
|
||||
|
||||
static bool disable_indent = false;
|
||||
ImGui::Checkbox("Disable tree indentation", &disable_indent);
|
||||
ImGui::SameLine();
|
||||
HelpMarker("Disable the indenting of tree nodes so demo columns can use the full window width.");
|
||||
if (disable_indent)
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, 0.0f);
|
||||
|
||||
// Basic columns
|
||||
if (ImGui::TreeNode("Basic"))
|
||||
{
|
||||
@ -2472,7 +2479,10 @@ static void ShowDemoWindowColumns()
|
||||
if (h_borders && ImGui::GetColumnIndex() == 0)
|
||||
ImGui::Separator();
|
||||
ImGui::Text("%c%c%c", 'a'+i, 'a'+i, 'a'+i);
|
||||
ImGui::Text("Width %.2f\nOffset %.2f", ImGui::GetColumnWidth(), ImGui::GetColumnOffset());
|
||||
ImGui::Text("Width %.2f", ImGui::GetColumnWidth());
|
||||
ImGui::Text("Offset %.2f", ImGui::GetColumnOffset());
|
||||
ImGui::Text("Long text that is likely to clip");
|
||||
ImGui::Button("Button", ImVec2(-1.0f, 0.0f));
|
||||
ImGui::NextColumn();
|
||||
}
|
||||
ImGui::Columns(1);
|
||||
@ -2540,6 +2550,9 @@ static void ShowDemoWindowColumns()
|
||||
ImGui::Separator();
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (disable_indent)
|
||||
ImGui::PopStyleVar();
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user