From be36fc1bc45b63693bd5861efed94c08cd9ffe2a Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Thu, 24 Apr 2025 15:03:42 +0300 Subject: 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 --- src/dolphinviewcontainer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/dolphinviewcontainer.cpp') 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; } -- cgit v1.3