1
0
mirror of https://github.com/ocornut/imgui.git synced 2025-02-02 20:47:23 +01:00

Demo: Font selector combo sets default focus.

This commit is contained in:
ocornut 2024-12-27 11:49:39 +01:00
parent cec8ff1885
commit 3115ae0815

View File

@ -7851,6 +7851,8 @@ void ImGui::ShowFontSelector(const char* label)
ImGui::PushID((void*)font); ImGui::PushID((void*)font);
if (ImGui::Selectable(font->GetDebugName(), font == font_current)) if (ImGui::Selectable(font->GetDebugName(), font == font_current))
io.FontDefault = font; io.FontDefault = font;
if (font == font_current)
ImGui::SetItemDefaultFocus();
ImGui::PopID(); ImGui::PopID();
} }
ImGui::EndCombo(); ImGui::EndCombo();