Remove hover animation from buttons
Removing hover animations makes buttons feel more responsive
This commit is contained in:
parent
34a8b79aa7
commit
bb714f8f28
@ -25,7 +25,6 @@ Item {
|
|||||||
rightMargin: -margins.right
|
rightMargin: -margins.right
|
||||||
bottomMargin: -margins.bottom
|
bottomMargin: -margins.bottom
|
||||||
}
|
}
|
||||||
opacity: 0
|
|
||||||
imagePath: "widgets/button"
|
imagePath: "widgets/button"
|
||||||
prefix: "hover"
|
prefix: "hover"
|
||||||
}
|
}
|
||||||
@ -37,48 +36,14 @@ Item {
|
|||||||
name: "hovered"
|
name: "hovered"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: hoverEffect
|
target: hoverEffect
|
||||||
opacity: 1
|
visible: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "hidden"
|
name: "hidden"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: hoverEffect
|
target: hoverEffect
|
||||||
opacity: 0
|
visible: false
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -50,47 +50,14 @@ Item {
|
|||||||
name: "shown"
|
name: "shown"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: shadowEffect
|
target: shadowEffect
|
||||||
opacity: 1
|
visible: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "hidden"
|
name: "hidden"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: shadowEffect
|
target: shadowEffect
|
||||||
opacity: 0
|
visible: false
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user