Merge branch 'master' into docking

# Conflicts:
#	backends/imgui_impl_dx12.cpp
This commit is contained in:
ocornut
2025-09-10 19:02:44 +02:00
16 changed files with 133 additions and 70 deletions
+18 -11
View File
@@ -8333,17 +8333,25 @@ void ImGui::ShowAboutWindow(bool* p_open)
bool ImGui::ShowStyleSelector(const char* label)
{
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)
@@ -9395,10 +9403,9 @@ static void ShowExampleAppLayout(bool* p_open)
ImGui::BeginChild("left pane", ImVec2(150, 0), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeX);
for (int i = 0; i < 100; i++)
{
// FIXME: Good candidate to use ImGuiSelectableFlags_SelectOnNav
char label[128];
sprintf(label, "MyObject %d", i);
if (ImGui::Selectable(label, selected == i))
if (ImGui::Selectable(label, selected == i, ImGuiSelectableFlags_SelectOnNav))
selected = i;
}
ImGui::EndChild();