From 59cb09fc29025015caac09f1d8dd48d5a6ab0a2d Mon Sep 17 00:00:00 2001 From: Dlizzio <77717521+Dlizzio@users.noreply.github.com> Date: Mon, 2 Feb 2026 04:53:43 -0700 Subject: [PATCH 1/2] chore(UI): add subtext font to tooltips --- src/Utils/UI.cpp | 14 +++++++++++++- src/Utils/UI.h | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Utils/UI.cpp b/src/Utils/UI.cpp index 6e360f4049..aeb0c87117 100644 --- a/src/Utils/UI.cpp +++ b/src/Utils/UI.cpp @@ -3,6 +3,7 @@ #include "../WeatherEditor/EditorWindow.h" #include "FileSystem.h" #include "Menu.h" +#include "Menu/Fonts.h" #include "Menu/IconLoader.h" #include "Menu/ThemeManager.h" #include "ShaderCache.h" @@ -41,18 +42,29 @@ namespace Util { - HoverTooltipWrapper::HoverTooltipWrapper() + HoverTooltipWrapper::HoverTooltipWrapper() : + previousFont(nullptr) { hovered = ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_AllowWhenDisabled); if (hovered) { ImGui::BeginTooltip(); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); + // Apply Subtext font for consistent tooltip styling + if (auto* menu = globals::menu) { + if (auto* subtextFont = menu->GetFont(Menu::FontRole::Subtext)) { + previousFont = ImGui::GetFont(); + ImGui::PushFont(subtextFont); + } + } } } HoverTooltipWrapper::~HoverTooltipWrapper() { if (hovered) { + if (previousFont) { + ImGui::PopFont(); + } ImGui::PopTextWrapPos(); ImGui::EndTooltip(); } diff --git a/src/Utils/UI.h b/src/Utils/UI.h index f3196ad17a..4c368326de 100644 --- a/src/Utils/UI.h +++ b/src/Utils/UI.h @@ -53,11 +53,14 @@ namespace Util * if (auto _tt = Util::HoverTooltipWrapper()){ * ImGui::Text("What the tooltip says."); * } + * + * Automatically applies the Subtext font role for consistent tooltip styling. */ class HoverTooltipWrapper { private: bool hovered; + ImFont* previousFont; public: HoverTooltipWrapper(); From b3e5b6e7bbc36f23e837d72a6b6994ba05f5cc4e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 11:55:45 +0000 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=F0=9F=8E=A8=20apply=20pre-commit.?= =?UTF-8?q?ci=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details. --- src/Utils/UI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/UI.h b/src/Utils/UI.h index 4c368326de..5eea8fbc51 100644 --- a/src/Utils/UI.h +++ b/src/Utils/UI.h @@ -53,7 +53,7 @@ namespace Util * if (auto _tt = Util::HoverTooltipWrapper()){ * ImGui::Text("What the tooltip says."); * } - * + * * Automatically applies the Subtext font role for consistent tooltip styling. */ class HoverTooltipWrapper