summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/OnScreenUI.cpp
diff options
context:
space:
mode:
authorTryTwo <taolas@gmail.com>2025-09-17 23:38:36 -0700
committerTryTwo <taolas@gmail.com>2025-09-25 16:34:04 -0700
commitf8a8ddeddfa969e77edef3349782074bcabe1ef7 (patch)
tree319d59971ce49d112fe8684f7f5cf40446876442 /Source/Core/VideoCommon/OnScreenUI.cpp
parentfce5f7c74ed069459b3c298b6e2459dd76f987d7 (diff)
OSD / Imgui: Add font size spinbox to Interface Pane.
Adjust some imgui windows to work better with different font sizes.
Diffstat (limited to 'Source/Core/VideoCommon/OnScreenUI.cpp')
-rw-r--r--Source/Core/VideoCommon/OnScreenUI.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/OnScreenUI.cpp b/Source/Core/VideoCommon/OnScreenUI.cpp
index 935cec8619..4689bb6321 100644
--- a/Source/Core/VideoCommon/OnScreenUI.cpp
+++ b/Source/Core/VideoCommon/OnScreenUI.cpp
@@ -263,11 +263,12 @@ void OnScreenUI::DrawDebugText()
{
// Position under the FPS display.
ImGui::SetNextWindowPos(
- ImVec2(ImGui::GetIO().DisplaySize.x - 10.f * m_backbuffer_scale, 80.f * m_backbuffer_scale),
+ ImVec2(ImGui::GetIO().DisplaySize.x - ImGui::GetFontSize() * m_backbuffer_scale,
+ 80.f * m_backbuffer_scale),
ImGuiCond_FirstUseEver, ImVec2(1.0f, 0.0f));
- ImGui::SetNextWindowSizeConstraints(
- ImVec2(150.0f * m_backbuffer_scale, 20.0f * m_backbuffer_scale),
- ImGui::GetIO().DisplaySize);
+ ImGui::SetNextWindowSizeConstraints(ImVec2(5.0f * ImGui::GetFontSize() * m_backbuffer_scale,
+ 2.1f * ImGui::GetFontSize() * m_backbuffer_scale),
+ ImGui::GetIO().DisplaySize);
if (ImGui::Begin("Movie", nullptr, ImGuiWindowFlags_NoFocusOnAppearing))
{
auto& movie = Core::System::GetInstance().GetMovie();
@@ -395,6 +396,12 @@ void OnScreenUI::Finalize()
DrawChallengesAndLeaderboards();
ImGui::Render();
+ // Check for font changes
+ ImGuiStyle& style = ImGui::GetStyle();
+ const int size = Config::Get(Config::MAIN_OSD_FONT_SIZE);
+ if (size != style.FontSizeBase)
+ style.FontSizeBase = static_cast<float>(size);
+
// Create or update fonts.
ImDrawData* draw_data = ImGui::GetDrawData();
if (draw_data->Textures != nullptr)