|
@@ -8229,17 +8229,25 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
|
bool ImGui::ShowStyleSelector(const char* label)
|
|
bool ImGui::ShowStyleSelector(const char* label)
|
|
{
|
|
{
|
|
static int style_idx = -1;
|
|
static int style_idx = -1;
|
|
- if (ImGui::Combo(label, &style_idx, "Dark\0Light\0Classic\0"))
|
|
|
|
|
|
+ const char* style_names[] = { "Dark", "Light", "Classic" };
|
|
|
|
+ bool ret = false;
|
|
|
|
+ if (ImGui::BeginCombo(label, (style_idx >= 0 && style_idx < IM_ARRAYSIZE(style_names)) ? style_names[style_idx] : ""))
|
|
{
|
|
{
|
|
- switch (style_idx)
|
|
|
|
- {
|
|
|
|
- case 0: ImGui::StyleColorsDark(); break;
|
|
|
|
- case 1: ImGui::StyleColorsLight(); break;
|
|
|
|
- case 2: ImGui::StyleColorsClassic(); break;
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
|
|
+ for (int n = 0; n < IM_ARRAYSIZE(style_names); n++)
|
|
|
|
+ if (ImGui::Selectable(style_names[n], style_idx == n, ImGuiSelectableFlags_SelectOnNav | ImGuiSelectableFlags_NoAutoClosePopups))
|
|
|
|
+ {
|
|
|
|
+ style_idx = n;
|
|
|
|
+ ret = true;
|
|
|
|
+ switch (style_idx)
|
|
|
|
+ {
|
|
|
|
+ case 0: ImGui::StyleColorsDark(); break;
|
|
|
|
+ case 1: ImGui::StyleColorsLight(); break;
|
|
|
|
+ case 2: ImGui::StyleColorsClassic(); break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ImGui::EndCombo();
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
static const char* GetTreeLinesFlagsName(ImGuiTreeNodeFlags flags)
|
|
static const char* GetTreeLinesFlagsName(ImGuiTreeNodeFlags flags)
|