qt5-qtwayland/0045-Client-support-high-dpi-mode-for-window-icon.patch
Jan Grulich 1d0bf7d1b2 5.15.8
2023-01-05 17:03:30 +01:00

43 lines
1.7 KiB
Diff

From 1c4a808a3e81aa498da00b88d1ada8b40465d0f8 Mon Sep 17 00:00:00 2001
From: Liang Qi <liang.qi@qt.io>
Date: Mon, 13 Dec 2021 13:01:59 +0100
Subject: [PATCH 45/57] 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 <davidedmundson@kde.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(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.39.0