1 | // Copyright (C) 2017 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICKFUSIONSTYLE_P_H |
5 | #define QQUICKFUSIONSTYLE_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtCore/qobject.h> |
19 | #include <QtGui/qcolor.h> |
20 | #include <QtQml/qqml.h> |
21 | #include <QtQuickControls2Fusion/qtquickcontrols2fusionexports.h> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class QQuickPalette; |
26 | |
27 | class Q_QUICKCONTROLS2FUSION_EXPORT QQuickFusionStyle : public QObject |
28 | { |
29 | Q_OBJECT |
30 | Q_PROPERTY(QColor lightShade READ lightShade CONSTANT FINAL) |
31 | Q_PROPERTY(QColor darkShade READ darkShade CONSTANT FINAL) |
32 | Q_PROPERTY(QColor topShadow READ topShadow CONSTANT FINAL) |
33 | Q_PROPERTY(QColor innerContrastLine READ innerContrastLine CONSTANT FINAL) |
34 | QML_NAMED_ELEMENT(Fusion) |
35 | QML_SINGLETON |
36 | QML_ADDED_IN_VERSION(2, 3) |
37 | |
38 | public: |
39 | explicit QQuickFusionStyle(QObject *parent = nullptr); |
40 | |
41 | static QColor lightShade(); |
42 | static QColor darkShade(); |
43 | static QColor topShadow(); |
44 | static QColor innerContrastLine(); |
45 | |
46 | Q_INVOKABLE static QColor highlight(QQuickPalette *palette); |
47 | Q_INVOKABLE static QColor highlightedText(QQuickPalette *palette); |
48 | Q_INVOKABLE static QColor outline(QQuickPalette *palette); |
49 | Q_INVOKABLE static QColor highlightedOutline(QQuickPalette *palette); |
50 | Q_INVOKABLE static QColor tabFrameColor(QQuickPalette *palette); |
51 | Q_INVOKABLE static QColor buttonColor(QQuickPalette *palette, bool highlighted = false, bool down = false, bool hovered = false); |
52 | Q_INVOKABLE static QColor buttonOutline(QQuickPalette *palette, bool highlighted = false, bool enabled = true); |
53 | Q_INVOKABLE static QColor gradientStart(const QColor &baseColor); |
54 | Q_INVOKABLE static QColor gradientStop(const QColor &baseColor); |
55 | Q_INVOKABLE static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50); |
56 | Q_INVOKABLE static QColor grooveColor(QQuickPalette *palette); |
57 | }; |
58 | |
59 | QT_END_NAMESPACE |
60 | |
61 | #endif // QQUICKFUSIONSTYLE_P_H |
62 | |