From: Akseli Lahtinen Date: Tue, 22 Apr 2025 13:52:50 +0000 (+0300) Subject: DolphinStatusbar: Fix background and margins for non-Breeze styles X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/5d9051bba36c8690a622591b1164158f526a9f12?hp=b7bafd21ebf6b337d7e110141a3e91c3c7ecf445 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. --- 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); } }