From 5d9051bba36c8690a622591b1164158f526a9f12 Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Tue, 22 Apr 2025 16:52:50 +0300 Subject: [PATCH] DolphinStatusbar: Fix background and margins for non-Breeze styles There is a bug where non-Breeze styles, such as fusion, do not always have background color for the small statusbar. There is also a bug that made the statusbar too small for other themes. This patch makes us always draw a background, and uses marginLeft and marginRight from QStyle. --- src/statusbar/dolphinstatusbar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index 4d76afcbe..17a29e84c 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -292,7 +292,8 @@ void DolphinStatusBar::updateWidthToContent() // from "jumping around" when user tries to interact with them. setFixedWidth(maximumViewWidth); } else { - const int contentWidth = labelSize.width() + 15; + const int contentWidth = style()->pixelMetric(QStyle::PM_LayoutLeftMargin, &opt, this) + labelSize.width() + + style()->pixelMetric(QStyle::PM_LayoutRightMargin, &opt, this); setFixedWidth(qMin(contentWidth, maximumViewWidth)); } Q_EMIT widthUpdated(); @@ -447,6 +448,9 @@ void DolphinStatusBar::paintEvent(QPaintEvent *paintEvent) path.addRect(clipRect); p.setClipPath(path); opt.palette.setColor(QPalette::Base, palette().window().color()); + p.setBrush(palette().window().color()); + p.setPen(Qt::transparent); + p.drawRoundedRect(opt.rect, 5, 5); // Radius is from Breeze style. style()->drawPrimitive(QStyle::PE_Frame, &opt, &p, this); } } -- 2.47.3