mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-05 18:39:38 +00:00
MenuButton: add hover effect
This commit is contained in:
parent
55b548f31c
commit
d07da76383
1 changed files with 4 additions and 2 deletions
|
@ -62,7 +62,7 @@ Rectangle {
|
||||||
height: present ? ((appWindow.height >= 800) ? 44 : 38 ) : 0
|
height: present ? ((appWindow.height >= 800) ? 44 : 38 ) : 0
|
||||||
|
|
||||||
LinearGradient {
|
LinearGradient {
|
||||||
visible: isOpenGL && button.checked
|
visible: isOpenGL && (button.checked || buttonArea.containsMouse)
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: 260
|
width: 260
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
@ -75,13 +75,15 @@ Rectangle {
|
||||||
GradientStop { position: 0.0; color: MoneroComponents.Style.menuButtonGradientStart }
|
GradientStop { position: 0.0; color: MoneroComponents.Style.menuButtonGradientStart }
|
||||||
GradientStop { position: 1.0; color: MoneroComponents.Style.menuButtonGradientStop }
|
GradientStop { position: 1.0; color: MoneroComponents.Style.menuButtonGradientStop }
|
||||||
}
|
}
|
||||||
|
opacity: button.checked ? 1 : 0.3
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallback hover effect when opengl is not available
|
// fallback hover effect when opengl is not available
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: !isOpenGL && button.checked
|
visible: !isOpenGL && (button.checked || buttonArea.containsMouse)
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: MoneroComponents.Style.menuButtonFallbackBackgroundColor
|
color: MoneroComponents.Style.menuButtonFallbackBackgroundColor
|
||||||
|
opacity: button.checked ? 1 : 0.3
|
||||||
}
|
}
|
||||||
|
|
||||||
// button decorations that are subject to leftMargin offsets
|
// button decorations that are subject to leftMargin offsets
|
||||||
|
|
Loading…
Reference in a new issue