aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-08-19 16:03:57 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-08-19 14:12:03 +0000
commit6df3a9faa1845fd78996f376e6f885d1a09cfa42 (patch)
tree21bacc4a181e166bd15df6fefbe79a8858371eaf /src/imports/controls
parent9b7e62a88b9d86ba6b391bf7abc18cba3c147ed5 (diff)
Universal: document the attached style properties
Change-Id: I390d3f9107f9e38e755f98060f74d63becba60cb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls')
-rw-r--r--src/imports/controls/universal/qquickuniversalstyle.cpp3
-rw-r--r--src/imports/controls/universal/qquickuniversalstyle_p.h7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/imports/controls/universal/qquickuniversalstyle.cpp b/src/imports/controls/universal/qquickuniversalstyle.cpp
index c5516a9e..2328f1a5 100644
--- a/src/imports/controls/universal/qquickuniversalstyle.cpp
+++ b/src/imports/controls/universal/qquickuniversalstyle.cpp
@@ -132,6 +132,9 @@ static QRgb qquickuniversal_accent_color(QQuickUniversalStyle::Color accent)
return colors[accent];
}
+// If no value was inherited from a parent or explicitly set, the "global" values are used.
+// The initial, default values of the globals are hard-coded here, but the environment
+// variables and .conf file override them if specified.
static QQuickUniversalStyle::Theme GlobalTheme = QQuickUniversalStyle::Light;
static QRgb GlobalAccent = qquickuniversal_accent_color(QQuickUniversalStyle::Cobalt);
static QRgb GlobalForeground = qquickuniversal_light_color(QQuickUniversalStyle::BaseHigh);
diff --git a/src/imports/controls/universal/qquickuniversalstyle_p.h b/src/imports/controls/universal/qquickuniversalstyle_p.h
index 8e27215d..bf0a84d8 100644
--- a/src/imports/controls/universal/qquickuniversalstyle_p.h
+++ b/src/imports/controls/universal/qquickuniversalstyle_p.h
@@ -214,12 +214,19 @@ private:
void init();
bool variantToRgba(const QVariant &var, const char *name, QRgb *rgba) const;
+ // These reflect whether a color value was explicitly set on the specific
+ // item that this attached style object represents.
bool m_explicitTheme;
bool m_explicitAccent;
bool m_explicitForeground;
bool m_explicitBackground;
+ // These will be true when this item has an explicit or inherited foreground/background
+ // color, or these colors were declared globally via settings (e.g. conf or env vars).
+ // Some color properties of the style will return different values depending on whether
+ // or not these are set.
bool m_hasForeground;
bool m_hasBackground;
+ // The actual values for this item, whether explicit, inherited or globally set.
QQuickUniversalStyle::Theme m_theme;
QRgb m_accent;
QRgb m_foreground;