Add high-resolution pixmaps for macOS dock widget title icons

The macOS style falls back to the QCommonStyle for those, and that
style loads the macstyle pixmaps. Weird, but cleaning that up is
for another commit.

Fixes: QTBUG-38776
Change-Id: Ie1fe721387e64cb91ee5fc528667a63e6ddd6eed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 550e511ec8a1aa12ac75ebd71079511572840065)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2021-06-18 10:58:27 +02:00 committed by Qt Cherry-pick Bot
parent 664b368ace
commit 66c2f31ec9
22 changed files with 28 additions and 8 deletions

View File

@ -248,10 +248,30 @@ qt_internal_add_resource(Widgets "qstyle"
${qstyle_resource_files}
)
set(qstyle1_resource_files
"styles/images/closedock-down-macstyle-10.png"
"styles/images/closedock-down-macstyle-16.png"
"styles/images/closedock-down-macstyle-20.png"
"styles/images/closedock-down-macstyle-32.png"
"styles/images/closedock-down-macstyle-48.png"
"styles/images/closedock-down-macstyle-64.png"
"styles/images/closedock-macstyle-10.png"
"styles/images/closedock-macstyle-16.png"
"styles/images/closedock-macstyle-20.png"
"styles/images/closedock-macstyle-32.png"
"styles/images/closedock-macstyle-48.png"
"styles/images/closedock-macstyle-64.png"
"styles/images/dockdock-down-macstyle-10.png"
"styles/images/dockdock-down-macstyle-16.png"
"styles/images/dockdock-down-macstyle-20.png"
"styles/images/dockdock-down-macstyle-32.png"
"styles/images/dockdock-down-macstyle-48.png"
"styles/images/dockdock-down-macstyle-64.png"
"styles/images/dockdock-macstyle-10.png"
"styles/images/dockdock-macstyle-16.png"
"styles/images/dockdock-macstyle-20.png"
"styles/images/dockdock-macstyle-32.png"
"styles/images/dockdock-macstyle-48.png"
"styles/images/dockdock-macstyle-64.png"
"styles/images/toolbar-ext-macstyle.png"
"styles/images/toolbar-ext-macstyle@2x.png"
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -6091,14 +6091,14 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
case SP_TitleBarNormalButton:
case SP_TitleBarCloseButton: {
QIcon titleBarIcon;
if (standardIcon == SP_TitleBarCloseButton) {
titleBarIcon.addFile(QStringLiteral(":/qt-project.org/styles/macstyle/images/closedock-macstyle-16.png"));
titleBarIcon.addFile(QStringLiteral(":/qt-project.org/styles/macstyle/images/closedock-down-macstyle-16.png"),
QSize(16, 16), QIcon::Normal, QIcon::On);
} else {
titleBarIcon.addFile(QStringLiteral(":/qt-project.org/styles/macstyle/images/dockdock-macstyle-16.png"));
titleBarIcon.addFile(QStringLiteral(":/qt-project.org/styles/macstyle/images/dockdock-down-macstyle-16.png"),
QSize(16, 16), QIcon::Normal, QIcon::On);
QString prefix = standardIcon == SP_TitleBarCloseButton
? QStringLiteral(":/qt-project.org/styles/macstyle/images/closedock-")
: QStringLiteral(":/qt-project.org/styles/macstyle/images/dockdock-");
for (const auto size : dockTitleIconSizes) {
titleBarIcon.addFile(prefix + QStringLiteral("macstyle-") + QString::number(size) + iconPngSuffix(),
QSize(size, size), QIcon::Normal, QIcon::Off);
titleBarIcon.addFile(prefix + QStringLiteral("down-macstyle-") + QString::number(size) + iconPngSuffix(),
QSize(size, size), QIcon::Normal, QIcon::On);
}
return titleBarIcon;
}