This commit is contained in:
朱子楚\zhuzi
2024-04-23 00:31:20 +08:00
parent bc4510077f
commit e8d79e3c7b
14 changed files with 84 additions and 55 deletions

View File

@ -32,6 +32,7 @@ FluTheme::FluTheme(QObject *parent) : QObject{parent} {
connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path){
Q_EMIT desktopImagePathChanged();
});
connect(this, &FluTheme::blurBehindWindowEnabledChanged, this, [=] {checkUpdateDesktopImage();});
startTimer(1000);
}
@ -74,6 +75,9 @@ bool FluTheme::dark() const {
}
void FluTheme::checkUpdateDesktopImage(){
if(!_blurBehindWindowEnabled){
return;
}
QThreadPool::globalInstance()->start([=]() {
_mutex.lock();
auto path = FluTools::getInstance()->getWallpaperFilePath();
@ -90,7 +94,5 @@ void FluTheme::checkUpdateDesktopImage(){
void FluTheme::timerEvent(QTimerEvent *event)
{
if(_blurBehindWindowEnabled){
checkUpdateDesktopImage();
}
checkUpdateDesktopImage();
}