From a7597930dee9fd95890666f82372bbc8479381c8 Mon Sep 17 00:00:00 2001 From: RigoLigo Date: Sat, 28 May 2022 21:19:29 +0800 Subject: [PATCH] Improved default interface font --- RedPandaIDE/settings.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 6326b218..99e32e19 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -186,6 +186,7 @@ QString Settings::Dirs::appResourceDir() const #elif defined(Q_OS_LINUX) return includeTrailingPathDelimiter(PREFIX)+"share/"+APP_NAME; #elif defined(Q_OS_MACOS) +// return QApplication::instance()->applicationDirPath(); return ""; #endif } @@ -198,7 +199,7 @@ QString Settings::Dirs::appLibexecDir() const #elif defined(Q_OS_LINUX) return includeTrailingPathDelimiter(PREFIX)+"libexec/"+APP_NAME; #elif defined(Q_OS_MACOS) - return ""; + return QApplication::instance()->applicationDirPath(); #endif } @@ -2835,7 +2836,13 @@ void Settings::Environment::doLoad() QString defaultLocaleName = QLocale::system().name(); if (defaultLocaleName == "zh_CN") { QString fontName; +#ifdef Q_OS_WINDOWS fontName = "Microsoft Yahei"; +#elif defined(Q_OS_MACOS) + fontName = "PingFang SC"; +#elif defined(Q_OS_LINUX) + fontName = "Noto Sans CJK"; +#endif QFont font(fontName); if (font.exactMatch()) { defaultFontName = fontName; @@ -2864,6 +2871,10 @@ void Settings::Environment::doLoad() if (mTerminalPath.isEmpty()) mTerminalPath = stringValue("terminal_path","/usr/bin/x-terminal-emulator"); mAStylePath = includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"astyle"; +#elif defined(Q_OS_MACOS) + mTerminalPath = stringValue("terminal_path", + "/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal"); + mAStylePath = includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"astyle"; #endif mHideNonSupportFilesInFileView=boolValue("hide_non_support_files_file_view",true); mOpenFilesInSingleInstance = boolValue("open_files_in_single_instance",false);