From 3a574ade8cac814be8289516e8dea1e0d05506d1 Mon Sep 17 00:00:00 2001 From: alexei-zebra Date: Sun, 11 Oct 2026 20:06:15 +0300 Subject: [PATCH] Keep the frames of the GUI inside the content area The engine draws the window bar on top of the GUI, so a frame as high as the window lost its top to the bar. GUI::act() limits such a frame to the content area and places it right below the bar; frames that are smaller than the window are not touched. --- src/graphics/ui/GUI.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index 2786590cb..812eec4d4 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -243,10 +243,20 @@ void GUI::actFocused() { void GUI::act(float delta, const glm::uvec2& vp) { const uint inset = static_cast(viewportOffset); + const uint contentHeight = vp.y > inset ? vp.y - inset : vp.y; container->setPos({0.0f, static_cast(inset)}); - container->setSize({vp.x, vp.y > inset ? vp.y - inset : vp.y}); + container->setSize({vp.x, contentHeight}); for (auto& pair : frames) { - pair.second->act(delta); + auto& frame = *pair.second; + auto size = frame.getSize(); + // the bar covers the top of the window, so a frame as high as the + // window is limited to the content area + if (size.y > static_cast(contentHeight)) { + size.y = static_cast(contentHeight); + frame.setSize(size); + frame.setPos({0.0f, static_cast(inset)}); + } + frame.act(delta); } auto prevfocus = focus;