Merge pull request #2807

d07da76 MenuButton: add hover effect (xiphon)
This commit is contained in:
luigi1111 2020-03-27 10:55:07 -05:00
commit aecd218d15
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -62,7 +62,7 @@ Rectangle {
height: present ? ((appWindow.height >= 800) ? 44 : 38 ) : 0
LinearGradient {
visible: isOpenGL && button.checked
visible: isOpenGL && (button.checked || buttonArea.containsMouse)
height: parent.height
width: 260
anchors.verticalCenter: parent.verticalCenter
@ -75,13 +75,15 @@ Rectangle {
GradientStop { position: 0.0; color: MoneroComponents.Style.menuButtonGradientStart }
GradientStop { position: 1.0; color: MoneroComponents.Style.menuButtonGradientStop }
}
opacity: button.checked ? 1 : 0.3
}
// fallback hover effect when opengl is not available
Rectangle {
visible: !isOpenGL && button.checked
visible: !isOpenGL && (button.checked || buttonArea.containsMouse)
anchors.fill: parent
color: MoneroComponents.Style.menuButtonFallbackBackgroundColor
opacity: button.checked ? 1 : 0.3
}
// button decorations that are subject to leftMargin offsets