summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2021-12-13 13:01:59 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-13 16:04:45 +0000
commita023d7cdd588b39bee748af01404f9d9aa3e9f15 (patch)
treec0bd5d2ad9faa60ac5029e6f4e68995b56ef4b9f
parentde5370a78e77aef6d4b43e40608627f371b60351 (diff)
Client: support high-dpi mode for window icon
Fixes: QTBUG-90530 Change-Id: Ib1f36e1cb89352dfac8a385a7b097cfc0226e813 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit fc91cd6b1306c6d452cbddab3c2289ccb92218d6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/decorations/bradient/main.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp
index 5aa9ad4a4..2a32df344 100644
--- a/src/plugins/decorations/bradient/main.cpp
+++ b/src/plugins/decorations/bradient/main.cpp
@@ -168,13 +168,10 @@ void QWaylandBradientDecoration::paint(QPaintDevice *device)
// Window icon
QIcon icon = waylandWindow()->windowIcon();
if (!icon.isNull()) {
- QPixmap pixmap = icon.pixmap(QSize(128, 128));
- QPixmap scaled = pixmap.scaled(22, 22, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-
QRectF iconRect(0, 0, 22, 22);
- p.drawPixmap(iconRect.adjusted(margins().left() + BUTTON_SPACING, 4,
- margins().left() + BUTTON_SPACING, 4),
- scaled, iconRect);
+ iconRect.adjust(margins().left() + BUTTON_SPACING, 4,
+ margins().left() + BUTTON_SPACING, 4),
+ icon.paint(&p, iconRect.toRect());
}
// Window title