summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/OnScreenUI.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2025-09-26 17:13:40 -0400
committerGitHub <noreply@github.com>2025-09-26 17:13:40 -0400
commit70d5c85acd310080355dff8b342a41213bd1091b (patch)
treea85640f36c3143de34daf6c47fb0da20b60a7ac8 /Source/Core/VideoCommon/OnScreenUI.cpp
parentd33c6346f013d7cde2f3baf2ea66802b9c52dea0 (diff)
parentf8a8ddeddfa969e77edef3349782074bcabe1ef7 (diff)
Merge pull request #13897 from TryTwo/Imgui_Font_Size
Qt/Imgui: Add SpinBox to adjust imgui font size.
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)