]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Prevent that icons overlap in Details View when zooming.
authorFrank Reininghaus <frank78ac@googlemail.com>
Tue, 5 Oct 2010 17:56:07 +0000 (17:56 +0000)
committerFrank Reininghaus <frank78ac@googlemail.com>
Tue, 5 Oct 2010 17:56:07 +0000 (17:56 +0000)
The problem was that a maximum size was assigned to KFileItemDelegate
for displaying items without considering that icon zooming may change
the item height.

CCBUG: 234600

svn path=/trunk/KDE/kdebase/apps/; revision=1182797

src/views/dolphindetailsview.cpp

index d14186383e15e5cc4b175059d7f680d7bae2ab25..04ce06f6d3036247fac986afd4abe1b706181204 100644 (file)
@@ -1070,7 +1070,19 @@ void DolphinDetailsView::updateDecorationSize(bool showPreview)
     setIconSize(QSize(iconSize, iconSize));
     m_decorationSize = QSize(iconSize, iconSize);
 
+    if (m_extensionsFactory) {
+        // The old maximumSize used by KFileItemDelegate is not valid any more after the icon size change.
+        // It must be discarded before doItemsLayout() is called (see bug 234600).
+        m_extensionsFactory->fileItemDelegate()->setMaximumSize(QSize());
+    }
+
     doItemsLayout();
+
+    // Calculate the new maximumSize for KFileItemDelegate after the icon size change.
+    QModelIndex current = currentIndex();
+    if (current.isValid()) {
+        adjustMaximumSizeForEditing(current);
+    }
 }
 
 KFileItemDelegate::Information DolphinDetailsView::infoForColumn(int columnIndex) const