Remove hover animation from buttons

Removing hover animations makes buttons feel more responsive
This commit is contained in:
Jan Blackquill 2020-12-21 18:15:45 -05:00
parent 34a8b79aa7
commit bb714f8f28
2 changed files with 4 additions and 72 deletions

View File

@ -25,7 +25,6 @@ Item {
rightMargin: -margins.right
bottomMargin: -margins.bottom
}
opacity: 0
imagePath: "widgets/button"
prefix: "hover"
}
@ -37,48 +36,14 @@ Item {
name: "hovered"
PropertyChanges {
target: hoverEffect
opacity: 1
visible: true
}
},
State {
name: "hidden"
PropertyChanges {
target: hoverEffect
opacity: 0
}
}
]
transitions: [
Transition {
from: "*"
to: "hidden"
SequentialAnimation {
OpacityAnimator {
duration: units.veryShortDuration
easing.type: Easing.OutQuad
}
PropertyAction {
target: root
property: "visible"
value: false
}
}
},
Transition {
from: "*"
to: "hovered"
SequentialAnimation {
PropertyAction {
target: root
property: "visible"
value: true
}
OpacityAnimator {
// Using a shorter duration here makes things feel more responsive.
duration: units.veryShortDuration
easing.type: Easing.OutQuad
}
visible: false
}
}
]

View File

@ -50,47 +50,14 @@ Item {
name: "shown"
PropertyChanges {
target: shadowEffect
opacity: 1
visible: true
}
},
State {
name: "hidden"
PropertyChanges {
target: shadowEffect
opacity: 0
}
}
]
transitions: [
Transition {
from: "*"
to: "shown"
SequentialAnimation {
PropertyAction {
target: root
property: "visible"
value: true
}
OpacityAnimator {
duration: units.veryShortDuration
easing.type: Easing.OutQuad
}
}
},
Transition {
from: "*"
to: "hidden"
SequentialAnimation {
OpacityAnimator {
// Same duration as pressed and flat background hovered state animations
duration: units.veryShortDuration
easing.type: Easing.OutQuad
}
PropertyAction {
target: root
property: "visible"
value: false
}
visible: false
}
}
]