| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							|  |  |  | #ifndef THEMEINTERFACE_H
 | 
					
						
							|  |  |  | #define THEMEINTERFACE_H
 | 
					
						
							|  |  |  | #include <QObject>
 | 
					
						
							|  |  |  | #include <QColor>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-30 21:09:18 +02:00
										 |  |  | class ThemeInterface : public QObject { | 
					
						
							| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Color themes
 | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor backgroundColor MEMBER m_backgroundColor NOTIFY backgroundColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor contrastAccentColor MEMBER m_contrastAccentColor NOTIFY contrastAccentColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor darkerPrimaryColor MEMBER m_darkerPrimaryColor NOTIFY darkerPrimaryColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor darkerPrimaryTextColor MEMBER m_darkerPrimaryTextColor NOTIFY darkerPrimaryTextColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor drawerColor MEMBER m_drawerColor NOTIFY drawerColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor lightDrawerColor MEMBER m_lightDrawerColor NOTIFY lightDrawerColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor lightPrimaryColor MEMBER m_lightPrimaryColor NOTIFY lightPrimaryColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor lightPrimaryTextColor MEMBER m_lightPrimaryTextColor NOTIFY lightPrimaryTextColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor primaryColor MEMBER m_primaryColor NOTIFY primaryColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor primaryTextColor MEMBER m_primaryTextColor NOTIFY primaryTextColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor secondaryTextColor MEMBER m_secondaryTextColor NOTIFY secondaryTextColorChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(QColor textColor MEMBER m_textColor NOTIFY textColorChanged) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-14 13:10:07 +01:00
										 |  |  | 	// Font
 | 
					
						
							|  |  |  | 	Q_PROPERTY(double basePointSize MEMBER m_basePointSize CONSTANT) | 
					
						
							| 
									
										
										
										
											2020-01-14 19:30:47 +01:00
										 |  |  | 	Q_PROPERTY(double headingPointSize MEMBER m_headingPointSize NOTIFY headingPointSizeChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(double regularPointSize MEMBER m_regularPointSize NOTIFY regularPointSizeChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(double smallPointSize MEMBER m_smallPointSize NOTIFY smallPointSizeChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(double titlePointSize MEMBER m_titlePointSize NOTIFY titlePointSizeChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(double currentScale READ currentScale WRITE set_currentScale NOTIFY currentScaleChanged) | 
					
						
							| 
									
										
										
										
											2020-01-14 13:10:07 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | 	// Support
 | 
					
						
							|  |  |  | 	Q_PROPERTY(QString currentTheme MEMBER m_currentTheme WRITE set_currentTheme NOTIFY currentThemeChanged) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2020-03-30 21:09:18 +02:00
										 |  |  | 	static ThemeInterface *instance(); | 
					
						
							| 
									
										
										
										
											2020-03-30 21:01:54 +02:00
										 |  |  | 	double currentScale(); | 
					
						
							| 
									
										
										
										
											2021-01-14 17:08:13 -08:00
										 |  |  | 	void setInitialFontSize(double fontSize); | 
					
						
							| 
									
										
										
										
											2020-01-28 22:56:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | public slots: | 
					
						
							| 
									
										
										
										
											2020-03-30 21:01:54 +02:00
										 |  |  | 	void set_currentTheme(const QString &theme); | 
					
						
							|  |  |  | 	void set_currentScale(double); | 
					
						
							| 
									
										
										
										
											2020-01-14 19:30:47 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | signals: | 
					
						
							| 
									
										
										
										
											2020-03-30 21:20:49 +02:00
										 |  |  | 	void backgroundColorChanged(); | 
					
						
							|  |  |  | 	void contrastAccentColorChanged(); | 
					
						
							|  |  |  | 	void darkerPrimaryColorChanged(); | 
					
						
							|  |  |  | 	void darkerPrimaryTextColorChanged(); | 
					
						
							|  |  |  | 	void drawerColorChanged(); | 
					
						
							|  |  |  | 	void lightDrawerColorChanged(); | 
					
						
							|  |  |  | 	void lightPrimaryColorChanged(); | 
					
						
							|  |  |  | 	void lightPrimaryTextColorChanged(); | 
					
						
							|  |  |  | 	void primaryColorChanged(); | 
					
						
							|  |  |  | 	void primaryTextColorChanged(); | 
					
						
							|  |  |  | 	void secondaryTextColorChanged(); | 
					
						
							|  |  |  | 	void textColorChanged(); | 
					
						
							| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-30 21:20:49 +02:00
										 |  |  | 	void headingPointSizeChanged(); | 
					
						
							|  |  |  | 	void regularPointSizeChanged(); | 
					
						
							|  |  |  | 	void smallPointSizeChanged(); | 
					
						
							|  |  |  | 	void titlePointSizeChanged(); | 
					
						
							|  |  |  | 	void currentScaleChanged(); | 
					
						
							| 
									
										
										
										
											2020-01-14 19:30:47 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-30 21:20:49 +02:00
										 |  |  | 	void currentThemeChanged(); | 
					
						
							| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2020-03-30 21:33:05 +02:00
										 |  |  | 	ThemeInterface(); | 
					
						
							| 
									
										
										
										
											2020-03-30 21:01:54 +02:00
										 |  |  | 	void update_theme(); | 
					
						
							| 
									
										
										
										
											2020-01-28 22:56:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-30 21:01:54 +02:00
										 |  |  | 	QColor m_backgroundColor; | 
					
						
							|  |  |  | 	QColor m_contrastAccentColor; | 
					
						
							|  |  |  | 	QColor m_darkerPrimaryColor; | 
					
						
							|  |  |  | 	QColor m_darkerPrimaryTextColor; | 
					
						
							|  |  |  | 	QColor m_drawerColor; | 
					
						
							|  |  |  | 	QColor m_lightDrawerColor; | 
					
						
							|  |  |  | 	QColor m_lightPrimaryColor; | 
					
						
							|  |  |  | 	QColor m_lightPrimaryTextColor; | 
					
						
							|  |  |  | 	QColor m_primaryColor; | 
					
						
							|  |  |  | 	QColor m_primaryTextColor; | 
					
						
							|  |  |  | 	QColor m_secondaryTextColor; | 
					
						
							|  |  |  | 	QColor m_textColor; | 
					
						
							| 
									
										
										
										
											2020-01-28 22:56:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-30 21:01:54 +02:00
										 |  |  | 	double m_basePointSize; | 
					
						
							|  |  |  | 	double m_headingPointSize; | 
					
						
							|  |  |  | 	double m_regularPointSize; | 
					
						
							|  |  |  | 	double m_smallPointSize; | 
					
						
							|  |  |  | 	double m_titlePointSize; | 
					
						
							| 
									
										
										
										
											2020-01-28 22:56:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-30 21:01:54 +02:00
										 |  |  | 	QString m_currentTheme; | 
					
						
							| 
									
										
										
										
											2022-01-05 18:26:19 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	bool m_needSignals; | 
					
						
							| 
									
										
										
										
											2019-02-11 16:13:01 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | #endif
 |