From 42a23ae42af7de468a1f5ce99636fa0bf54a7a0a Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Mon, 13 Jul 2026 20:39:41 +0200 Subject: [PATCH] Draw a thin border around each right-sidebar panel --- 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) {