42 lines
1.4 KiB
C++
42 lines
1.4 KiB
C++
|
|
#ifndef SKINTHEMEPLUGIN_H
|
||
|
|
#define SKINTHEMEPLUGIN_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
#include <QWidget>
|
||
|
|
#include <QColor>
|
||
|
|
#include <QFont>
|
||
|
|
#include <QApplication>
|
||
|
|
#include "IPlugin.h"
|
||
|
|
|
||
|
|
class SkinTheme {
|
||
|
|
public:
|
||
|
|
QString name() const { return "Default"; }
|
||
|
|
QColor panelBackground() const { return QColor(25, 25, 28); }
|
||
|
|
QColor panelForeground() const { return QColor(220, 220, 220); }
|
||
|
|
QColor accentColor() const { return QColor(0, 120, 215); }
|
||
|
|
QColor warningColor() const { return QColor(238, 149, 114); }
|
||
|
|
QFont defaultFont() const { return QFont("Microsoft YaHei", 9); }
|
||
|
|
QString globalStyleSheet() const;
|
||
|
|
void apply(QApplication *app) const;
|
||
|
|
};
|
||
|
|
|
||
|
|
class SkinThemePlugin : public QObject, public IPlugin
|
||
|
|
{
|
||
|
|
Q_OBJECT Q_INTERFACES(IPlugin)
|
||
|
|
public:
|
||
|
|
explicit SkinThemePlugin(QObject *p = nullptr) : QObject(p) {}
|
||
|
|
QString name() const override { return "skin-theme"; }
|
||
|
|
QString title() const override { return "GCS 默认皮肤"; }
|
||
|
|
QString version() const override { return "2.0.0"; }
|
||
|
|
QWidget *createWidget(QWidget *parent) override { Q_UNUSED(parent); return nullptr; }
|
||
|
|
signals:
|
||
|
|
void sendCommand(const PluginCommand &cmd);
|
||
|
|
void showStatus(const QString &text, int timeout);
|
||
|
|
void dataChanged(const QString &key, const QVariant &value);
|
||
|
|
void requestData(const QString &what, const QVariantMap ¶ms);
|
||
|
|
private:
|
||
|
|
SkinTheme m_theme;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|