Compare commits

..

No commits in common. "2c4cf82f63526148ad793b6369ee83cb59bf8924" and "9296b186067df903b2797726bfede7cc60d3ba39" have entirely different histories.

6 changed files with 13 additions and 38 deletions

View File

@ -13,7 +13,7 @@ FluScrollablePage{
FluFrame{
Layout.fillWidth: true
Layout.preferredHeight: 408
Layout.preferredHeight: 400
padding: 10
ColumnLayout{

View File

@ -3,7 +3,6 @@
#include <QGuiApplication>
#include <QPalette>
#include <QImage>
#include <QThreadPool>
#include "Def.h"
#include "FluentIconDef.h"
#include "FluColors.h"
@ -25,7 +24,7 @@ FluTheme::FluTheme(QObject *parent) : QObject{parent} {
_blurBehindWindowEnabled = false;
QGuiApplication::instance()->installEventFilter(this);
refreshColors();
checkUpdateDesktopImage();
updateDesktopImage();
connect(this, &FluTheme::darkModeChanged, this, [=] {
Q_EMIT darkChanged();
});
@ -49,7 +48,7 @@ void FluTheme::refreshColors() {
fontTertiaryColor(isDark ? QColor(200, 200, 200, 255) : QColor(153, 153, 153, 255));
itemNormalColor(isDark ? QColor(255, 255, 255, 0) : QColor(0, 0, 0, 0));
frameColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.12)) : QColor(0, 0, 0, qRound(255 * 0.09)));
frameActiveColor(isDark ? QColor(48, 48, 48, qRound(255 * 0.8)) : QColor(255, 255, 255, qRound(255 * 0.6)));
frameActiveColor(isDark ? QColor(32, 32, 32, qRound(255 * 0.8)) : QColor(255, 255, 255, qRound(255 * 0.6)));
itemHoverColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.06)) : QColor(0, 0, 0, qRound(255 * 0.03)));
itemPressColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.09)) : QColor(0, 0, 0, qRound(255 * 0.06)));
itemCheckColor(isDark ? QColor(255, 255, 255, qRound(255 * 0.12)) : QColor(0, 0, 0, qRound(255 * 0.09)));
@ -91,9 +90,7 @@ bool FluTheme::dark() const {
}
}
void FluTheme::checkUpdateDesktopImage(){
QThreadPool::globalInstance()->start([=]() {
_mutex.lock();
void FluTheme::updateDesktopImage(){
auto path = FluTools::getInstance()->getWallpaperFilePath();
if(_desktopImagePath != path){
if(!_desktopImagePath.isEmpty()){
@ -102,13 +99,9 @@ void FluTheme::checkUpdateDesktopImage(){
desktopImagePath(path);
_watcher.addPath(path);
}
_mutex.unlock();
});
}
void FluTheme::timerEvent(QTimerEvent *event)
{
if(_blurBehindWindowEnabled){
checkUpdateDesktopImage();
}
updateDesktopImage();
}

View File

@ -8,7 +8,6 @@
#include <QColor>
#include <QTimer>
#include <QFileSystemWatcher>
#include <QMutex>
#include "FluAccentColor.h"
#include "stdafx.h"
#include "singleton.h"
@ -55,7 +54,7 @@ protected:
void timerEvent(QTimerEvent *event) override;
void checkUpdateDesktopImage();
void updateDesktopImage();
public:
SINGLETON(FluTheme)
@ -71,7 +70,6 @@ SINGLETON(FluTheme)
private:
bool _systemDark;
QFileSystemWatcher _watcher;
QMutex _mutex;
};
#endif // FLUTHEME_H

View File

@ -281,18 +281,6 @@ QString FluTools::getWallpaperFilePath() {
return path;
}
}
#elif defined(Q_OS_MACOS)
QProcess process;
QStringList args;
args << "-e";
args << R"(tell application "Finder" to get POSIX path of (desktop picture as alias))";
process.start("osascript", args);
process.waitForFinished();
QByteArray result = process.readAllStandardOutput().trimmed();
if(result.isEmpty()){
return "/System/Library/CoreServices/DefaultDesktop.heic";
}
return result;
#else
return {};
#endif

View File

@ -118,8 +118,6 @@ Window {
id:img_back
visible: false
cache: false
fillMode: Image.PreserveAspectCrop
asynchronous: true
Component.onCompleted: {
var geometry = FluTools.desktopAvailableGeometry(window)
width = geometry.width

View File

@ -117,8 +117,6 @@ Window {
id:img_back
visible: false
cache: false
fillMode: Image.PreserveAspectCrop
asynchronous: true
Component.onCompleted: {
var geometry = FluTools.desktopAvailableGeometry(window)
width = geometry.width