DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquicksystempalette.h
1// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKSYSTEMPALETTE_H
6#define DQUICKSYSTEMPALETTE_H
7
8#include <dtkdeclarative_global.h>
9
10#include <QColor>
11#include <DPalette>
12
13#include <DObject>
14
15DQUICK_BEGIN_NAMESPACE
16
17class DQuickSystemPalettePrivate;
18class D_DECL_DEPRECATED_X("Use DQMLGlobalObject::palette.") DQuickSystemPalette : public QObject, public DTK_CORE_NAMESPACE::DObject
19{
20 Q_OBJECT
21
22 Q_PROPERTY(DGUI_NAMESPACE::DPalette palette READ palette NOTIFY paletteChanged)
23 Q_PROPERTY(DQuickSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged)
24 // QPalette
25 Q_PROPERTY(QColor window READ window NOTIFY paletteChanged)
26 Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged)
27 Q_PROPERTY(QColor base READ base NOTIFY paletteChanged)
28 Q_PROPERTY(QColor text READ text NOTIFY paletteChanged)
29 Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged)
30 Q_PROPERTY(QColor button READ button NOTIFY paletteChanged)
31 Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged)
32 Q_PROPERTY(QColor light READ light NOTIFY paletteChanged)
33 Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged)
34 Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged)
35 Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged)
36 Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged)
37 Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged)
38 Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged)
39
40 // DPalette
41 Q_PROPERTY(QColor itemBackground READ itemBackground NOTIFY paletteChanged)
42 Q_PROPERTY(QColor textTitle READ textTitle NOTIFY paletteChanged)
43 Q_PROPERTY(QColor textTips READ textTips NOTIFY paletteChanged)
44 Q_PROPERTY(QColor textWarning READ textWarning NOTIFY paletteChanged)
45 Q_PROPERTY(QColor textLively READ textLively NOTIFY paletteChanged)
46 Q_PROPERTY(QColor lightLively READ lightLively NOTIFY paletteChanged)
47 Q_PROPERTY(QColor darkLively READ darkLively NOTIFY paletteChanged)
48 Q_PROPERTY(QColor frameBorder READ frameBorder NOTIFY paletteChanged)
49 Q_PROPERTY(QColor placeholderText READ placeholderText NOTIFY paletteChanged)
50 Q_PROPERTY(QColor frameShadowBorder READ frameShadowBorder NOTIFY paletteChanged)
51 Q_PROPERTY(QColor obviousBackground READ obviousBackground NOTIFY paletteChanged)
52
53public:
54 DQuickSystemPalette(QObject *parent = Q_NULLPTR);
55 ~DQuickSystemPalette() override;
56
57 enum ColorGroup { Active = QPalette::Active, Inactive = QPalette::Inactive, Disabled = QPalette::Disabled };
58 Q_ENUM(ColorGroup)
59
60 const DGUI_NAMESPACE::DPalette &palette() const;
61 DQuickSystemPalette::ColorGroup colorGroup() const;
62
63 QColor window() const;
64 QColor windowText() const;
65 QColor base() const;
66 QColor text() const;
67 QColor alternateBase() const;
68 QColor button() const;
69 QColor buttonText() const;
70 QColor light() const;
71 QColor midlight() const;
72 QColor dark() const;
73 QColor mid() const;
74 QColor shadow() const;
75 QColor highlight() const;
76 QColor highlightedText() const;
77
78 QColor itemBackground() const;
79 QColor textTitle() const;
80 QColor textTips() const;
81 QColor textWarning() const;
82 QColor textLively() const;
83 QColor lightLively() const;
84 QColor darkLively() const;
85 QColor frameBorder() const;
86 QColor placeholderText() const;
87 QColor frameShadowBorder() const;
88 QColor obviousBackground() const;
89
90public Q_SLOTS:
91 void setColorGroup(DQuickSystemPalette::ColorGroup colorGroup);
92
93Q_SIGNALS:
94 void paletteChanged();
95
96private:
97 D_DECLARE_PRIVATE(DQuickSystemPalette)
98};
99
100DQUICK_END_NAMESPACE
101
102#endif // DQUICKSYSTEMPALETTE_H
DQuickSystemPalette 是 DTk 自定义 QML 类型,用于在 QML 中使用调色板相关功能的类。 继承自 QObject,DObject,QQmlParserStatus,需要在 Q...
Definition dquicksystempalette.h:19