mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-01-22 20:04:32 +08:00
update
This commit is contained in:
parent
44f7948df3
commit
481e19c8cc
@ -33,7 +33,7 @@ FluTheme::FluTheme(QObject *parent) : QObject{parent} {
|
|||||||
connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path){
|
connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path){
|
||||||
Q_EMIT desktopImagePathChanged();
|
Q_EMIT desktopImagePathChanged();
|
||||||
});
|
});
|
||||||
startTimer(500);
|
startTimer(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluTheme::refreshColors() {
|
void FluTheme::refreshColors() {
|
||||||
|
@ -260,11 +260,33 @@ QString FluTools::getWallpaperFilePath() {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return QString::fromWCharArray(path);
|
return QString::fromWCharArray(path);
|
||||||
#endif
|
#elif defined(Q_OS_WIN)
|
||||||
|
auto type = QSysInfo::productType();
|
||||||
|
if (type == "uos") {
|
||||||
|
QProcess process;
|
||||||
|
QStringList args;
|
||||||
|
args << "--session";
|
||||||
|
args << "--type=method_call";
|
||||||
|
args << "--print-reply";
|
||||||
|
args << "--dest=com.deepin.wm";
|
||||||
|
args << "/com/deepin/wm";
|
||||||
|
args << "com.deepin.wm.GetCurrentWorkspaceBackgroundForMonitor";
|
||||||
|
args << QString("string:'%1'").arg(currentTimestamp());
|
||||||
|
process.start("dbus-send", args);
|
||||||
|
process.waitForFinished();
|
||||||
|
QByteArray result = process.readAllStandardOutput().trimmed();
|
||||||
|
int startIndex = result.indexOf("file:///");
|
||||||
|
if (startIndex != -1) {
|
||||||
|
auto path = result.mid(startIndex + 7, result.length() - startIndex - 8);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
return {};
|
return {};
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor FluTools::imageMainColor(const QImage& image, double bright) {
|
QColor FluTools::imageMainColor(const QImage &image, double bright) {
|
||||||
int step = 20;
|
int step = 20;
|
||||||
int t = 0;
|
int t = 0;
|
||||||
int r = 0, g = 0, b = 0;
|
int r = 0, g = 0, b = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user