From 906cce9e88453332806b8d5b620eb9c5a78a99f0 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 15 Jan 2020 09:55:00 +0100 Subject: mobile-widgets: emit signals for each color Emit signals for each standard color when theme changes. The iconStyle property was changed from being a constant, because it can change, and thus a signal was added. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/themeinterface.cpp | 13 +++++++++++++ mobile-widgets/themeinterface.h | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/themeinterface.cpp b/mobile-widgets/themeinterface.cpp index 21c189618..edb998922 100644 --- a/mobile-widgets/themeinterface.cpp +++ b/mobile-widgets/themeinterface.cpp @@ -107,4 +107,17 @@ void themeInterface::update_theme() m_textColor = m_darkTextColor; m_iconStyle = ":/icons-dark"; } + emit backgroundColorChanged(m_backgroundColor); + emit contrastAccentColorChanged(m_contrastAccentColor); + emit darkerPrimaryColorChanged(m_darkerPrimaryColor); + emit darkerPrimaryTextColorChanged(m_darkerPrimaryTextColor); + emit drawerColorChanged(m_drawerColor); + emit lightDrawerColorChanged(m_lightDrawerColor); + emit lightPrimaryColorChanged(m_lightPrimaryColor); + emit lightPrimaryTextColorChanged(m_lightPrimaryTextColor); + emit primaryColorChanged(m_primaryColor); + emit primaryTextColorChanged(m_primaryTextColor); + emit secondaryTextColorChanged(m_secondaryTextColor); + emit textColorChanged(m_textColor); + emit iconStyleChanged(m_iconStyle); } diff --git a/mobile-widgets/themeinterface.h b/mobile-widgets/themeinterface.h index f06d834da..7ef26d7f9 100644 --- a/mobile-widgets/themeinterface.h +++ b/mobile-widgets/themeinterface.h @@ -33,7 +33,7 @@ class themeInterface : public QObject { // Support Q_PROPERTY(QString currentTheme MEMBER m_currentTheme WRITE set_currentTheme NOTIFY currentThemeChanged) - Q_PROPERTY(QString iconStyle MEMBER m_iconStyle CONSTANT) + Q_PROPERTY(QString iconStyle MEMBER m_iconStyle NOTIFY iconStyleChanged) // Compatibility existing code Q_PROPERTY(QColor blueBackgroundColor MEMBER m_blueBackgroundColor CONSTANT) @@ -107,6 +107,7 @@ signals: void currentScaleChanged(double); void currentThemeChanged(const QString &); + void iconStyleChanged(const QString &); private: themeInterface() {} -- cgit v1.2.3-70-g09d2