fix(StatusRoundButton): enable and correct hover on component

The `StatusRoundButton` was missing the `hoverEnabled` flag, causing it
to not turn the cursor into a pointer when the component is hovered.
It's also not rendering the proper hover color.

This commit fixes that to improve usability and look & feel.
This commit is contained in:
Pascal Precht 2021-01-27 09:32:18 +01:00 committed by Iuri Matias
parent 3bf15785fa
commit 543340fd88
3 changed files with 5 additions and 1 deletions

View File

@ -60,6 +60,7 @@ Theme {
property color buttonDisabledForegroundColor: buttonSecondaryColor
property color buttonDisabledBackgroundColor: evenDarkerGrey
property color buttonWarnBackgroundColor: "#FFEAEE"
property color buttonHoveredBackgroundColor: blue
property color roundedButtonForegroundColor: white
property color roundedButtonBackgroundColor: secondaryBackground

View File

@ -59,6 +59,7 @@ Theme {
property color buttonDisabledForegroundColor: buttonSecondaryColor
property color buttonDisabledBackgroundColor: grey
property color buttonWarnBackgroundColor: "#FFEAEE"
property color buttonHoveredBackgroundColor: blue
property color roundedButtonForegroundColor: buttonForegroundColor
property color roundedButtonBackgroundColor: secondaryBackground

View File

@ -130,6 +130,7 @@ RoundButton {
background: Rectangle {
anchors.fill: parent
opacity: hovered && size === "large" ? 0.2 : 1
color: {
if (size === "medium" || size == "small") {
return !enabled ? Style.current.roundedButtonSecondaryDisabledBackgroundColor :
@ -138,7 +139,7 @@ RoundButton {
}
return !enabled ?
Style.current.roundedButtonDisabledBackgroundColor :
hovered ? Qt.darker(Style.current.buttonBackgroundColor, 1.1) : Style.current.roundedButtonBackgroundColor
hovered ? Style.current.buttonHoveredBackgroundColor : Style.current.roundedButtonBackgroundColor
}
radius: parent.width / 2
}
@ -204,6 +205,7 @@ RoundButton {
}
MouseArea {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onPressed: mouse.accepted = false