2018-10-14 13:54:09 +03:00
/*
* Copyright 2018 Michail Vourlakos < mvourlakos @ gmail . com >
*
* This file is part of Latte - Dock
*
* Latte - Dock is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation ; either version 2 of
* the License , or ( at your option ) any later version .
*
* Latte - Dock is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*
*/
# ifndef SCHEMECOLORS_H
# define SCHEMECOLORS_H
2018-12-02 03:05:52 +03:00
// Qt
2018-10-14 13:54:09 +03:00
# include <QObject>
# include <QColor>
namespace Latte {
2019-05-11 15:43:10 +03:00
namespace WindowSystem {
2018-10-14 13:54:09 +03:00
class SchemeColors : public QObject
{
Q_OBJECT
2018-10-27 14:27:49 +03:00
Q_PROPERTY ( QString schemeFile READ schemeFile NOTIFY schemeFileChanged )
2018-10-14 13:54:09 +03:00
Q_PROPERTY ( QColor backgroundColor READ backgroundColor NOTIFY colorsChanged )
2018-10-18 18:02:54 +03:00
Q_PROPERTY ( QColor textColor READ textColor NOTIFY colorsChanged )
2018-11-07 21:20:36 +03:00
Q_PROPERTY ( QColor inactiveBackgroundColor READ inactiveBackgroundColor NOTIFY colorsChanged )
Q_PROPERTY ( QColor inactiveTextColor READ inactiveTextColor NOTIFY colorsChanged )
2018-10-18 18:02:54 +03:00
Q_PROPERTY ( QColor highlightColor READ highlightColor NOTIFY colorsChanged )
Q_PROPERTY ( QColor highlightedTextColor READ highlightedTextColor NOTIFY colorsChanged )
2018-11-17 19:12:42 +03:00
Q_PROPERTY ( QColor positiveTextColor READ positiveTextColor NOTIFY colorsChanged )
Q_PROPERTY ( QColor neutralTextColor READ neutralTextColor NOTIFY colorsChanged )
Q_PROPERTY ( QColor negativeTextColor READ negativeTextColor NOTIFY colorsChanged )
2018-10-14 13:54:09 +03:00
2018-10-27 14:27:49 +03:00
Q_PROPERTY ( QColor buttonTextColor READ buttonTextColor NOTIFY colorsChanged )
Q_PROPERTY ( QColor buttonBackgroundColor READ buttonBackgroundColor NOTIFY colorsChanged )
Q_PROPERTY ( QColor buttonHoverColor READ buttonHoverColor NOTIFY colorsChanged )
Q_PROPERTY ( QColor buttonFocusColor READ buttonFocusColor NOTIFY colorsChanged )
2018-10-14 13:54:09 +03:00
public :
2018-11-08 16:04:59 +03:00
SchemeColors ( QObject * parent , QString scheme , bool plasmaTheme = false ) ;
2018-10-14 13:54:09 +03:00
~ SchemeColors ( ) override ;
2018-10-27 14:27:49 +03:00
QString schemeName ( ) const ;
QString schemeFile ( ) const ;
void setSchemeFile ( QString file ) ;
2018-10-14 13:54:09 +03:00
QColor backgroundColor ( ) const ;
2018-10-18 18:02:54 +03:00
QColor textColor ( ) const ;
2018-11-07 21:20:36 +03:00
QColor inactiveBackgroundColor ( ) const ;
QColor inactiveTextColor ( ) const ;
2018-10-18 18:02:54 +03:00
QColor highlightColor ( ) const ;
QColor highlightedTextColor ( ) const ;
2018-11-17 19:12:42 +03:00
QColor positiveTextColor ( ) const ;
QColor neutralTextColor ( ) const ;
QColor negativeTextColor ( ) const ;
2018-10-14 13:54:09 +03:00
2018-10-27 14:27:49 +03:00
QColor buttonTextColor ( ) const ;
QColor buttonBackgroundColor ( ) const ;
QColor buttonHoverColor ( ) const ;
QColor buttonFocusColor ( ) const ;
2018-10-14 13:54:09 +03:00
static QString possibleSchemeFile ( QString scheme ) ;
2018-11-09 11:44:51 +03:00
static QString schemeName ( QString originalFile ) ;
2018-10-14 13:54:09 +03:00
signals :
void colorsChanged ( ) ;
2018-10-27 14:27:49 +03:00
void schemeFileChanged ( ) ;
2018-10-14 13:54:09 +03:00
private slots :
void updateScheme ( ) ;
private :
2018-11-08 16:04:59 +03:00
bool m_basedOnPlasmaTheme { false } ;
2018-10-14 13:54:09 +03:00
QString m_schemeName ;
QString m_schemeFile ;
QColor m_activeBackgroundColor ;
2018-10-18 18:02:54 +03:00
QColor m_activeTextColor ;
2018-10-14 13:54:09 +03:00
QColor m_inactiveBackgroundColor ;
2018-10-18 18:02:54 +03:00
QColor m_inactiveTextColor ;
QColor m_highlightColor ;
QColor m_highlightedTextColor ;
2018-11-17 19:12:42 +03:00
QColor m_positiveTextColor ;
QColor m_neutralTextColor ;
QColor m_negativeTextColor ;
2018-10-14 13:54:09 +03:00
2018-10-27 14:27:49 +03:00
QColor m_buttonTextColor ;
QColor m_buttonBackgroundColor ;
QColor m_buttonHoverColor ;
QColor m_buttonFocusColor ;
2018-10-14 13:54:09 +03:00
} ;
2019-05-11 15:43:10 +03:00
}
2018-10-14 13:54:09 +03:00
}
# endif