Skip to content

Commit

Permalink
stylesheet settings & tweak preferences shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
kaniol-lck committed Mar 2, 2022
1 parent a9bb282 commit fe769d5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
20 changes: 20 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
9 changes: 7 additions & 2 deletions src/ui/modmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ ModManager::ModManager(QWidget *parent) :

mergeMenuBar();
updateUi();
qApp->setStyleSheet(styleSheetPath(config_.getCustomStyle()));
}

ModManager::~ModManager()
Expand All @@ -133,7 +134,6 @@ QMenuBar *ModManager::menuBar() const

void ModManager::updateUi()
{
qApp->setStyleSheet(styleSheetPath(config_.getCustomStyle()));
pageSwitcher_.updateUi();
updateBlur();
}
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/modmanager.ui
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<string>Preferences</string>
</property>
<property name="shortcut">
<string>Ctrl+P</string>
<string>Ctrl+,</string>
</property>
</action>
<action name="actionManage_Browser">
Expand Down

0 comments on commit fe769d5

Please sign in to comment.