Kaynağa Gözat

Demo: Font selector combo sets default focus.

ocornut 7 ay önce
ebeveyn
işleme
3115ae0815
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2 0
      imgui_demo.cpp

+ 2 - 0
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();