Skip to content

Commit

Permalink
Fix DPI view error bug. issue #24
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackINT3 committed Oct 29, 2020
1 parent a52b125 commit d755d50
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 38 deletions.
8 changes: 6 additions & 2 deletions src/OpenArk/common/qt-wrapper/qt-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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();
}
Expand Down
4 changes: 4 additions & 0 deletions src/OpenArk/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
13 changes: 0 additions & 13 deletions src/OpenArk/ui/coderkit.ui
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -107,7 +106,6 @@
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -127,7 +125,6 @@
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -147,7 +144,6 @@
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -167,7 +163,6 @@
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -187,7 +182,6 @@
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -207,7 +201,6 @@
<widget class="QLabel" name="label_8">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -227,7 +220,6 @@
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -247,7 +239,6 @@
<widget class="QLabel" name="label_10">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -267,7 +258,6 @@
<widget class="QLabel" name="label_11">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -287,7 +277,6 @@
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -307,7 +296,6 @@
<widget class="QLabel" name="label_13">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand Down Expand Up @@ -393,7 +381,6 @@
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand Down
12 changes: 1 addition & 11 deletions src/OpenArk/ui/kernel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<enum>QTabWidget::West</enum>
</property>
<property name="currentIndex">
<number>3</number>
<number>2</number>
</property>
<widget class="QWidget" name="tabKernelEntry">
<attribute name="title">
Expand Down Expand Up @@ -504,11 +504,6 @@
</property>
<item>
<widget class="QTreeView" name="notifyView">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="indentation">
<number>5</number>
</property>
Expand All @@ -535,11 +530,6 @@
</property>
<item>
<widget class="QTreeView" name="hotkeyView">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="indentation">
<number>5</number>
</property>
Expand Down
1 change: 0 additions & 1 deletion src/OpenArk/ui/openark.ui
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ p, li { white-space: pre-wrap; }
<property name="font">
<font>
<family>Agency FB</family>
<pointsize>20</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand Down
5 changes: 0 additions & 5 deletions src/OpenArk/ui/process-mgr.ui
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
Expand Down
6 changes: 0 additions & 6 deletions src/OpenArk/ui/scanner.ui
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -380,7 +379,6 @@
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -403,7 +401,6 @@
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand Down Expand Up @@ -436,7 +433,6 @@
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand Down Expand Up @@ -479,7 +475,6 @@
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand All @@ -502,7 +497,6 @@
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
Expand Down

0 comments on commit d755d50

Please sign in to comment.