feat: implement AI schedule app with multi-device sync
- Qt 6 desktop client with day/month/year views, AI scheduling, and TOML settings\n- Go sync server with SQLite change stream, WebSocket notifications, and Docker deployment\n- Client outbox/LWW sync, offline retry, and dual-client integration tests\n- Linux fcitx5 setup, validation reports, and Windows MinGW preset
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "ElaDef.h"
|
||||
#include "ThemeTokens.h"
|
||||
|
||||
class AppSettings;
|
||||
|
||||
/*
|
||||
* 类名: ThemeManager
|
||||
* 功能: 统一管理系统/浅色/深色主题,驱动 ElaWidgetTools 与自绘控件调色板
|
||||
* 线程安全: 否;主线程使用
|
||||
*/
|
||||
class ThemeManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum class Preference
|
||||
{
|
||||
System,
|
||||
Light,
|
||||
Dark,
|
||||
};
|
||||
Q_ENUM(Preference)
|
||||
|
||||
explicit ThemeManager(AppSettings& settings, QObject* parent = nullptr);
|
||||
|
||||
void initialize();
|
||||
|
||||
Preference preference() const;
|
||||
void setPreference(Preference preference);
|
||||
void cyclePreference();
|
||||
|
||||
ElaThemeType::ThemeMode mode() const;
|
||||
const ThemeTokens& tokens() const;
|
||||
static QString preferenceLabel(Preference preference);
|
||||
|
||||
signals:
|
||||
void themeChanged(const ThemeTokens& tokens);
|
||||
void preferenceChanged(Preference preference);
|
||||
|
||||
private:
|
||||
void apply();
|
||||
void applyPalette() const;
|
||||
static ThemeTokens buildTokens(bool dark);
|
||||
|
||||
AppSettings& m_settings;
|
||||
Preference m_preference = Preference::System;
|
||||
ElaThemeType::ThemeMode m_mode = ElaThemeType::Light;
|
||||
ThemeTokens m_tokens;
|
||||
};
|
||||
Reference in New Issue
Block a user