Skip to content

Commit

Permalink
fix styleFont not set for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
cocomeow committed Dec 1, 2021
1 parent b0d0bdc commit 2b0afe7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/SingleApplication.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/qrc.cmake")

# Qt 6.2
find_package(Qt6 6.2 COMPONENTS Gui Core Quick Widgets DBus
find_package(Qt6 6.2 COMPONENTS Gui Core Quick Widgets DBus QuickControls2
Core5Compat Sql LinguistTools Concurrent ToolsTools REQUIRED)

# curl
Expand Down Expand Up @@ -169,6 +169,7 @@ target_link_libraries(across PRIVATE
Qt::Core5Compat
Qt::Sql
Qt::Concurrent
Qt::QuickControls2
CURL::libcurl
fmt::fmt
gRPC::grpc++
Expand Down
34 changes: 17 additions & 17 deletions i18n/across_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1214,55 +1214,55 @@
<context>
<name>across::GroupList</name>
<message>
<location filename="../../../ACross/src/view_models/grouplist.cpp" line="408"/>
<location filename="../../../ACross/src/view_models/grouplist.cpp" line="412"/>
<location filename="../../../ACross/src/view_models/grouplist.cpp" line="429"/>
<location filename="../../../ACross/src/view_models/grouplist.cpp" line="433"/>
<location filename="../src/view_models/grouplist.cpp" line="408"/>
<location filename="../src/view_models/grouplist.cpp" line="412"/>
<location filename="../src/view_models/grouplist.cpp" line="429"/>
<location filename="../src/view_models/grouplist.cpp" line="433"/>
<source>Copy [%1] URL to clipboard</source>
<translation>复制 [%1] 链接到剪贴板</translation>
</message>
</context>
<context>
<name>across::NodeFormModel</name>
<message>
<location filename="../../../ACross/src/view_models/nodeformmodel.cpp" line="446"/>
<location filename="../src/view_models/nodeformmodel.cpp" line="446"/>
<source>custom configuration encoding to url is not supported</source>
<translation>未支持自定义配置编码到链接格式</translation>
</message>
</context>
<context>
<name>across::NodeList</name>
<message>
<location filename="../../../ACross/src/view_models/nodelist.cpp" line="342"/>
<location filename="../src/view_models/nodelist.cpp" line="342"/>
<source>Copy [%1] URL to clipboard</source>
<translation>复制 [%1] 链接到剪贴板</translation>
</message>
</context>
<context>
<name>across::SystemTray</name>
<message>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="149"/>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="169"/>
<location filename="../src/view_models/systemtray.cpp" line="149"/>
<location filename="../src/view_models/systemtray.cpp" line="169"/>
<source>Show</source>
<translation>显示</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="170"/>
<location filename="../src/view_models/systemtray.cpp" line="170"/>
<source>Connect</source>
<translation>连接</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="171"/>
<location filename="../src/view_models/systemtray.cpp" line="171"/>
<source>Disconnect</source>
<translation>断开</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="172"/>
<location filename="../src/view_models/systemtray.cpp" line="172"/>
<source>Reconnect</source>
<translation>重连</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="173"/>
<location filename="../src/view_models/systemtray.cpp" line="173"/>
<source>Quit</source>
<translation>退出</translation>
</message>
Expand All @@ -1271,25 +1271,25 @@
<translation type="vanished">入站</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="151"/>
<location filename="../src/view_models/systemtray.cpp" line="151"/>
<source>Hide</source>
<translation>隐藏</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/systemtray.cpp" line="181"/>
<location filename="../src/view_models/systemtray.cpp" line="181"/>
<source>OFF</source>
<translation>关闭</translation>
</message>
</context>
<context>
<name>across::setting::ConfigTools</name>
<message>
<location filename="../../../ACross/src/view_models/configtools.cpp" line="1039"/>
<location filename="../src/view_models/configtools.cpp" line="1039"/>
<source>Failed to parse version</source>
<translation>无法解析版本</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/configtools.cpp" line="1042"/>
<location filename="../src/view_models/configtools.cpp" line="1042"/>
<source>New Version: v%1</source>
<translation>新版本:v%1</translation>
</message>
Expand All @@ -1298,7 +1298,7 @@
<translation type="vanished">新版本:%1</translation>
</message>
<message>
<location filename="../../../ACross/src/view_models/configtools.cpp" line="1044"/>
<location filename="../src/view_models/configtools.cpp" line="1044"/>
<source>Already the latest version</source>
<translation>已经是最新版本</translation>
</message>
Expand Down
4 changes: 4 additions & 0 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Application::Application(int &argc, char **argv)
setWindowIcon(QIcon(":misc/design/logo.svg"));
setDesktopFileName("org.arktoria.across");

#ifdef Q_OS_MAC
setStyle("Basic"); // fix styleFont not set
#endif

connect(this, &SingleApplication::receivedMessage, this,
&Application::onMessageReceived, Qt::QueuedConnection);
}
Expand Down
1 change: 1 addition & 0 deletions src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <QStringLiteral>
#include <QTranslator>
#include <QUrl>
#include <QtQuickControls2>

#include "singleapplication.h"

Expand Down
2 changes: 1 addition & 1 deletion src/views/home/NodeEditForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Window {
title: qsTr("Edit Configuration")

flags: Qt.platform.os === "windows" ? Qt.Window : Qt.WindowStaysOnTopHint
modality: Qt.ApplicationModal
modality: Qt.platform.os === "osx" ? Qt.NonModal : Qt.ApplicationModal

property var nodeModel: null
property int fontSize: 14
Expand Down
2 changes: 1 addition & 1 deletion src/views/home/NodeShareForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Window {
title: qsTr("Share Configuration")

flags: Qt.platform.os === "windows" ? Qt.Window : Qt.WindowStaysOnTopHint
modality: Qt.ApplicationModal
modality: Qt.platform.os === "osx" ? Qt.NonModal : Qt.ApplicationModal

property var nodeModel: null
property int fontSize: 14
Expand Down

0 comments on commit 2b0afe7

Please sign in to comment.