]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Respect platform's icon sizes
authorChristoph Feck <christoph@maxiom.de>
Tue, 17 Jul 2012 23:22:55 +0000 (01:22 +0200)
committerChristoph Feck <christoph@maxiom.de>
Tue, 17 Jul 2012 23:22:55 +0000 (01:22 +0200)
Use QStyle icon sizes instead of hard coding 16 or 32 pixels.
Using styles that follow KDE settings (every KStyle, e.g.
Oxygen) the icon sizes can be configured by the user in
System Settings.

The size for the icon/details view can be later changed
by the user, overriding the defaults. The icon size for the
places panel is not (yet?) configurable separately.

(Not resolving the bug, see comment in review request)

CCBUG: 301959
REVIEW: 105548

src/kitemviews/kstandarditemlistview.cpp

index f4d05dcf6b9729e94607f7e88abb109550dc7ec8..79eb86b891f865697f467ae3f2839caf7fa5c329 100644 (file)
@@ -141,9 +141,9 @@ void KStandardItemListView::onSupportsItemExpandingChanged(bool supportsExpandin
 void KStandardItemListView::polishEvent()
 {
     switch (m_itemLayout) {
-    case IconsLayout:   applyDefaultStyleOption(KIconLoader::SizeMedium, 2, 4, 8); break;
-    case CompactLayout: applyDefaultStyleOption(KIconLoader::SizeSmall,  2, 8, 0); break;
-    case DetailsLayout: applyDefaultStyleOption(KIconLoader::SizeSmall,  2, 0, 0); break;
+    case IconsLayout:   applyDefaultStyleOption(style()->pixelMetric(QStyle::PM_LargeIconSize), 2, 4, 8); break;
+    case CompactLayout: applyDefaultStyleOption(style()->pixelMetric(QStyle::PM_SmallIconSize),  2, 8, 0); break;
+    case DetailsLayout: applyDefaultStyleOption(style()->pixelMetric(QStyle::PM_SmallIconSize),  2, 0, 0); break;
     default:            Q_ASSERT(false); break;
     }