diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-07-15 15:47:29 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-10-18 14:08:41 +0000 |
commit | 158231e073eb2f94e7a6dfbf071dc2f34283321a (patch) | |
tree | 5bb289dbc39be2e29354457bc12ec1de78e0e364 /src/widgets/styles/qcommonstyle.cpp | |
parent | ed5d04fcfc4e00ce92b04d442e1e69cebb01bc9c (diff) |
QCommonStyle::standardIcon: Add 64x64 Qt logo pixmap for SP_TitleBarMenuButton
For SP_TitleBarMenuButton, the style defaulted to standardPixmap()
would return a 16x16 XPM encoded pixmap from qcommonstylepixmaps_p.h.
This resulted in a too-small menu icon when displaying QMdiSubWindow
with the default icon set on a High DPI screen with
Qt::AA_DisableHighDpiScaling set.
Add a larger icon from resources.
Change-Id: If88c606a31ee9499f520089365f685ec75e0ddad
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 6bf9d20b47..6d83dea4ab 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -5194,6 +5194,8 @@ static QPixmap cachedPixmapFromXPM(const char * const *xpm) return result; } +static inline QPixmap titleBarMenuCachedPixmapFromXPM() { return cachedPixmapFromXPM(qt_menu_xpm); } + #ifndef QT_NO_IMAGEFORMAT_PNG static inline QString clearText16IconPath() { @@ -5538,7 +5540,7 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti #ifndef QT_NO_IMAGEFORMAT_XPM switch (sp) { case SP_TitleBarMenuButton: - return cachedPixmapFromXPM(qt_menu_xpm); + return titleBarMenuCachedPixmapFromXPM(); case SP_TitleBarShadeButton: return cachedPixmapFromXPM(qt_shade_xpm); case SP_TitleBarUnshadeButton: @@ -6080,6 +6082,12 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption case SP_MediaVolumeMuted: icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"), QSize(16, 16)); break; + case SP_TitleBarMenuButton: +# ifndef QT_NO_IMAGEFORMAT_XPM + icon.addPixmap(titleBarMenuCachedPixmapFromXPM()); +# endif + icon.addFile(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png")); + break; #endif // QT_NO_IMAGEFORMAT_PNG default: icon.addPixmap(proxy()->standardPixmap(standardIcon, option, widget)); |