Skip to content
Snippets Groups Projects
Commit 2ed89fec authored by Sébastien Blin's avatar Sébastien Blin
Browse files

materialbutton: group hoverEnabled and enabled

The hover animation was shown on disabled buttons

Change-Id: I2d8579a1d712e785b8edc82472df6ac798f1b523
GitLab: #1247
parent 28151682
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,6 @@ AbstractButton {
value: height
}
hoverEnabled: true
focusPolicy: Qt.StrongFocus
Accessible.role: Accessible.Button
......@@ -168,7 +167,7 @@ AbstractButton {
leftPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textLeftPadding
rightPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textRightPadding
text: root.text
font.weight: (root.hovered && root.hoverEnabled) || boldFont ? Font.Bold : Font.Medium
font.weight: (root.hovered && root.enabled) || boldFont ? Font.Bold : Font.Medium
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
horizontalAlignment: root.textAlignment
......@@ -183,18 +182,18 @@ AbstractButton {
color: {
var baseColor = root.color;
if (root.primary) {
if (root.hovered && root.hoverEnabled)
if (root.hovered && root.enabled)
return root.hoveredColor;
return baseColor;
}
if (root.secondary || root.tertiary) {
if (root.hovered && root.hoverEnabled)
if (root.hovered && root.enabled)
return root.secHoveredColor;
return JamiTheme.transparentColor;
}
if (root.down)
return root.pressedColor;
if (root.hovered && root.hoverEnabled)
if (root.hovered && root.enabled)
return root.hoveredColor;
return baseColor;
}
......@@ -202,7 +201,7 @@ AbstractButton {
border.color: {
if (root.primary || root.tertiary)
return JamiTheme.transparentColor;
if (root.secondary && root.hovered && root.hoverEnabled)
if (root.secondary && root.hovered && root.enabled)
return JamiTheme.secondaryButtonHoveredBorderColor;
if (root.secondary)
return JamiTheme.secondaryButtonBorderColor;
......@@ -226,7 +225,7 @@ AbstractButton {
// We don't want to eat clicks on the Text.
acceptedButtons: Qt.NoButton
cursorShape: (root.hovered && root.hoverEnabled) ? Qt.PointingHandCursor : Qt.ArrowCursor
cursorShape: (root.hovered && root.enabled) ? Qt.PointingHandCursor : Qt.ArrowCursor
}
Shortcut {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment