┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/statusbar
diff options
context:
space:
mode:
authorAkseli Lahtinen <[email protected]>2025-04-22 16:52:50 +0300
committerAkseli Lahtinen <[email protected]>2025-04-22 16:52:50 +0300
commit5d9051bba36c8690a622591b1164158f526a9f12 (patch)
treee1715162eb9203f65cb7cfb45ca3180986b3d051 /src/statusbar
parentb7bafd21ebf6b337d7e110141a3e91c3c7ecf445 (diff)
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.
Diffstat (limited to 'src/statusbar')
-rw-r--r--src/statusbar/dolphinstatusbar.cpp6
1 files changed, 5 insertions, 1 deletions
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);
}
}