File indexing completed on 2024-12-01 05:02:32
0001 /* 0002 SPDX-FileCopyrightText: 2018 Michail Vourlakos <mvourlakos@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef SCHEMECOLORS_H 0008 #define SCHEMECOLORS_H 0009 0010 // Qt 0011 #include <QObject> 0012 #include <QColor> 0013 0014 namespace Latte { 0015 namespace WindowSystem { 0016 0017 class SchemeColors: public QObject 0018 { 0019 Q_OBJECT 0020 Q_PROPERTY(QString schemeFile READ schemeFile NOTIFY schemeFileChanged) 0021 0022 Q_PROPERTY(QColor backgroundColor READ backgroundColor NOTIFY colorsChanged) 0023 Q_PROPERTY(QColor textColor READ textColor NOTIFY colorsChanged) 0024 Q_PROPERTY(QColor inactiveBackgroundColor READ inactiveBackgroundColor NOTIFY colorsChanged) 0025 Q_PROPERTY(QColor inactiveTextColor READ inactiveTextColor NOTIFY colorsChanged) 0026 0027 Q_PROPERTY(QColor highlightColor READ highlightColor NOTIFY colorsChanged) 0028 Q_PROPERTY(QColor highlightedTextColor READ highlightedTextColor NOTIFY colorsChanged) 0029 Q_PROPERTY(QColor positiveTextColor READ positiveTextColor NOTIFY colorsChanged) 0030 Q_PROPERTY(QColor neutralTextColor READ neutralTextColor NOTIFY colorsChanged) 0031 Q_PROPERTY(QColor negativeTextColor READ negativeTextColor NOTIFY colorsChanged) 0032 0033 Q_PROPERTY(QColor buttonTextColor READ buttonTextColor NOTIFY colorsChanged) 0034 Q_PROPERTY(QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY colorsChanged) 0035 Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY colorsChanged) 0036 Q_PROPERTY(QColor buttonFocusColor READ buttonFocusColor NOTIFY colorsChanged) 0037 0038 public: 0039 SchemeColors(QObject *parent, QString scheme, bool plasmaTheme = false); 0040 ~SchemeColors() override; 0041 0042 QString schemeName() const; 0043 0044 QString schemeFile() const; 0045 void setSchemeFile(QString file); 0046 0047 QColor backgroundColor() const; 0048 QColor textColor() const; 0049 QColor inactiveBackgroundColor() const; 0050 QColor inactiveTextColor() const; 0051 QColor highlightColor() const; 0052 QColor highlightedTextColor() const; 0053 QColor positiveTextColor() const; 0054 QColor neutralTextColor() const; 0055 QColor negativeTextColor() const; 0056 0057 QColor buttonTextColor() const; 0058 QColor buttonBackgroundColor() const; 0059 QColor buttonHoverColor() const; 0060 QColor buttonFocusColor() const; 0061 0062 static QString possibleSchemeFile(QString scheme); 0063 static QString schemeName(QString originalFile); 0064 0065 signals: 0066 void colorsChanged(); 0067 void schemeFileChanged(); 0068 0069 private slots: 0070 void updateScheme(); 0071 0072 private: 0073 bool m_basedOnPlasmaTheme{false}; 0074 0075 QString m_schemeName; 0076 QString m_schemeFile; 0077 0078 QColor m_activeBackgroundColor; 0079 QColor m_activeTextColor; 0080 0081 QColor m_inactiveBackgroundColor; 0082 QColor m_inactiveTextColor; 0083 0084 QColor m_highlightColor; 0085 QColor m_highlightedTextColor; 0086 QColor m_positiveTextColor; 0087 QColor m_neutralTextColor; 0088 QColor m_negativeTextColor; 0089 0090 QColor m_buttonTextColor; 0091 QColor m_buttonBackgroundColor; 0092 QColor m_buttonHoverColor; 0093 QColor m_buttonFocusColor; 0094 }; 0095 0096 } 0097 } 0098 0099 #endif