diff options
author | Nikita Krupenko <krnekit@gmail.com> | 2016-05-05 22:50:04 +0300 |
---|---|---|
committer | Nikita Krupenko <krnekit@gmail.com> | 2016-05-09 13:52:56 +0000 |
commit | 4cf39df949c3a1e136ac8832be9d4608733e45f2 (patch) | |
tree | 36bf78818d7d1d99d45c153746be8d3d6c525c8f /src/imports/controls/material/qquickmaterialstyle.cpp | |
parent | 4dc0c0d4fa4e886650fb72161448bfb1f621b53b (diff) |
Material: fix flat button colors
As 251afe3eaac3367c5c659dddc1e8854f833d5112 changed the way, how button
color are retrieved, use it for flat buttons too.
Change-Id: I28448c597b027293b1acac22dad586e0e7156707
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/controls/material/qquickmaterialstyle.cpp')
-rw-r--r-- | src/imports/controls/material/qquickmaterialstyle.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp index b80fc729..ce72e04b 100644 --- a/src/imports/controls/material/qquickmaterialstyle.cpp +++ b/src/imports/controls/material/qquickmaterialstyle.cpp @@ -861,9 +861,16 @@ QColor QQuickMaterialStyle::buttonColor(bool highlighted, bool pressed, bool hov } } - if (color == Qt::transparent && pressed) { - color = QColor::fromRgba(m_theme == Light ? flatButtonPressColorLight - : flatButtonPressColorDark); + if (color == Qt::transparent) { + if (pressed) { + return QColor::fromRgba(m_theme == Light ? flatButtonPressColorLight + : flatButtonPressColorDark); + } else if (hover) { + return QColor::fromRgba(m_theme == Light ? flatButtonFocusColorLight + : flatButtonFocusColorDark); + } else { + return color; + } } if (pressed || hover) { @@ -914,11 +921,6 @@ QColor QQuickMaterialStyle::highlightedButtonPressColor() const return buttonColor(true, true, false); } -QColor QQuickMaterialStyle::flatButtonFocusColor() const -{ - return QColor::fromRgba(m_theme == Light ? flatButtonFocusColorLight : flatButtonFocusColorDark); -} - QColor QQuickMaterialStyle::swipeDelegateColor() const { return QColor::fromRgba(m_theme == Light ? swipeDelegateColorLight : swipeDelegateColorDark); |