From 78ccf62673b20111da0579e2a8e0631894099348 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 13 Dec 2021 13:01:59 +0100 Subject: [PATCH 47/49] Client: support high-dpi mode for window icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-90530 Pick-to: 6.3 6.2 5.15 Change-Id: Ib1f36e1cb89352dfac8a385a7b097cfc0226e813 Reviewed-by: David Edmundson Reviewed-by: Tor Arne Vestbø (cherry picked from commit fc91cd6b1306c6d452cbddab3c2289ccb92218d6) --- src/plugins/decorations/bradient/main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp index e75fda3c..fa885143 100644 --- a/src/plugins/decorations/bradient/main.cpp +++ b/src/plugins/decorations/bradient/main.cpp @@ -164,13 +164,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 -- 2.37.3