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,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")
|
||||
|
||||
@@ -73,20 +73,22 @@ namespace SpkUi
|
||||
|
||||
LightColorSet // TODO: Use real light color set
|
||||
{
|
||||
// { GlobalBgnd, 0x282828 },
|
||||
// { ControlsBgnd, 0x282828 },
|
||||
// { ControlsBgndHighlighted, 0xff0000 },
|
||||
// { SelectionBgnd, 0x0070ff },
|
||||
// { SelectionBgndHighlighted, QColor(0x0070ff).lighter(120) },
|
||||
// { LightCtrlsGradLight, 0x6b6b6b },
|
||||
// { LightCtrlsGradDark, 0x656565 },
|
||||
// { LightCtrlsGradDarker, 0x606060 },
|
||||
// { DarkCtrlsGradLight, 0x404040 },
|
||||
// { DarkCtrlsGradDark, 0x383838 },
|
||||
// { TextOnSelection, ColorTextOnBackground(0x0070ff) },
|
||||
// { TextOnGlobalBgnd, ColorTextOnBackground(0x282828) },
|
||||
// { TextOnControlsBgnd, ColorTextOnBackground(0x282828) },
|
||||
// { TextLighter, 0xd5d5d5 }
|
||||
{ GlobalBgnd, 0xf8f8f8 },
|
||||
{ ControlsBgnd, 0xf8f8f8 },
|
||||
{ ControlsBgndHighlighted, 0xff0000 },
|
||||
{ SelectionBgnd, 0x0070ff },
|
||||
{ SelectionBgndHighlighted, QColor(0x0070ff).lighter(120) },
|
||||
{ LightCtrlsGradLight, 0xfbfbfb },
|
||||
{ LightCtrlsGradDark, 0xf2f2f2 },
|
||||
{ LightCtrlsGradDarker, 0xebebeb },
|
||||
{ DarkCtrlsGradLight, 0xe4e4e4 },
|
||||
{ DarkCtrlsGradDark, 0xcecece },
|
||||
{ TextOnSelection, ColorTextOnBackground(0x0070ff) },
|
||||
{ TextOnGlobalBgnd, ColorTextOnBackground(0xf8f8f8) },
|
||||
{ TextOnControlsBgnd, ColorTextOnBackground(0xf8f8f8) },
|
||||
{ TextLighter, 0x2a2a2a },
|
||||
{ GlossyEdge, 0xc5c5c5 },
|
||||
{ ShadesEdge, 0x9d9d9d }
|
||||
};
|
||||
|
||||
using ColorSet = std::map<Qss::ColorSetIndex, QColor>;
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace SpkUi
|
||||
UiMetaObject() {}
|
||||
public slots:
|
||||
void SetAccentColor(QColor);
|
||||
void SetDarkLightTheme(bool isDark);
|
||||
};
|
||||
|
||||
extern UiMetaObject SpkUiMetaObject;
|
||||
|
||||
Reference in New Issue
Block a user