]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Revert "[DetailsView] Improve zooming"
authorEugene Popov <popov895@ukr.net>
Sat, 29 Jan 2022 16:35:47 +0000 (16:35 +0000)
committerFelix Ernst <fe.a.ernst@gmail.com>
Sat, 29 Jan 2022 16:35:47 +0000 (16:35 +0000)
This reverts commit 7908aff3b5ebe4484d391c1fc4797e9dae2300b2.

Reverting this commit will fix the issue of not being able to rename
the last file in Details View and will also make the items in Details
View and Compact View have the same height.

BUG: 447215
FIXED-IN: 21.12.2

src/kitemviews/kstandarditemlistwidget.cpp

index 1751812710f8d78dce8baa1e52c5de9d4f22ece6..9c527fa171deb2e4b74672b9cf6ca40c8e642e67 100644 (file)
@@ -226,22 +226,8 @@ void KStandardItemListWidgetInformant::calculateCompactLayoutItemSizeHints(QVect
 void KStandardItemListWidgetInformant::calculateDetailsLayoutItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const
 {
     const KItemListStyleOption& option = view->styleOption();
-
-    float zoomLevel = 1;
-    if (option.iconSize >= KIconLoader::SizeEnormous) {
-        zoomLevel = 2;
-    } else if (option.iconSize >= KIconLoader::SizeHuge) {
-        zoomLevel = 1.8;
-    } else if (option.iconSize >= KIconLoader::SizeLarge) {
-        zoomLevel = 1.6;
-    } else if (option.iconSize >= KIconLoader::SizeMedium) {
-        zoomLevel = 1.4;
-    } else if (option.iconSize >= KIconLoader::SizeSmallMedium) {
-        zoomLevel = 1.2;
-    }
-
-    const qreal contentHeight = qMax<qreal>(option.iconSize, zoomLevel * option.fontMetrics.height());
-    logicalHeightHints.fill(contentHeight + 2 * option.padding);
+    const qreal height = option.padding * 2 + qMax(option.iconSize, option.fontMetrics.height());
+    logicalHeightHints.fill(height);
     logicalWidthHint = -1.0;
 }