diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2018-09-18 16:41:44 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2018-10-09 22:03:32 +0000 |
commit | d66253665a6d95394791ede9dea6a8d6972803c6 (patch) | |
tree | db27a8ee91f258815b37283f50351fd15de3e0ec /src/widgets/styles/qcommonstyle.cpp | |
parent | 41418a92b7b490f3af5e2974cf4152c56e3d00fa (diff) |
QSideBar: take the icon size from a style
Change-Id: I9c4677b42cc920b7bb016b61b8c1fd34fe67aa30
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 87d233f024..07cdcac5ab 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -100,6 +100,9 @@ #if QT_CONFIG(wizard) #include <qwizard.h> #endif +#if QT_CONFIG(filedialog) +#include <qsidebar_p.h> +#endif #include <qfileinfo.h> #include <qdir.h> #include <qsettings.h> @@ -4720,9 +4723,16 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid break; case PM_TabBarIconSize: - case PM_ListViewIconSize: ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); break; + case PM_ListViewIconSize: +#if QT_CONFIG(filedialog) + if (qobject_cast<const QSidebar *>(widget)) + ret = int(QStyleHelper::dpiScaled(24.)); + else +#endif + ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); + break; case PM_ButtonIconSize: case PM_SmallIconSize: |