blob: 14965b5ba1031fbe638d8d4cda407657fb1d6937 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<Item id="button" width="30" height="30">
<properties>
<Property name="icon"/>
</properties>
<signals>
<Signal name="clicked"/>
</signals>
<Rect id="buttonRect"
anchors.fill="{parent}"
color="lightgreen"
radius="5">
<Image id="iconImage"
source="{button.icon}"
anchors.horizontalCenter="{buttonRect.horizontalCenter}"
anchors.verticalCenter="{buttonRect.verticalCenter}"/>
<MouseRegion id="buttonMouseRegion"
anchors.fill="{buttonRect}"
onClicked="button.clicked.emit()"/>
<states>
<State name="pressed" when="{buttonMouseRegion.pressed == true}">
<SetProperty target="{buttonRect}" property="color" value="green"/>
</State>
</states>
<transitions>
<Transition fromState="*" toState="pressed">
<ColorAnimation duration="200"/>
</Transition>
<Transition fromState="pressed" toState="*">
<ColorAnimation duration="1000"/>
</Transition>
</transitions>
</Rect>
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>
</Behaviour>
</opacity>
</Item>
|