Skip to content

Commit

Permalink
Demo: Font selector combo sets default focus.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Jan 7, 2025
1 parent cec8ff1 commit 3115ae0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imgui_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3115ae0

Please sign in to comment.