]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix Bug 334696 - File/directory icons/names move to the right when opening/refreshing...
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Sun, 25 May 2014 16:30:37 +0000 (18:30 +0200)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Thu, 29 May 2014 13:33:03 +0000 (15:33 +0200)
Take the scrollbar spacing into account.

BUG: 334696
REVIEW: 118319
FIXED-IN: 4.13.2

src/kitemviews/kitemlistview.cpp

index f1b35fa53527a879d94a1cc81a5e2d546bbce497..222a29cf519f22aee13aaf740de27baae6e5443d 100644 (file)
@@ -1048,11 +1048,17 @@ void KItemListView::slotItemsInserted(const KItemRangeList& itemRanges)
                                               (!verticalScrollOrientation && maximumScrollOffset() > size().width());
             if (decreaseLayouterSize) {
                 const int scrollBarExtent = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
+
+                int scrollbarSpacing = 0;
+                if (style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents)) {
+                    scrollbarSpacing = style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing);
+                }
+
                 QSizeF layouterSize = m_layouter->size();
                 if (verticalScrollOrientation) {
-                    layouterSize.rwidth() -= scrollBarExtent;
+                    layouterSize.rwidth() -= scrollBarExtent + scrollbarSpacing;
                 } else {
-                    layouterSize.rheight() -= scrollBarExtent;
+                    layouterSize.rheight() -= scrollBarExtent + scrollbarSpacing;
                 }
                 m_layouter->setSize(layouterSize);
             }