mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 20:07:01 +00:00
Demo: Font selector allow selecting fonts with same debug name. (#2332)
This commit is contained in:
parent
afc36cf802
commit
00c637961b
@ -2738,8 +2738,13 @@ void ImGui::ShowFontSelector(const char* label)
|
|||||||
if (ImGui::BeginCombo(label, font_current->GetDebugName()))
|
if (ImGui::BeginCombo(label, font_current->GetDebugName()))
|
||||||
{
|
{
|
||||||
for (int n = 0; n < io.Fonts->Fonts.Size; n++)
|
for (int n = 0; n < io.Fonts->Fonts.Size; n++)
|
||||||
if (ImGui::Selectable(io.Fonts->Fonts[n]->GetDebugName(), io.Fonts->Fonts[n] == font_current))
|
{
|
||||||
io.FontDefault = io.Fonts->Fonts[n];
|
ImFont* font = io.Fonts->Fonts[n];
|
||||||
|
ImGui::PushID((void*)font);
|
||||||
|
if (ImGui::Selectable(font->GetDebugName(), font == font_current))
|
||||||
|
io.FontDefault = font;
|
||||||
|
ImGui::PopID();
|
||||||
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
Loading…
Reference in New Issue
Block a user