mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-18 18:11:37 +08:00
feat: 使用dbus支持kde的暗色模式
This commit is contained in:
26
src/backend/ThemeChecker.h
Normal file
26
src/backend/ThemeChecker.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef THEMECHECKER_H
|
||||
#define THEMECHECKER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
class ThemeChecker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ThemeChecker(QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void themeChanged(bool isDark);
|
||||
|
||||
public slots:
|
||||
void checkThemeChange();
|
||||
|
||||
|
||||
private:
|
||||
int lastColorSchema;
|
||||
QTimer *timer;
|
||||
};
|
||||
|
||||
#endif // THEMECHECKER_H
|
||||
Reference in New Issue
Block a user