From 158231e073eb2f94e7a6dfbf071dc2f34283321a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 15 Jul 2016 15:47:29 +0200 Subject: QCommonStyle::standardIcon: Add 64x64 Qt logo pixmap for SP_TitleBarMenuButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/widgets/styles/qcommonstyle.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/widgets') 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)); -- cgit v1.2.3