From fe769d590feb3391c8c172af5fb1d1cb97b46239 Mon Sep 17 00:00:00 2001 From: kaniol-lck <375520360@qq.com> Date: Wed, 2 Mar 2022 14:37:25 +0800 Subject: [PATCH] stylesheet settings & tweak preferences shortcut --- Changelog.md | 20 ++++++++++++++++++++ src/ui/modmanager.cpp | 9 +++++++-- src/ui/modmanager.ui | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index ee53fa3d..0afd5f77 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,26 @@ ## 正式发布 Release +### v1.1.0 + +*2022.03.02* + +Stylesheets can be customized under app config directory. +样式表可以在应用配置目录下自定义。 + +Changed shortcut of prefereneces to `ctrl + ,` . +将偏好设置的快捷键更改为了`ctrl + ,` 。 + +Tweaks on frameless UI: +无边框界面上的修改: + +- Window title is at center now. + 窗口标题现在是居中的了。 +- Fixed window resize handler. + 修复了窗口缩放的控制。 +- Added system menu on app icon. + 在应用图标上添加了系统菜单。 + ### v1.0.5 *2022.02.18* diff --git a/src/ui/modmanager.cpp b/src/ui/modmanager.cpp index 5b481dc1..0e9e2d02 100644 --- a/src/ui/modmanager.cpp +++ b/src/ui/modmanager.cpp @@ -116,6 +116,7 @@ ModManager::ModManager(QWidget *parent) : mergeMenuBar(); updateUi(); + qApp->setStyleSheet(styleSheetPath(config_.getCustomStyle())); } ModManager::~ModManager() @@ -133,7 +134,6 @@ QMenuBar *ModManager::menuBar() const void ModManager::updateUi() { - qApp->setStyleSheet(styleSheetPath(config_.getCustomStyle())); pageSwitcher_.updateUi(); updateBlur(); } @@ -247,10 +247,15 @@ void ModManager::editLocalPath(int index) void ModManager::on_actionPreferences_triggered() { auto preferences = new Preferences(this); - preferences->exec(); + auto style = config_.getCustomStyle(); + connect(preferences, &Preferences::accepted, this, [=]{ + if(auto afterStyle = config_.getCustomStyle(); afterStyle != style) + qApp->setStyleSheet(styleSheetPath(afterStyle)); + }); connect(preferences, &Preferences::accepted, this, &ModManager::updateUi, Qt::UniqueConnection); connect(preferences, &Preferences::accepted, this, &ModManager::setProxy, Qt::UniqueConnection); connect(preferences, &Preferences::accepted, QAria2::qaria2(), &QAria2::updateOptions, Qt::UniqueConnection); + preferences->exec(); } void ModManager::on_actionManage_Browser_triggered() diff --git a/src/ui/modmanager.ui b/src/ui/modmanager.ui index 1251dc27..0f612ff8 100644 --- a/src/ui/modmanager.ui +++ b/src/ui/modmanager.ui @@ -175,7 +175,7 @@ Preferences - Ctrl+P + Ctrl+,