Misc comments, internal renaming, added disable indentation option to Columns demo section.

This commit is contained in:
omar
2019-04-24 17:04:20 +02:00
parent 6789ea3482
commit 6db0766564
6 changed files with 25 additions and 10 deletions

View File

@ -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();
}