Skip to content

Commit

Permalink
chore: 修复选中跟随系统不跟随系统变化
Browse files Browse the repository at this point in the history
修复选中跟随系统不跟随系统变化

Log: 修复选中跟随系统不跟随系统变化
  • Loading branch information
DaiZW007 authored Oct 27, 2023
1 parent cd1dbf7 commit fec8f2f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/views/termwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,15 @@ inline void TermWidget::onColorThemeChanged(const QString &colorTheme)

inline void TermWidget::onThemeChanged(DGuiApplicationHelper::ColorType themeType)
{
Q_UNUSED(themeType);
if ("System Theme" == Settings::instance()->colorScheme()) {
if (DApplicationHelper::instance()->themeType() != themeType) {
setTheme("System Theme");
QString theme;
if (DApplicationHelper::DarkType == DApplicationHelper::instance()->themeType()) {
theme = "Dark";
} else {
theme = "Light";
}
setColorScheme(theme);
}
}

Expand Down Expand Up @@ -707,7 +712,6 @@ void TermWidget::changeTitleColor(int lightness)

void TermWidget::setTheme(const QString &colorTheme)
{
qInfo() << "dzw ==== " << colorTheme;
QString theme = colorTheme;
// 跟随系统
if ("System Theme" == colorTheme) {
Expand Down

0 comments on commit fec8f2f

Please sign in to comment.