1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

Demo: tweaked ShowFontSelector() and ShowStyleSelector() to update selection while navigating and to not close popup automatically.

This commit is contained in:
ocornut 2025-09-09 17:50:40 +02:00
parent 8e4955bb23
commit 045645e5f1
3 changed files with 20 additions and 10 deletions

View file

@ -17873,7 +17873,7 @@ void ImGui::ShowFontSelector(const char* label)
for (ImFont* font : io.Fonts->Fonts)
{
PushID((void*)font);
if (Selectable(font->GetDebugName(), font == font_current))
if (Selectable(font->GetDebugName(), font == font_current, ImGuiSelectableFlags_SelectOnNav | ImGuiSelectableFlags_NoAutoClosePopups))
io.FontDefault = font;
if (font == font_current)
SetItemDefaultFocus();