From 851eeff6f40fbcfbed31e2999bcaea89c55dad84 Mon Sep 17 00:00:00 2001 From: Malte Langkabel Date: Mon, 13 Jul 2026 07:18:20 +0200 Subject: [PATCH] Draw a thin border around each right-sidebar panel Enable WA_StyledBackground on the three side-panel sections and apply a class-scoped stylesheet border so each panel gets a thin outline without the rule cascading onto child widgets. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps --- src/ui/MainWindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ui/MainWindow.cpp b/src/ui/MainWindow.cpp index b19ff92..216a88a 100644 --- a/src/ui/MainWindow.cpp +++ b/src/ui/MainWindow.cpp @@ -60,6 +60,20 @@ MainWindow::MainWindow(Simulation* sim, const std::string& configDir, sideLayout->addWidget(m_buildButtonGrid, 1); sideLayout->addWidget(m_blueprintPanel, 1); + // Draw a thin border around each of the three side-panel sections. The class + // scoped selectors keep the border on the panels themselves rather than + // cascading onto their child widgets; WA_StyledBackground lets the plain + // QWidget subclasses honor the stylesheet box (border/background). + for (QWidget* panel : { static_cast(m_selectedBuildingPanel), + static_cast(m_buildButtonGrid), + static_cast(m_blueprintPanel) }) + { + panel->setAttribute(Qt::WA_StyledBackground, true); + } + m_sidePanel->setStyleSheet(QStringLiteral( + "SelectedBuildingPanel, BuildButtonGrid, BlueprintPanel {" + " border: 1px solid palette(mid); }")); + m_gameWorldView->setFocus(); connect(qApp, &QApplication::focusChanged, this, [this](QWidget*, QWidget* newWidget) {