Demo: Removed one level of indentation in the ShowDemoWindowXXX functions (6 kb worth of spaces!). Will break some merge/PR.

This commit is contained in:
omar 2018-10-25 23:40:33 +02:00
parent eed1fba157
commit f3e642322f

View File

@ -391,8 +391,9 @@ void ImGui::ShowDemoWindow(bool* p_open)
static void ShowDemoWindowWidgets() static void ShowDemoWindowWidgets()
{ {
if (ImGui::CollapsingHeader("Widgets")) if (!ImGui::CollapsingHeader("Widgets"))
{ return;
if (ImGui::TreeNode("Basic")) if (ImGui::TreeNode("Basic"))
{ {
static int clicked = 0; static int clicked = 0;
@ -1512,13 +1513,13 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop(); ImGui::TreePop();
} }
}
} }
static void ShowDemoWindowLayout() static void ShowDemoWindowLayout()
{ {
if (ImGui::CollapsingHeader("Layout")) if (!ImGui::CollapsingHeader("Layout"))
{ return;
if (ImGui::TreeNode("Child regions")) if (ImGui::TreeNode("Child regions"))
{ {
static bool disable_mouse_wheel = false; static bool disable_mouse_wheel = false;
@ -1902,13 +1903,13 @@ static void ShowDemoWindowLayout()
ImGui::GetWindowDrawList()->AddText(ImGui::GetFont(), ImGui::GetFontSize()*2.0f, ImVec2(pos.x + offset.x, pos.y + offset.y), IM_COL32(255, 255, 255, 255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect); ImGui::GetWindowDrawList()->AddText(ImGui::GetFont(), ImGui::GetFontSize()*2.0f, ImVec2(pos.x + offset.x, pos.y + offset.y), IM_COL32(255, 255, 255, 255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect);
ImGui::TreePop(); ImGui::TreePop();
} }
}
} }
static void ShowDemoWindowPopups() static void ShowDemoWindowPopups()
{ {
if (ImGui::CollapsingHeader("Popups & Modal windows")) if (!ImGui::CollapsingHeader("Popups & Modal windows"))
{ return;
// Popups are windows with a few special properties: // Popups are windows with a few special properties:
// - They block normal mouse hovering detection outside them. (*) // - They block normal mouse hovering detection outside them. (*)
// - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE. // - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
@ -2109,13 +2110,13 @@ static void ShowDemoWindowPopups()
ImGui::Separator(); ImGui::Separator();
ImGui::TreePop(); ImGui::TreePop();
} }
}
} }
static void ShowDemoWindowColumns() static void ShowDemoWindowColumns()
{ {
if (ImGui::CollapsingHeader("Columns")) if (!ImGui::CollapsingHeader("Columns"))
{ return;
ImGui::PushID("Columns"); ImGui::PushID("Columns");
// Basic columns // Basic columns
@ -2292,7 +2293,6 @@ static void ShowDemoWindowColumns()
ImGui::TreePop(); ImGui::TreePop();
} }
ImGui::PopID(); ImGui::PopID();
}
} }
static void ShowDemoWindowMisc() static void ShowDemoWindowMisc()