diff options
| author | Akseli Lahtinen <[email protected]> | 2025-04-24 15:03:42 +0300 |
|---|---|---|
| committer | Akseli Lahtinen <[email protected]> | 2025-04-24 15:08:25 +0300 |
| commit | be36fc1bc45b63693bd5861efed94c08cd9ffe2a (patch) | |
| tree | d28221d403d6b81ec1bf98c45467c31db0ff39e8 /src/dolphinviewcontainer.cpp | |
| parent | 98dfc4dc180386e79ce2914aab57b2944be83620 (diff) | |
DolphinStatusBar: Fix premature text squeezing
The text would get squeezed and elided prematurely due to some clipping
calculations and paddings created for the clipping.
This slightly modifies the clipping code, that we extend the painted
area and then clip off the excess, instead of moving the area to
specific place and then clipping off the excess.
This also makes sure the text width accounts for one extra character
plus the clippings we do, so that text will always fit the statusbar.
BUG: 503164
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 9bda4d888..ee4bb6e4c 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -1094,11 +1094,9 @@ bool DolphinViewContainer::eventFilter(QObject *object, QEvent *event) QRect DolphinViewContainer::preferredSmallStatusBarGeometry() { - // Adjust to clipping, we need to add 1 due to how QRects coordinates work. - int clipAdjustment = m_statusBar->clippingAmount() + 1; - // Add offset depending if horizontal scrollbar or filterbar is visible. - const int yPos = m_view->geometry().bottom() - m_view->horizontalScrollBarHeight() - m_statusBar->minimumHeight() + clipAdjustment; - QRect statusBarRect = rect().adjusted(-clipAdjustment, yPos, 0, 0); + // Add offset depending if horizontal scrollbar or filterbar is visible, we need to add 1 due to how QRect coordinates work. + const int yPos = m_view->geometry().bottom() - m_view->horizontalScrollBarHeight() - m_statusBar->minimumHeight() + 1; + QRect statusBarRect = rect().adjusted(0, yPos, 0, 0); return statusBarRect; } |
