aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-07-20 16:18:00 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-07-21 08:56:24 +0000
commitda9831af00d25545ff7fd080eabc13379d5d3dfe (patch)
tree8433122f5e465f348a8d2f3a8f5f1acba708b7ce /src/imports/controls
parentdadd3762547d3c311651a7ca8bbe995b743b2a90 (diff)
QQuickMaterialStyle: cleanup several unused colors
These are no longer used now that the hovered and focused states are visualized by the ripple background, and the pressed state by the ripple waves and the elevation shadow. Change-Id: Ia2d315c2d8b31e4fcd77534f6128584b9daeb8d8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls')
-rw-r--r--src/imports/controls/material/qquickmaterialstyle.cpp77
-rw-r--r--src/imports/controls/material/qquickmaterialstyle_p.h18
2 files changed, 5 insertions, 90 deletions
diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp
index e38c71bd..be9e6d86 100644
--- a/src/imports/controls/material/qquickmaterialstyle.cpp
+++ b/src/imports/controls/material/qquickmaterialstyle.cpp
@@ -395,18 +395,6 @@ static const QRgb raisedButtonColorLight = 0xFFD6D7D7;
static const QRgb raisedButtonColorDark = 0x3FCCCCCC;
static const QRgb raisedButtonDisabledColorLight = dividerColorLight;
static const QRgb raisedButtonDisabledColorDark = dividerColorDark;
-static const QRgb flatButtonPressColorLight = 0x66999999;
-static const QRgb flatButtonPressColorDark = 0x3FCCCCCC;
-static const QRgb flatButtonFocusColorLight = 0x33CCCCCC;
-static const QRgb flatButtonFocusColorDark = 0x26CCCCCC;
-static const QRgb swipeDelegateColorLight = 0xFFD6D7D7;
-static const QRgb swipeDelegateColorDark = 0xFF525252;
-static const QRgb swipeDelegateHoverColorLight = 0xFFDFDFDF;
-static const QRgb swipeDelegateHoverColorDark = 0xFF5D5D5D;
-static const QRgb swipeDelegatePressColorLight = 0xFFCFCFCF;
-static const QRgb swipeDelegatePressColorDark = 0xFF484848;
-static const QRgb swipeDelegateDisabledColorLight = 0xFFEFEFEF;
-static const QRgb swipeDelegateDisabledColorDark = 0xFF7C7C7C;
static const QRgb frameColorLight = hintTextColorLight;
static const QRgb frameColorDark = hintTextColorDark;
static const QRgb switchUncheckedTrackColorLight = 0x42000000;
@@ -851,10 +839,9 @@ QColor QQuickMaterialStyle::dividerColor() const
return QColor::fromRgba(m_theme == Light ? dividerColorLight : dividerColorDark);
}
-QColor QQuickMaterialStyle::buttonColor(bool highlighted, bool pressed, bool hover) const
+QColor QQuickMaterialStyle::buttonColor(bool highlighted) const
{
- Shade shade = pressed ? (m_theme == Light ? Shade700 : Shade100)
- : themeShade();
+ Shade shade = themeShade();
QColor color = Qt::transparent;
@@ -865,22 +852,6 @@ QColor QQuickMaterialStyle::buttonColor(bool highlighted, bool pressed, bool hov
} else if (elevation() > 0) {
color = QColor::fromRgba(m_theme == Light ? raisedButtonColorLight
: raisedButtonColorDark);
-
- if (pressed) {
- color = this->shade(color, shade);
- }
- }
-
- 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;
- }
}
return color;
@@ -888,17 +859,7 @@ QColor QQuickMaterialStyle::buttonColor(bool highlighted, bool pressed, bool hov
QColor QQuickMaterialStyle::buttonColor() const
{
- return buttonColor(false, false, false);
-}
-
-QColor QQuickMaterialStyle::buttonHoverColor() const
-{
- return buttonColor(false, false, true);
-}
-
-QColor QQuickMaterialStyle::buttonPressColor() const
-{
- return buttonColor(false, true, false);
+ return buttonColor(false);
}
QColor QQuickMaterialStyle::buttonDisabledColor() const
@@ -913,37 +874,7 @@ QColor QQuickMaterialStyle::buttonDisabledColor() const
QColor QQuickMaterialStyle::highlightedButtonColor() const
{
- return buttonColor(true, false, false);
-}
-
-QColor QQuickMaterialStyle::highlightedButtonHoverColor() const
-{
- return buttonColor(true, false, true);
-}
-
-QColor QQuickMaterialStyle::highlightedButtonPressColor() const
-{
- return buttonColor(true, true, false);
-}
-
-QColor QQuickMaterialStyle::swipeDelegateColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegateColorLight : swipeDelegateColorDark);
-}
-
-QColor QQuickMaterialStyle::swipeDelegateHoverColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegateHoverColorLight : swipeDelegateHoverColorDark);
-}
-
-QColor QQuickMaterialStyle::swipeDelegatePressColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegatePressColorLight : swipeDelegatePressColorDark);
-}
-
-QColor QQuickMaterialStyle::swipeDelegateDisabledColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegateDisabledColorLight : swipeDelegateDisabledColorDark);
+ return buttonColor(true);
}
QColor QQuickMaterialStyle::frameColor() const
diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h
index eb85d3fa..301748bb 100644
--- a/src/imports/controls/material/qquickmaterialstyle_p.h
+++ b/src/imports/controls/material/qquickmaterialstyle_p.h
@@ -77,16 +77,8 @@ class QQuickMaterialStyle : public QQuickStyleAttached
Q_PROPERTY(QColor dropShadowColor READ dropShadowColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor dividerColor READ dividerColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor buttonColor READ buttonColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor buttonPressColor READ buttonPressColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor buttonDisabledColor READ buttonDisabledColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor highlightedButtonColor READ highlightedButtonColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor highlightedButtonHoverColor READ highlightedButtonHoverColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor highlightedButtonPressColor READ highlightedButtonPressColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegateColor READ swipeDelegateColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegateHoverColor READ swipeDelegateHoverColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegatePressColor READ swipeDelegatePressColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegateDisabledColor READ swipeDelegateDisabledColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor frameColor READ frameColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor checkBoxUncheckedRippleColor READ checkBoxUncheckedRippleColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor checkBoxCheckedRippleColor READ checkBoxCheckedRippleColor NOTIFY paletteChanged FINAL)
@@ -206,17 +198,9 @@ public:
QColor dropShadowColor() const;
QColor dividerColor() const;
QColor buttonColor() const;
- QColor buttonHoverColor() const;
- QColor buttonPressColor() const;
QColor buttonDisabledColor() const;
QColor highlightedButtonColor() const;
- QColor highlightedButtonHoverColor() const;
- QColor highlightedButtonPressColor() const;
QColor highlightedButtonDisabledColor() const;
- QColor swipeDelegateColor() const;
- QColor swipeDelegateHoverColor() const;
- QColor swipeDelegatePressColor() const;
- QColor swipeDelegateDisabledColor() const;
QColor frameColor() const;
QColor checkBoxUncheckedRippleColor() const;
QColor checkBoxCheckedRippleColor() const;
@@ -259,7 +243,7 @@ private:
QColor backgroundColor(Shade shade) const;
QColor accentColor(Shade shade) const;
- QColor buttonColor(bool highlighted, bool pressed, bool hover) const;
+ QColor buttonColor(bool highlighted) const;
Shade themeShade() const;
bool m_explicitTheme;