QCommonStyle: Add title bar and tool bar extension icons

Add larger pixmaps for the title bar and tool bar extension
icons.

Task-number: QTBUG-38776
Change-Id: If2514f7aa66fa46d25133165ca45318a5045d387
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This commit is contained in:
Friedemann Kleint 2018-01-11 12:54:56 +01:00
parent 01dadd2da8
commit 6c7fff8c91
26 changed files with 61 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

View File

@ -5716,14 +5716,14 @@ static inline QString iconPngSuffix() { return QStringLiteral(".png"); }
static void addIconFiles(const QString &prefix, const int sizes[], size_t count, QIcon &icon)
{
for (size_t i = 0; i < count; ++i) {
const int size = sizes[i];
icon.addFile(prefix + QString::number(size) + iconPngSuffix(), QSize(size, size));
}
for (size_t i = 0; i < count; ++i)
icon.addFile(prefix + QString::number(sizes[i]) + iconPngSuffix());
}
static const int dockTitleIconSizes[] = {10, 16, 20, 32, 48, 64};
static const int titleBarSizes[] = {16, 32, 48};
static const int toolBarExtHSizes[] = {8, 16, 32};
static const int toolBarExtVSizes[] = {5, 10, 20};
#endif // imageformat_png
/*!
@ -6038,6 +6038,27 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
switch (standardIcon) {
#ifndef QT_NO_IMAGEFORMAT_PNG
case SP_TitleBarMinButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("titlebar-min-"),
titleBarSizes, sizeof(titleBarSizes)/sizeof(titleBarSizes[0]), icon);
break;
case SP_TitleBarMaxButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("titlebar-max-"),
titleBarSizes, sizeof(titleBarSizes)/sizeof(titleBarSizes[0]), icon);
break;
case SP_TitleBarShadeButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("titlebar-shade-"),
titleBarSizes, sizeof(titleBarSizes)/sizeof(titleBarSizes[0]), icon);
break;
case SP_TitleBarUnshadeButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("titlebar-unshade-"),
titleBarSizes, sizeof(titleBarSizes)/sizeof(titleBarSizes[0]), icon);
break;
case SP_TitleBarContextHelpButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("titlebar-contexthelp-"),
titleBarSizes, sizeof(titleBarSizes)/sizeof(titleBarSizes[0]), icon);
break;
case SP_FileDialogNewFolder:
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"), QSize(16, 16));
icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/newdirectory-32.png"), QSize(32, 32));
@ -6246,6 +6267,17 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
addIconFiles(iconResourcePrefix() + QStringLiteral("normalizedockup-"),
dockTitleIconSizes, sizeof(dockTitleIconSizes)/sizeof(dockTitleIconSizes[0]), icon);
break;
case SP_ToolBarHorizontalExtensionButton: {
QString prefix = iconResourcePrefix() + QStringLiteral("toolbar-ext-h-");
if (rtl)
prefix += QStringLiteral("rtl-");
addIconFiles(prefix, toolBarExtHSizes, sizeof(toolBarExtHSizes)/sizeof(toolBarExtHSizes[0]), icon);
}
break;
case SP_ToolBarVerticalExtensionButton:
addIconFiles(iconResourcePrefix() + QStringLiteral("toolbar-ext-v-"),
toolBarExtVSizes, sizeof(toolBarExtVSizes)/sizeof(toolBarExtVSizes[0]), icon);
break;
#endif // QT_NO_IMAGEFORMAT_PNG
default:
icon.addPixmap(proxy()->standardPixmap(standardIcon, option, widget));

View File

@ -140,6 +140,30 @@
<file>images/normalizedockup-32.png</file>
<file>images/normalizedockup-48.png</file>
<file>images/normalizedockup-64.png</file>
<file>images/toolbar-ext-h-8.png</file>
<file>images/toolbar-ext-h-16.png</file>
<file>images/toolbar-ext-h-32.png</file>
<file>images/toolbar-ext-h-rtl-8.png</file>
<file>images/toolbar-ext-h-rtl-16.png</file>
<file>images/toolbar-ext-h-rtl-32.png</file>
<file>images/toolbar-ext-v-5.png</file>
<file>images/toolbar-ext-v-10.png</file>
<file>images/toolbar-ext-v-20.png</file>
<file>images/titlebar-contexthelp-16.png</file>
<file>images/titlebar-contexthelp-32.png</file>
<file>images/titlebar-contexthelp-48.png</file>
<file>images/titlebar-max-16.png</file>
<file>images/titlebar-max-32.png</file>
<file>images/titlebar-max-48.png</file>
<file>images/titlebar-min-16.png</file>
<file>images/titlebar-min-32.png</file>
<file>images/titlebar-min-48.png</file>
<file>images/titlebar-shade-16.png</file>
<file>images/titlebar-shade-32.png</file>
<file>images/titlebar-shade-48.png</file>
<file>images/titlebar-unshade-16.png</file>
<file>images/titlebar-unshade-32.png</file>
<file>images/titlebar-unshade-48.png</file>
</qresource>
<qresource prefix="/qt-project.org/styles/macstyle">
<file alias="images/closedock-16.png">images/closedock-macstyle-16.png</file>