Skip to content

Commit

Permalink
[alarm clock] add theme icon to monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
HuaYaDong1 committed Feb 7, 2021
1 parent 58ae138 commit 4bf0ca4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/plugins/ukui-clock/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,17 @@ void Clock::settingsStyle()

connect(style_settings, &QGSettings::changed, this, [=] (const QString &key){
if(key==STYLE_NAME){
qDebug()<<"STYLE_NAME : "<<key;
if(stylelist.contains(style_settings->get(STYLE_NAME).toString())){
blackStyle();
}else{
whiteStyle();
}
}
if(key==STYLE_ICON_NAME || key==STYLE_ICON){
qDebug()<<"STYLE_ICON_NAME : "<<key;
setWindowIcon(QIcon::fromTheme("kylin-alarm-clock",QIcon(":/image/kylin-alarm-clock.svg")));
}
});
}

Expand Down
10 changes: 6 additions & 4 deletions src/plugins/ukui-clock/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ class close_or_hide;
#define STYLE_NAME "styleName"
#define STYLE_NAME_KEY_DARK "ukui-dark"
#define STYLE_NAME_KEY_DEFAULT "ukui-default"
#define STYLE_NAME_KEY_BLACK "ukui-black"
#define STYLE_NAME_KEY_LIGHT "ukui-light"
#define STYLE_NAME_KEY_WHITE "ukui-white"
#define STYLE_NAME_KEY_BLACK "ukui-black"
#define STYLE_NAME_KEY_LIGHT "ukui-light"
#define STYLE_NAME_KEY_WHITE "ukui-white"
#define STYLE_ICON "icon-theme-name"
#define STYLE_ICON_NAME "iconThemeName"

namespace Ui {
class Clock;
Expand Down Expand Up @@ -143,7 +145,7 @@ public slots:
void AlarmPageSwitch (); //闹钟窗口切换
// Alarm window switching
void StopwatchPageSwitch (); //秒表窗口切换
// Stopwatch window switch
// Stopwatch window switc
void settingsStyle(); //监听主题

void blackStyle(); //黑色主题
Expand Down

0 comments on commit 4bf0ca4

Please sign in to comment.