From cad17ddefd3dec96a23bc4fed4e8252c7d7cbdfb Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 16 Jan 2025 19:27:22 +0100 Subject: [PATCH] fix: Banners being misplaced on macOS --- main/gui/source/window/window.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 8748796f4..0f744ea1d 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -560,9 +560,16 @@ namespace hex { const bool onWelcomeScreen = !ImHexApi::Provider::isValid(); const auto windowPos = ImHexApi::System::getMainWindowPosition(); - float startY = windowPos.y + ((ImGui::GetTextLineHeight() + (ImGui::GetStyle().FramePadding.y * 2.0F)) * (onWelcomeScreen ? 2 : 3)); + float startY = windowPos.y + ImGui::GetTextLineHeight() + ((ImGui::GetTextLineHeight() + (ImGui::GetStyle().FramePadding.y * 2.0F)) * (onWelcomeScreen ? 1 : 2)); const auto height = 30_scaled; + // Offset banner based on the size of the title bar. On macOS it's slightly taller + #if defined(OS_MACOS) + startY += 2 * 8_scaled; + #else + startY += 2 * ImGui::GetStyle().FramePadding.y; + #endif + for (const auto &banner : impl::BannerBase::getOpenBanners() | std::views::take(5)) { ImGui::PushID(banner.get()); {