decouple clickable from styledlabel
This commit is contained in:
parent
bf55feceb4
commit
1e05cc8ba3
1 changed files with 7 additions and 19 deletions
|
|
@ -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.base300
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue