mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-22 01:54:21 +00:00
Merge branch 'master' into docking
# Conflicts: # backends/imgui_impl_osx.h # backends/imgui_impl_osx.mm # backends/imgui_impl_sdl3.cpp # backends/imgui_impl_vulkan.cpp # imgui.h
This commit is contained in:
commit
3ec62dfeff
16 changed files with 399 additions and 149 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// dear imgui, v1.92.0
|
||||
// dear imgui, v1.92.1 WIP
|
||||
// (demo code)
|
||||
|
||||
// Help:
|
||||
|
|
@ -3629,6 +3629,43 @@ static void DemoWindowWidgetsText()
|
|||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Widgets/Text/Font Size");
|
||||
if (ImGui::TreeNode("Font Size"))
|
||||
{
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
const float global_scale = style.FontScaleMain * style.FontScaleDpi;
|
||||
ImGui::Text("style.FontScaleMain = %0.2f", style.FontScaleMain);
|
||||
ImGui::Text("style.FontScaleDpi = %0.2f", style.FontScaleDpi);
|
||||
ImGui::Text("global_scale = ~%0.2f", global_scale); // This is not technically accurate as internal scales may apply, but conceptually let's pretend it is.
|
||||
ImGui::Text("FontSize = %0.2f", ImGui::GetFontSize());
|
||||
|
||||
ImGui::SeparatorText("");
|
||||
static float custom_size = 16.0f;
|
||||
ImGui::SliderFloat("custom_size", &custom_size, 10.0f, 100.0f, "%.0f");
|
||||
ImGui::Text("ImGui::PushFont(nullptr, custom_size);");
|
||||
ImGui::PushFont(NULL, custom_size);
|
||||
ImGui::Text("FontSize = %.2f (== %.2f * global_scale)", ImGui::GetFontSize(), custom_size);
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::SeparatorText("");
|
||||
static float custom_scale = 1.0f;
|
||||
ImGui::SliderFloat("custom_scale", &custom_scale, 0.5f, 4.0f, "%.2f");
|
||||
ImGui::Text("ImGui::PushFont(nullptr, style.FontSizeBase * custom_scale);");
|
||||
ImGui::PushFont(NULL, style.FontSizeBase * custom_scale);
|
||||
ImGui::Text("FontSize = %.2f (== style.FontSizeBase * %.2f * global_scale)", ImGui::GetFontSize(), custom_scale);
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::SeparatorText("");
|
||||
for (float scaling = 0.5f; scaling <= 4.0f; scaling += 0.5f)
|
||||
{
|
||||
ImGui::PushFont(NULL, style.FontSizeBase * scaling);
|
||||
ImGui::Text("FontSize = %.2f (== style.FontSizeBase * %.2f * global_scale)", ImGui::GetFontSize(), scaling);
|
||||
ImGui::PopFont();
|
||||
}
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
IMGUI_DEMO_MARKER("Widgets/Text/Word Wrapping");
|
||||
if (ImGui::TreeNode("Word Wrapping"))
|
||||
{
|
||||
|
|
@ -8332,7 +8369,12 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
|||
// General
|
||||
SeparatorText("General");
|
||||
if ((GetIO().BackendFlags & ImGuiBackendFlags_RendererHasTextures) == 0)
|
||||
{
|
||||
BulletText("Warning: Font scaling will NOT be smooth, because\nImGuiBackendFlags_RendererHasTextures is not set!");
|
||||
BulletText("For instructions, see:");
|
||||
SameLine();
|
||||
TextLinkOpenURL("docs/BACKENDS.md", "https://github.com/ocornut/imgui/blob/master/docs/BACKENDS.md");
|
||||
}
|
||||
|
||||
if (ShowStyleSelector("Colors##Selector"))
|
||||
ref_saved_style = style;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue