From c8ba9746f25486adab91db64a5266b2550123ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Sat, 25 Jan 2014 03:30:45 +0100 Subject: [PATCH] iconSizes.default be gone This is used nowhere, so better get rid of it before someone gets the idea. Leaves us with only one non-scaled icon size. Maybe worth considering to get rid of this as well, and let Folderview decide? --- src/declarativeimports/core/units.cpp | 5 +++-- src/declarativeimports/core/units.h | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/declarativeimports/core/units.cpp b/src/declarativeimports/core/units.cpp index 184c55972..a1e58d83b 100644 --- a/src/declarativeimports/core/units.cpp +++ b/src/declarativeimports/core/units.cpp @@ -55,9 +55,10 @@ Units::~Units() void Units::iconLoaderSettingsChanged() { - m_iconSizes->insert("default", QVariant(KIconLoader::global()->currentSize(KIconLoader::Desktop))); + // These are not scaled, we respect the user's setting over dpi scaling m_iconSizes->insert("desktop", QVariant(KIconLoader::global()->currentSize(KIconLoader::Desktop))); + // The following icon sizes are fully scaled to dpi m_iconSizes->insert("small", devicePixelIconSize(KIconLoader::SizeSmall)); m_iconSizes->insert("smallMedium", devicePixelIconSize(KIconLoader::SizeSmallMedium)); m_iconSizes->insert("medium", devicePixelIconSize(KIconLoader::SizeMedium)); @@ -102,7 +103,7 @@ int Units::devicePixelIconSize(const int size) const out = dpisize; } // FIXME: Add special casing for < 64 cases: align to kiconloader size - + //qDebug() << " Size in: " << size << dpisize << " -> " << out; return out; } diff --git a/src/declarativeimports/core/units.h b/src/declarativeimports/core/units.h index a018af9b3..817a4a703 100644 --- a/src/declarativeimports/core/units.h +++ b/src/declarativeimports/core/units.h @@ -44,7 +44,7 @@ class Units : public QObject * The icon sizes provided are normalized for different DPI, so icons * will scale depending on the DPI. * - * Icon sizes from KIconLoader: + * Icon sizes from KIconLoader, adjusted to devicePixelRatio: * * small * * smallMedium * * medium @@ -52,12 +52,8 @@ class Units : public QObject * * huge * * enormous * - * Icon sizes depending on the context: use those if possible - * Access with units.iconSizes.desktop units.iconSizes.small etc. - * available keys are: + * Not devicePixelRation-adjusted:: * * desktop - * * toolbar - * * dialog */ Q_PROPERTY(QQmlPropertyMap *iconSizes READ iconSizes NOTIFY iconSizesChanged)