From d325e306c43c4a2b1e580bc153974ebe567707bd Mon Sep 17 00:00:00 2001 From: Aaron Tan Date: Fri, 30 Aug 2019 18:46:33 -0400 Subject: [PATCH] 2018-08-28 Release Commit - This commit adds stuff to build the 2019-08-28 release. - Windows files, Windows layout bugs. - Bump version numbers in Linux and macOS. - Fix building for AppImages on Linux. Squashed commit of the following: commit 1359f443a1eed64ab1d2058e017444cdbc57eafa Author: Aaron Tan Date: Fri Aug 30 18:43:17 2019 -0400 Bump version number on Linux - Bumps version number for .deb building. commit a54023d39e9aeae09363157b28ff2eaba0b39efd Author: Aaron Tan Date: Fri Aug 30 18:38:25 2019 -0400 Fix Windows layout bug... again - Something changed and the last fix didn't work. Change so that every time the header widget's font is changed, it recalculates the width needed for the JP/PY labels. commit 06675cdb3f52bc29e9b459155beb1f696ea9f8a5 Author: Aaron Tan Date: Fri Aug 30 00:22:43 2019 -0500 Fix analytics PRODUCT_ID - Before, was relying on environment variable, which I didn't realize had to be set on every system that the application was installed on. Now, just define it in a config file. commit c34a8754a16fd0f1f477baf05cf79202f1df264f Author: Aaron Tan Date: Fri Aug 30 00:19:20 2019 -0500 Add 64-bit versions of build files for Windows commit ac2baf64ec46c76c6854af17e5cf78797f5cf0ba Author: Aaron Tan Date: Thu Aug 29 23:18:53 2019 -0400 Bump version number in macOS Info.plist --- .../components/entryheaderwidget.cpp | 11 + src/jyut-dict/components/entryheaderwidget.h | 5 +- src/jyut-dict/jyut-dict.pro | 1 + src/jyut-dict/logic/analytics/analytics.h | 3 +- .../logic/analytics/analyticsconfig.h | 6 + .../logic/database/sqldatabasemanager.cpp | 7 +- .../logic/settings/settingsutils.cpp | 4 +- src/jyut-dict/main.cpp | 4 + src/jyut-dict/platform/linux/create-deb.sh | 14 +- src/jyut-dict/platform/linux/debian/changelog | 7 +- src/jyut-dict/platform/linux/debian/files | 6 +- .../platform/linux/jyut-dict.desktop | 1 - src/jyut-dict/platform/mac/Info.plist | 2 +- .../32-bit/en/Jyut Dictionary (32-bit).aip | 122 +++++----- .../32-bit/fr/Jyut Dictionary (32-bit) fr.aip | 12 +- .../Jyut Dictionary (32-bit) yue_CN.aip | 12 +- .../yue/Jyut Dictionary (32-bit) zh_HK.aip | 12 +- .../zh-TW/Jyut Dictionary (32-bit) zh_TW.aip | 12 +- .../zh/Jyut Dictionary (32-bit) zh_CN.aip | 12 +- .../{ => en}/Jyut Dictionary (64-bit).aip | 123 +++++----- .../64-bit/fr/Jyut Dictionary (64-bit) fr.aip | 227 ++++++++++++++++++ .../Jyut Dictionary (64-bit) yue_CN.aip | 224 +++++++++++++++++ .../yue/Jyut Dictionary (64-bit) zh_HK.aip | 224 +++++++++++++++++ .../zh-TW/Jyut Dictionary (64-bit) zh_TW.aip | 224 +++++++++++++++++ .../zh/Jyut Dictionary (64-bit) zh_CN.aip | 224 +++++++++++++++++ src/jyut-dict/windows/mainwindow.cpp | 8 +- 26 files changed, 1339 insertions(+), 168 deletions(-) create mode 100644 src/jyut-dict/logic/analytics/analyticsconfig.h rename src/jyut-dict/platform/windows/64-bit/{ => en}/Jyut Dictionary (64-bit).aip (67%) create mode 100644 src/jyut-dict/platform/windows/64-bit/fr/Jyut Dictionary (64-bit) fr.aip create mode 100644 src/jyut-dict/platform/windows/64-bit/yue-CN/Jyut Dictionary (64-bit) yue_CN.aip create mode 100644 src/jyut-dict/platform/windows/64-bit/yue/Jyut Dictionary (64-bit) zh_HK.aip create mode 100644 src/jyut-dict/platform/windows/64-bit/zh-TW/Jyut Dictionary (64-bit) zh_TW.aip create mode 100644 src/jyut-dict/platform/windows/64-bit/zh/Jyut Dictionary (64-bit) zh_CN.aip diff --git a/src/jyut-dict/components/entryheaderwidget.cpp b/src/jyut-dict/components/entryheaderwidget.cpp index c710d3c6..65370514 100644 --- a/src/jyut-dict/components/entryheaderwidget.cpp +++ b/src/jyut-dict/components/entryheaderwidget.cpp @@ -47,6 +47,17 @@ EntryHeaderWidget::~EntryHeaderWidget() } +void EntryHeaderWidget::changeEvent(QEvent *event) +{ +#ifdef Q_OS_WIN + if (event->type() == QEvent::FontChange) { + _jyutpingLabel->setFixedWidth(_jyutpingLabel->fontMetrics().boundingRect("JP").width()); + _pinyinLabel->setFixedWidth(_pinyinLabel->fontMetrics().boundingRect("PY").width()); + } +#endif + QWidget::changeEvent(event); +} + void EntryHeaderWidget::setEntry(const Entry &entry) { _jyutpingLabel->setVisible(true); diff --git a/src/jyut-dict/components/entryheaderwidget.h b/src/jyut-dict/components/entryheaderwidget.h index 726aca73..e2d3931e 100644 --- a/src/jyut-dict/components/entryheaderwidget.h +++ b/src/jyut-dict/components/entryheaderwidget.h @@ -4,6 +4,7 @@ #include "logic/entry/entry.h" #include "logic/entry/entryphoneticoptions.h" +#include #include #include #include @@ -17,7 +18,9 @@ class EntryHeaderWidget : public QWidget { public: explicit EntryHeaderWidget(QWidget *parent = nullptr); - ~EntryHeaderWidget(); + ~EntryHeaderWidget() override; + + void changeEvent(QEvent *event) override; void setEntry(const Entry &entry); void setEntry(std::string word, std::string jyutping, std::string pinyin); diff --git a/src/jyut-dict/jyut-dict.pro b/src/jyut-dict/jyut-dict.pro index 6a7c4a5c..54f8470f 100644 --- a/src/jyut-dict/jyut-dict.pro +++ b/src/jyut-dict/jyut-dict.pro @@ -95,6 +95,7 @@ HEADERS += \ components/searchoptionsradiogroupbox.h \ components/settingstab.h \ logic/analytics/analytics.h \ + logic/analytics/analyticsconfig.h \ logic/database/sqldatabasemanager.h \ logic/database/sqldatabaseutils.h \ logic/dictionary/dictionarymetadata.h \ diff --git a/src/jyut-dict/logic/analytics/analytics.h b/src/jyut-dict/logic/analytics/analytics.h index b79e58dc..5416bc92 100644 --- a/src/jyut-dict/logic/analytics/analytics.h +++ b/src/jyut-dict/logic/analytics/analytics.h @@ -1,6 +1,8 @@ #ifndef ANALYTICS_H #define ANALYTICS_H +#include "logic/analytics/analyticsconfig.h" + #include #include #include @@ -11,7 +13,6 @@ // using the event API. constexpr auto ANALYTICS_URL = "https://www.google-analytics.com/collect"; -const auto PROPERTY_ID = qEnvironmentVariable("PROPERTY_ID"); class Analytics : public QObject { diff --git a/src/jyut-dict/logic/analytics/analyticsconfig.h b/src/jyut-dict/logic/analytics/analyticsconfig.h new file mode 100644 index 00000000..d5494aa3 --- /dev/null +++ b/src/jyut-dict/logic/analytics/analyticsconfig.h @@ -0,0 +1,6 @@ +#ifndef ANALYTICSCONFIG_H +#define ANALYTICSCONFIG_H + +constexpr auto PROPERTY_ID = ""; + +#endif // ANALYTICSCONFIG_H diff --git a/src/jyut-dict/logic/database/sqldatabasemanager.cpp b/src/jyut-dict/logic/database/sqldatabasemanager.cpp index 6436bd6b..462e57e9 100644 --- a/src/jyut-dict/logic/database/sqldatabasemanager.cpp +++ b/src/jyut-dict/logic/database/sqldatabasemanager.cpp @@ -59,7 +59,12 @@ bool SQLDatabaseManager::openDatabase() QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/Dictionaries/dict.db"}; #else - QFileInfo bundleFile{QCoreApplication::applicationDirPath() + "/dict.db"}; +#ifdef APPIMAGE + QFileInfo bundleFile{QCoreApplication::applicationDirPath() + + "/../share/jyut-dict/dictionaries/dict.db"}; +#else + QFileInfo bundleFile{"/usr/share/jyut-dict/dictionaries/dict.db"}; +#endif QFileInfo localFile{ QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/dictionaries/dict.db"}; diff --git a/src/jyut-dict/logic/settings/settingsutils.cpp b/src/jyut-dict/logic/settings/settingsutils.cpp index d5847377..c22e8b44 100644 --- a/src/jyut-dict/logic/settings/settingsutils.cpp +++ b/src/jyut-dict/logic/settings/settingsutils.cpp @@ -76,7 +76,9 @@ bool isCurrentLocaleHan() { return currentLocale.script() == QLocale::HanScript || currentLocale.script() == QLocale::SimplifiedHanScript - || currentLocale.script() == QLocale::TraditionalHanScript; + || currentLocale.script() == QLocale::TraditionalHanScript + || currentLocale.language() == QLocale::Chinese + || currentLocale.language() == QLocale::Cantonese; } bool isCurrentLocaleTraditionalHan() { diff --git a/src/jyut-dict/main.cpp b/src/jyut-dict/main.cpp index c1487380..e2c4793f 100644 --- a/src/jyut-dict/main.cpp +++ b/src/jyut-dict/main.cpp @@ -6,7 +6,11 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("Aaron Tan"); QCoreApplication::setOrganizationDomain("aaronhktan.com"); +#ifdef APPIMAGE + QCoreApplication::setApplicationName("Jyut Dictionary"); +#else QCoreApplication::setApplicationName("CantoneseDictionary"); +#endif qRegisterMetaType("EntryCharactersOptions"); qRegisterMetaTypeStreamOperators("EntryCharactersOptions"); diff --git a/src/jyut-dict/platform/linux/create-deb.sh b/src/jyut-dict/platform/linux/create-deb.sh index 65184050..a644683c 100755 --- a/src/jyut-dict/platform/linux/create-deb.sh +++ b/src/jyut-dict/platform/linux/create-deb.sh @@ -2,22 +2,22 @@ cd ../.. -tar -cvzf ../jyut-dict_0.19.0614.tar.gz * --overwrite +tar -cvzf ../jyut-dict_0.19.0828.tar.gz * --overwrite cd ../ -rm -rf jyut-dict_0.19.0614 -mkdir jyut-dict_0.19.0614 +rm -rf jyut-dict_0.19.0828 +mkdir jyut-dict_0.19.0828 -cd jyut-dict_0.19.0614 +cd jyut-dict_0.19.0828 -tar -xvzf ../jyut-dict_0.19.0614.tar.gz --overwrite +tar -xvzf ../jyut-dict_0.19.0828.tar.gz --overwrite cp -r ../jyut-dict/platform/linux/debian ./debian -rm ./eng.db +rm ./dict.db rm ./jyut-dict -dh_make -c mit -s -f ../jyut-dict_0.19.0614.tar.gz -p jyut-dict_0.19.0614 +dh_make -c mit -s -f ../jyut-dict_0.19.0828.tar.gz -p jyut-dict_0.19.0828 debuild \ No newline at end of file diff --git a/src/jyut-dict/platform/linux/debian/changelog b/src/jyut-dict/platform/linux/debian/changelog index fdb3b099..fd9638ce 100644 --- a/src/jyut-dict/platform/linux/debian/changelog +++ b/src/jyut-dict/platform/linux/debian/changelog @@ -1,5 +1,8 @@ -jyut-dict (0.19.0614-1) bionic; urgency=medium +jyut-dict (0.19.0828-1) bionic; urgency=medium - * Initial release + * New version! + * Add ability to change settings. + * Localized! + * Lots of bug fixes. -- Aaron Tan Fri, 14 Jun 2019 00:48:23 -0400 diff --git a/src/jyut-dict/platform/linux/debian/files b/src/jyut-dict/platform/linux/debian/files index bd51434a..5f39929b 100644 --- a/src/jyut-dict/platform/linux/debian/files +++ b/src/jyut-dict/platform/linux/debian/files @@ -1,3 +1,3 @@ -jyut-dict-dbgsym_0.19.0614-1_amd64.ddeb debug optional -jyut-dict_0.19.0614-1_amd64.buildinfo utils optional -jyut-dict_0.19.0614-1_amd64.deb utils optional +jyut-dict-dbgsym_0.19.0828-1_amd64.ddeb debug optional +jyut-dict_0.19.0828-1_amd64.buildinfo utils optional +jyut-dict_0.19.0828-1_amd64.deb utils optional diff --git a/src/jyut-dict/platform/linux/jyut-dict.desktop b/src/jyut-dict/platform/linux/jyut-dict.desktop index 47427060..a5593383 100644 --- a/src/jyut-dict/platform/linux/jyut-dict.desktop +++ b/src/jyut-dict/platform/linux/jyut-dict.desktop @@ -1,5 +1,4 @@ [Desktop Entry] -Version=0.19.0614 Type=Application Name=Jyut Dictionary Name[fr]=Dictionnaire Jyut diff --git a/src/jyut-dict/platform/mac/Info.plist b/src/jyut-dict/platform/mac/Info.plist index 940f2eec..e05f7f43 100644 --- a/src/jyut-dict/platform/mac/Info.plist +++ b/src/jyut-dict/platform/mac/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.19.0614-alpha + 0.19.0828 LSMinimumSystemVersion 10.12 LSBackgroundOnly diff --git a/src/jyut-dict/platform/windows/32-bit/en/Jyut Dictionary (32-bit).aip b/src/jyut-dict/platform/windows/32-bit/en/Jyut Dictionary (32-bit).aip index e0bc0e32..a06787e8 100644 --- a/src/jyut-dict/platform/windows/32-bit/en/Jyut Dictionary (32-bit).aip +++ b/src/jyut-dict/platform/windows/32-bit/en/Jyut Dictionary (32-bit).aip @@ -9,14 +9,14 @@ - + - + @@ -43,67 +43,71 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -175,7 +179,7 @@ - + @@ -206,7 +210,7 @@ - + diff --git a/src/jyut-dict/platform/windows/32-bit/fr/Jyut Dictionary (32-bit) fr.aip b/src/jyut-dict/platform/windows/32-bit/fr/Jyut Dictionary (32-bit) fr.aip index cf1d2a96..5568bba2 100644 --- a/src/jyut-dict/platform/windows/32-bit/fr/Jyut Dictionary (32-bit) fr.aip +++ b/src/jyut-dict/platform/windows/32-bit/fr/Jyut Dictionary (32-bit) fr.aip @@ -16,7 +16,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -72,14 +72,14 @@ - - + + - + diff --git a/src/jyut-dict/platform/windows/32-bit/yue-CN/Jyut Dictionary (32-bit) yue_CN.aip b/src/jyut-dict/platform/windows/32-bit/yue-CN/Jyut Dictionary (32-bit) yue_CN.aip index e95903ef..dfed1dff 100644 --- a/src/jyut-dict/platform/windows/32-bit/yue-CN/Jyut Dictionary (32-bit) yue_CN.aip +++ b/src/jyut-dict/platform/windows/32-bit/yue-CN/Jyut Dictionary (32-bit) yue_CN.aip @@ -16,7 +16,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -72,14 +72,14 @@ - - + + - + diff --git a/src/jyut-dict/platform/windows/32-bit/yue/Jyut Dictionary (32-bit) zh_HK.aip b/src/jyut-dict/platform/windows/32-bit/yue/Jyut Dictionary (32-bit) zh_HK.aip index 55c7eb27..0b9dcc9b 100644 --- a/src/jyut-dict/platform/windows/32-bit/yue/Jyut Dictionary (32-bit) zh_HK.aip +++ b/src/jyut-dict/platform/windows/32-bit/yue/Jyut Dictionary (32-bit) zh_HK.aip @@ -16,7 +16,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -72,14 +72,14 @@ - - + + - + diff --git a/src/jyut-dict/platform/windows/32-bit/zh-TW/Jyut Dictionary (32-bit) zh_TW.aip b/src/jyut-dict/platform/windows/32-bit/zh-TW/Jyut Dictionary (32-bit) zh_TW.aip index ee9af582..7ac36564 100644 --- a/src/jyut-dict/platform/windows/32-bit/zh-TW/Jyut Dictionary (32-bit) zh_TW.aip +++ b/src/jyut-dict/platform/windows/32-bit/zh-TW/Jyut Dictionary (32-bit) zh_TW.aip @@ -16,7 +16,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -72,14 +72,14 @@ - - + + - + diff --git a/src/jyut-dict/platform/windows/32-bit/zh/Jyut Dictionary (32-bit) zh_CN.aip b/src/jyut-dict/platform/windows/32-bit/zh/Jyut Dictionary (32-bit) zh_CN.aip index c04eddff..96405af3 100644 --- a/src/jyut-dict/platform/windows/32-bit/zh/Jyut Dictionary (32-bit) zh_CN.aip +++ b/src/jyut-dict/platform/windows/32-bit/zh/Jyut Dictionary (32-bit) zh_CN.aip @@ -16,7 +16,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -72,14 +72,14 @@ - - + + - + diff --git a/src/jyut-dict/platform/windows/64-bit/Jyut Dictionary (64-bit).aip b/src/jyut-dict/platform/windows/64-bit/en/Jyut Dictionary (64-bit).aip similarity index 67% rename from src/jyut-dict/platform/windows/64-bit/Jyut Dictionary (64-bit).aip rename to src/jyut-dict/platform/windows/64-bit/en/Jyut Dictionary (64-bit).aip index c06563e8..dd602b1c 100644 --- a/src/jyut-dict/platform/windows/64-bit/Jyut Dictionary (64-bit).aip +++ b/src/jyut-dict/platform/windows/64-bit/en/Jyut Dictionary (64-bit).aip @@ -9,7 +9,7 @@ - + @@ -17,8 +17,7 @@ - - + @@ -45,67 +44,71 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -178,7 +181,7 @@ - + @@ -209,7 +212,7 @@ - + diff --git a/src/jyut-dict/platform/windows/64-bit/fr/Jyut Dictionary (64-bit) fr.aip b/src/jyut-dict/platform/windows/64-bit/fr/Jyut Dictionary (64-bit) fr.aip new file mode 100644 index 00000000..9567271d --- /dev/null +++ b/src/jyut-dict/platform/windows/64-bit/fr/Jyut Dictionary (64-bit) fr.aip @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jyut-dict/platform/windows/64-bit/yue-CN/Jyut Dictionary (64-bit) yue_CN.aip b/src/jyut-dict/platform/windows/64-bit/yue-CN/Jyut Dictionary (64-bit) yue_CN.aip new file mode 100644 index 00000000..ab2468c2 --- /dev/null +++ b/src/jyut-dict/platform/windows/64-bit/yue-CN/Jyut Dictionary (64-bit) yue_CN.aip @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jyut-dict/platform/windows/64-bit/yue/Jyut Dictionary (64-bit) zh_HK.aip b/src/jyut-dict/platform/windows/64-bit/yue/Jyut Dictionary (64-bit) zh_HK.aip new file mode 100644 index 00000000..325c4897 --- /dev/null +++ b/src/jyut-dict/platform/windows/64-bit/yue/Jyut Dictionary (64-bit) zh_HK.aip @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jyut-dict/platform/windows/64-bit/zh-TW/Jyut Dictionary (64-bit) zh_TW.aip b/src/jyut-dict/platform/windows/64-bit/zh-TW/Jyut Dictionary (64-bit) zh_TW.aip new file mode 100644 index 00000000..93142c8c --- /dev/null +++ b/src/jyut-dict/platform/windows/64-bit/zh-TW/Jyut Dictionary (64-bit) zh_TW.aip @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jyut-dict/platform/windows/64-bit/zh/Jyut Dictionary (64-bit) zh_CN.aip b/src/jyut-dict/platform/windows/64-bit/zh/Jyut Dictionary (64-bit) zh_CN.aip new file mode 100644 index 00000000..07421982 --- /dev/null +++ b/src/jyut-dict/platform/windows/64-bit/zh/Jyut Dictionary (64-bit) zh_CN.aip @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jyut-dict/windows/mainwindow.cpp b/src/jyut-dict/windows/mainwindow.cpp index 76baa363..c026ecf0 100644 --- a/src/jyut-dict/windows/mainwindow.cpp +++ b/src/jyut-dict/windows/mainwindow.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -96,6 +97,9 @@ MainWindow::MainWindow(QWidget *parent) : _mainToolBar = new MainToolBar{_manager, this}; addToolBar(_mainToolBar); setUnifiedTitleAndToolBarOnMac(true); +#ifdef APPIMAGE + setWindowIcon(QIcon{":/images/icon.png"}); +#endif _mainSplitter = new MainSplitter{this}; setCentralWidget(_mainSplitter); @@ -242,9 +246,11 @@ void MainWindow::translateUI() font = QFont{"Microsoft Jhenghei", 10}; } else if (Settings::isCurrentLocaleSimplifiedHan()) { font = QFont{"Microsoft YaHei", 10}; + } else if (Settings::isCurrentLocaleHan()) { + font = QFont{"Microsoft YaHei", 10}; } else { font = QFont{"Segoe UI", 10}; - } + } font.setStyleHint(QFont::System, QFont::PreferAntialias); qApp->setFont(font); foreach (QWidget *widget, QApplication::allWidgets()) {