mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 12:22:05 +08:00
增加亮色模式支持,小幅修改QSS和UI元素大小
This commit is contained in:
@@ -11,6 +11,10 @@ void SpkDtkPluginImpl::Initialize()
|
||||
&DPlatformTheme::activeColorChanged,
|
||||
this,
|
||||
&SpkDtkPluginImpl::AccentColorChanged);
|
||||
connect(DGuiApplicationHelper::instance(),
|
||||
&DGuiApplicationHelper::themeTypeChanged,
|
||||
this,
|
||||
&SpkDtkPluginImpl::DarkLightThemeChanged);
|
||||
}
|
||||
|
||||
void SpkDtkPluginImpl::addWindow(QWidget *w, QObject *parent)
|
||||
@@ -23,3 +27,8 @@ QColor SpkDtkPluginImpl::GetAccentColor()
|
||||
{
|
||||
return DGuiApplicationHelper::instance()->systemTheme()->activeColor();
|
||||
}
|
||||
|
||||
bool SpkDtkPluginImpl::GetIsDarkTheme()
|
||||
{
|
||||
return DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType;
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@ class SpkDtkPlugin : public QObject
|
||||
virtual void Initialize() = 0;
|
||||
virtual void addWindow(QWidget* w, QObject* parent) = 0;
|
||||
virtual QColor GetAccentColor() = 0;
|
||||
virtual bool GetIsDarkTheme() = 0;
|
||||
|
||||
signals:
|
||||
void AccentColorChanged(QColor);
|
||||
void DarkLightThemeChanged(bool isDark);
|
||||
};
|
||||
QT_BEGIN_NAMESPACE
|
||||
Q_DECLARE_INTERFACE(SpkDtkPlugin, "org.spark-store.client.dtkplugin")
|
||||
|
||||
@@ -15,4 +15,5 @@ class SpkDtkPluginImpl : public SpkDtkPlugin
|
||||
void addWindow(QWidget* w, QObject* parent) override;
|
||||
void Initialize() override;
|
||||
QColor GetAccentColor() override;
|
||||
bool GetIsDarkTheme() override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user