!23 use attribute of UseHighDpiPixmaps

From: @tanyulong2021 
Reviewed-by: @peijiankang 
Signed-off-by: @peijiankang
This commit is contained in:
openeuler-ci-bot 2022-08-01 04:28:17 +00:00 committed by Gitee
commit 28c2d2e752
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 58 additions and 1 deletions

View File

@ -0,0 +1,52 @@
From 0f9030a77dff75728f128eefec435560e9214622 Mon Sep 17 00:00:00 2001
From: tanyulong2021 <tanyulong@kylinos.cn>
Date: Mon, 1 Aug 2022 11:35:39 +0800
Subject: [PATCH] use attribute of UseHighDpiPixmaps
---
debian/control | 1 +
ukui-power-manager-tray/main.cpp | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/debian/control b/debian/control
index 66d8c43..07a72c5 100644
--- a/debian/control
+++ b/debian/control
@@ -28,6 +28,7 @@ Build-Depends: debhelper-compat (= 12),
libqt5charts5-dev,
libqt5x11extras5-dev,
libgsettings-qt-dev,
+ libkf5windowsystem-dev,
Standards-Version: 4.5.0
Rules-Requires-Root: no
Homepage: http://www.ukui.org/
diff --git a/ukui-power-manager-tray/main.cpp b/ukui-power-manager-tray/main.cpp
index 349c8e4..d6ad7cf 100644
--- a/ukui-power-manager-tray/main.cpp
+++ b/ukui-power-manager-tray/main.cpp
@@ -21,6 +21,7 @@
#include <QSharedMemory>
#include <QDebug>
#include <QTranslator>
+#include <QDesktopWidget>
int main(int argc, char *argv[])
{
@@ -46,6 +47,14 @@ int main(int argc, char *argv[])
qWarning()<<QStringLiteral("program is already running! exit!");
exit(0);
}
+
+ if(QApplication::desktop()->width()>=2560){
+ #if(QT_VERSION >= QT_VERSION_CHECK(5,6,0))
+ QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+ #endif
+ }
+
QString locale = QLocale::system().name();
QTranslator translator;
QString qmfile = QString(":/%1.qm").arg(locale);
--
2.33.0

View File

@ -1,7 +1,7 @@
%define debug_package %{nil}
Name: ukui-power-manager
Version: 2.0.3
Release: 11
Release: 12
Summary: power management tool for the UKUI desktop
License: GPL-2.0-or-later and LGPL-2.0-or-later
URL: http://www.ukui.org
@ -9,6 +9,7 @@ Source0: %{name}-%{version}.tar.gz
Patch0: 0001-Update-change-control-copyright-and-fix-the-spelling.patch
Patch1: 0002-log-printing-error-correction.patch
Patch2: 0003-delete-power-statistics-directory.patch
Patch3: 0004-use-attribute-of-UseHighDpiPixmaps.patch
BuildRequires: qt5-qtbase-devel,intltool,libcanberra-devel,dbus-glib-devel,libgcrypt-devel,glib2-devel,gtk3-devel,libnotify-devel,libtool, libtool-ltdl,upower-devel,libwnck3-devel,libX11-devel,libXext-devel,perl-XML-Parser,libXrandr-devel,pkg-config,xmlto,yelp-tools,qt5-qtcharts-devel,qt5-qtx11extras-devel,gsettings-qt-devel, gnome-keyring, libgnome-keyring-devel
BuildRequires:mate-common >= 1.18
@ -48,6 +49,7 @@ This package contains the architecture independent files.
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
./autogen.sh --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 -enable-introspection --enable-compile-warnings=yes --enable-egl-device --enable-wayland --enable-native-backend
@ -440,6 +442,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Aug 01 2022 tanyulong<tanyulong@kylinos.cn> - 2.0.3-12
- use attribute of UseHighDpiPixmaps
* Mon Aug 01 2022 tanyulong<tanyulong@kylinos.cn> - 2.0.3-11
- delete power statistics directory