]> cloud.milkyroute.net Git - dolphin.git/commitdiff
statusbar: fix offset for selectionModeBottomBar
authorAkseli Lahtinen <akselmo@akselmo.dev>
Thu, 27 Feb 2025 16:40:02 +0000 (16:40 +0000)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Thu, 27 Feb 2025 16:40:02 +0000 (16:40 +0000)
If selectionMode was running, statusbar would get hidden behind the
selectionmode bottom bar.

Instead of calculating offsets, just check for the view geometry bottom position and use that for the statusbar yPos.

src/dolphinviewcontainer.cpp

index 99b7a4042377142439d1282545ea90ca12f82a05..40df2bc7d894f14e7e1cac79926d3a90b801fb09 100644 (file)
@@ -1111,17 +1111,10 @@ bool DolphinViewContainer::eventFilter(QObject *object, QEvent *event)
 
 QRect DolphinViewContainer::preferredSmallStatusBarGeometry()
 {
-    // Add offset depending if horizontal scrollbar or filterbar is visible.
-    int filterBarHeightOffset = 0;
-    int scrollbarHeightOffset = m_view->horizontalScrollBarHeight();
-
-    if (m_filterBar->isVisible()) {
-        filterBarHeightOffset = m_filterBar->height();
-    }
-
     // Adjust to clipping, we need to add 1 due to how QRects coordinates work.
     int clipAdjustment = m_statusBar->clippingAmount() + 1;
-    const int yPos = rect().bottom() - m_statusBar->minimumHeight() - scrollbarHeightOffset - filterBarHeightOffset + clipAdjustment;
+    // 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);
     return statusBarRect;
 }