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>
This commit is contained in:
parent
ed5d04fcfc
commit
158231e073
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user