diff options
Diffstat (limited to 'examples/declarative/slideswitch/Switch.qml')
-rw-r--r-- | examples/declarative/slideswitch/Switch.qml | 55 |
1 files changed, 10 insertions, 45 deletions
diff --git a/examples/declarative/slideswitch/Switch.qml b/examples/declarative/slideswitch/Switch.qml index 6777277..8bc88e4 100644 --- a/examples/declarative/slideswitch/Switch.qml +++ b/examples/declarative/slideswitch/Switch.qml @@ -1,7 +1,6 @@ Item { id: Switch - width: Groove.width - height: Groove.height + width: Groove.width; height: Groove.height property var on @@ -28,64 +27,30 @@ Item { } } - Image { - id: Groove - source: "background.svg" - } - MouseRegion { - anchors.fill: Groove - onClicked: { toggle() } - } - Image { - id: Knob - source: "knob.svg" - x: 1 - y: 2 - } + Image { id: Groove; source: "background.svg" } + MouseRegion { anchors.fill: Groove; onClicked: { toggle() } } + Image { id: Knob; source: "knob.svg"; x: 1; y: 2 } MouseRegion { anchors.fill: Knob onClicked: { toggle() } onReleased: { dorelease() } - drag.target: Knob - drag.axis: "x" - drag.xmin: 1 - drag.xmax: 78 + drag.target: Knob; drag.axis: "x"; drag.xmin: 1; drag.xmax: 78 } states: [ State { name: "On" - SetProperty { - target: Knob - property: "x" - value: 78 - } - SetProperty { - target: Switch - property: "on" - value: true - } + SetProperty { target: Knob; property: "x"; value: 78 } + SetProperty { target: Switch; property: "on"; value: true } }, State { name: "Off" - SetProperty { - target: Knob - property: "x" - value: 1 - } - SetProperty { - target: Switch - property: "on" - value: false - } + SetProperty { target: Knob; property: "x"; value: 1 } + SetProperty { target: Switch; property: "on"; value: false } } ] transitions: [ Transition { - NumericAnimation { - properties: "x" - easing: "easeInOutQuad" - duration: 200 - } + NumericAnimation { properties: "x"; easing: "easeInOutQuad"; duration: 200 } } ] } |