From d755d50fbf53edf90bb02b4abf03218975a55532 Mon Sep 17 00:00:00 2001 From: BlackINT3 Date: Fri, 30 Oct 2020 00:37:43 +0800 Subject: [PATCH] Fix DPI view error bug. issue #24 --- src/OpenArk/common/qt-wrapper/qt-wrapper.cpp | 8 ++++++-- src/OpenArk/main.cpp | 4 ++++ src/OpenArk/ui/coderkit.ui | 13 ------------- src/OpenArk/ui/kernel.ui | 12 +----------- src/OpenArk/ui/openark.ui | 1 - src/OpenArk/ui/process-mgr.ui | 5 ----- src/OpenArk/ui/scanner.ui | 6 ------ 7 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/OpenArk/common/qt-wrapper/qt-wrapper.cpp b/src/OpenArk/common/qt-wrapper/qt-wrapper.cpp index 6af28e4..17dc63d 100644 --- a/src/OpenArk/common/qt-wrapper/qt-wrapper.cpp +++ b/src/OpenArk/common/qt-wrapper/qt-wrapper.cpp @@ -50,7 +50,9 @@ void OpenArkTabStyle::drawControl(ControlElement element, const QStyleOption *op painter->setPen(0x00868b); QTextOption option; option.setAlignment(Qt::AlignCenter); - painter->setFont(QFont("", 11, QFont::Bold)); + QFont font = QFont("Microsoft YaHei", 11, QFont::Bold); + font.setPixelSize(15); + painter->setFont(font); painter->drawText(rect, tabopt->text, option); painter->restore(); } else { @@ -66,7 +68,9 @@ void OpenArkTabStyle::drawControl(ControlElement element, const QStyleOption *op painter->save(); QTextOption option; option.setAlignment(Qt::AlignCenter); - painter->setFont(QFont("", 11)); + QFont font = QFont("Microsoft YaHei", 11); + font.setPixelSize(15); + painter->setFont(font); painter->drawText(rect, tabopt->text, option); painter->restore(); } diff --git a/src/OpenArk/main.cpp b/src/OpenArk/main.cpp index aeedd5c..f53def9 100644 --- a/src/OpenArk/main.cpp +++ b/src/OpenArk/main.cpp @@ -37,6 +37,10 @@ int OpenArkInit(int argc, char *argv[]) app = new QApplication(argc, argv); app->setWindowIcon(QIcon(":/OpenArk/OpenArk.ico")); app_tr = new QTranslator(); + QFont font = qApp->font(); + font.setPixelSize(12); + font.setFamily("Microsoft YaHei"); + qApp->setFont(font); OpenArkConfig::Instance()->Init(); OpenArkLanguage::Instance()->ChangeLanguage(OpenArkConfig::Instance()->GetLang(CONF_GET)); diff --git a/src/OpenArk/ui/coderkit.ui b/src/OpenArk/ui/coderkit.ui index 0f9c3fe..93d2b6c 100644 --- a/src/OpenArk/ui/coderkit.ui +++ b/src/OpenArk/ui/coderkit.ui @@ -87,7 +87,6 @@ - 10 75 true @@ -107,7 +106,6 @@ - 10 75 true @@ -127,7 +125,6 @@ - 10 75 true @@ -147,7 +144,6 @@ - 10 75 true @@ -167,7 +163,6 @@ - 10 75 true @@ -187,7 +182,6 @@ - 10 75 true @@ -207,7 +201,6 @@ - 10 75 true @@ -227,7 +220,6 @@ - 10 75 true @@ -247,7 +239,6 @@ - 10 75 true @@ -267,7 +258,6 @@ - 10 75 true @@ -287,7 +277,6 @@ - 10 75 true @@ -307,7 +296,6 @@ - 10 75 true @@ -393,7 +381,6 @@ - 10 75 true diff --git a/src/OpenArk/ui/kernel.ui b/src/OpenArk/ui/kernel.ui index baa001b..7cdd76b 100644 --- a/src/OpenArk/ui/kernel.ui +++ b/src/OpenArk/ui/kernel.ui @@ -38,7 +38,7 @@ QTabWidget::West - 3 + 2 @@ -504,11 +504,6 @@ - - - 9 - - 5 @@ -535,11 +530,6 @@ - - - 9 - - 5 diff --git a/src/OpenArk/ui/openark.ui b/src/OpenArk/ui/openark.ui index 17bad12..7629bb5 100644 --- a/src/OpenArk/ui/openark.ui +++ b/src/OpenArk/ui/openark.ui @@ -344,7 +344,6 @@ p, li { white-space: pre-wrap; } Agency FB - 20 75 true diff --git a/src/OpenArk/ui/process-mgr.ui b/src/OpenArk/ui/process-mgr.ui index 03c159e..c8e089f 100644 --- a/src/OpenArk/ui/process-mgr.ui +++ b/src/OpenArk/ui/process-mgr.ui @@ -45,11 +45,6 @@ 0 - - - 9 - - QAbstractItemView::NoEditTriggers diff --git a/src/OpenArk/ui/scanner.ui b/src/OpenArk/ui/scanner.ui index 93a2b66..001ff00 100644 --- a/src/OpenArk/ui/scanner.ui +++ b/src/OpenArk/ui/scanner.ui @@ -357,7 +357,6 @@ - 10 75 true @@ -380,7 +379,6 @@ - 10 75 true @@ -403,7 +401,6 @@ - 10 75 true @@ -436,7 +433,6 @@ - 10 75 true @@ -479,7 +475,6 @@ - 10 75 true @@ -502,7 +497,6 @@ - 10 75 true