diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-26 12:29:19 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-05-26 11:18:55 +0000 |
commit | 43176ae13e827aa50e97d7eddb41f7c56b3a0165 (patch) | |
tree | 08b0707d39179d7ea0a5ce0767568e2181234939 /src | |
parent | 38432484befb88492b2597a42cf750cf2b56e06d (diff) |
Material: fix the reset of primary and accent
Also fix a test in dev(see 44ac831c).
Done-with: J-P Nurmi <jpnurmi@qt.io>
Task-number: QTBUG-53556
Change-Id: I0b156727b07ed8c135c4a7bb6bb31fb2b280d4ec
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/material/qquickmaterialstyle.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp index f8e282e2..7e9ba001 100644 --- a/src/imports/controls/material/qquickmaterialstyle.cpp +++ b/src/imports/controls/material/qquickmaterialstyle.cpp @@ -564,7 +564,10 @@ void QQuickMaterialStyle::resetPrimary() m_customPrimary = false; m_explicitPrimary = false; QQuickMaterialStyle *material = qobject_cast<QQuickMaterialStyle *>(parentStyle()); - inheritPrimary(material ? material->m_primary : defaultPrimary, true); + if (material) + inheritPrimary(material->m_primary, material->m_customPrimary); + else + inheritPrimary(defaultPrimary, false); } QVariant QQuickMaterialStyle::accent() const @@ -620,7 +623,10 @@ void QQuickMaterialStyle::resetAccent() m_customAccent = false; m_explicitAccent = false; QQuickMaterialStyle *material = qobject_cast<QQuickMaterialStyle *>(parentStyle()); - inheritAccent(material ? material->m_accent : defaultAccent, true); + if (material) + inheritAccent(material->m_accent, material->m_customAccent); + else + inheritAccent(defaultAccent, false); } QVariant QQuickMaterialStyle::foreground() const |