decouple clickable from styledlabel

This commit is contained in:
Benjamin Palko 2025-07-23 10:17:56 -04:00
parent bf55feceb4
commit c4f0fbc1ee

View file

@ -4,31 +4,19 @@ import "../config/"
MouseArea { MouseArea {
id: mouseArea id: mouseArea
property bool disabled: false hoverEnabled: true
hoverEnabled: !disabled
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
StyledLabel { Rectangle {
id: background
anchors.fill: parent anchors.fill: parent
states: State {
name: "hovered" radius: Dimensions.radius
when: mouseArea.containsMouse color: mouseArea.containsMouse ? Theme.palette.primary : Theme.palette.base100
PropertyChanges { Behavior on color {
background {
color: Theme.palette.primary
}
}
}
transitions: Transition {
from: ""
to: "hovered"
reversible: true
ColorAnimation { ColorAnimation {
properties: "color" properties: "color"
duration: 200 duration: 200
easing.type: Easing.InOutCubic easing.type: Easing.InOutQuad
} }
} }
} }