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

