QSideBar: take the icon size from a style
Change-Id: I9c4677b42cc920b7bb016b61b8c1fd34fe67aa30 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
41418a92b7
commit
d66253665a
@ -381,8 +381,6 @@ QSidebar::QSidebar(QWidget *parent) : QListView(parent)
|
||||
|
||||
void QSidebar::setModelAndUrls(QFileSystemModel *model, const QList<QUrl> &newUrls)
|
||||
{
|
||||
// ### TODO make icon size dynamic
|
||||
setIconSize(QSize(24,24));
|
||||
setUniformItemSizes(true);
|
||||
urlModel = new QUrlModel(this);
|
||||
urlModel->setFileSystemModel(model);
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user