fix(Wallet): introduce hover effect for wallet accounts

This commit is contained in:
Pascal Precht 2021-04-13 12:28:37 +02:00 committed by Pascal Precht
parent 78ce77c9c6
commit f2524db882
1 changed files with 17 additions and 1 deletions

View File

@ -75,10 +75,19 @@ Rectangle {
Rectangle {
property bool selected: index === selectedAccount
property bool hovered
id: rectangle
height: 64
color: selected ? Style.current.menuBackgroundActive : Style.current.transparent
color: {
if (selected) {
return Style.current.menuBackgroundActive
}
if (hovered) {
return Style.current.backgroundHoverLight
}
return Style.current.transparent
}
radius: Style.current.radius
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
@ -143,7 +152,14 @@ Rectangle {
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: {
rectangle.hovered = true
}
onExited: {
rectangle.hovered = false
}
onClicked: {
changeSelectedAccount(index)
}