From 3115ae081591fe75b98747a7737eab065f2628f8 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 27 Dec 2024 11:49:39 +0100 Subject: [PATCH] Demo: Font selector combo sets default focus. --- imgui_demo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 36d8f4415..c9a21759d 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -7851,6 +7851,8 @@ void ImGui::ShowFontSelector(const char* label) ImGui::PushID((void*)font); if (ImGui::Selectable(font->GetDebugName(), font == font_current)) io.FontDefault = font; + if (font == font_current) + ImGui::SetItemDefaultFocus(); ImGui::PopID(); } ImGui::EndCombo();