aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/qquickmaterialstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/material/qquickmaterialstyle.cpp')
-rw-r--r--src/imports/controls/material/qquickmaterialstyle.cpp18
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);