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:
parent
3bf15785fa
commit
543340fd88
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue