blob: d769e5517e85f8bc124ffc8d4d92b51ddc9d1b22 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
<Rect color="lightsteelblue" height="400" width="500">
<VisualModel id="MyVisualModel">
<model>
<ListModel id="ListModel">
<Person>
<name>Jessica</name>
<picture>face.png</picture>
</Person>
<Person>
<name>John</name>
<picture>photo0.png</picture>
</Person>
<Person>
<name>Susan</name>
<picture>photo10.png</picture>
</Person>
<Person>
<name>Samantha</name>
<picture>photo1.png</picture>
</Person>
<Person>
<name>Mark</name>
<picture>photo2.png</picture>
</Person>
<Person>
<name>Sarah</name>
<picture>photo3.png</picture>
</Person>
<Person>
<name>Pam</name>
<picture>photo4.png</picture>
</Person>
<Person>
<name>April</name>
<picture>photo5.png</picture>
</Person>
<Person>
<name>Tarryn</name>
<picture>photo6.png</picture>
</Person>
<Person>
<name>Geoff</name>
<picture>photo7.png</picture>
</Person>
<Person>
<name>Bill</name>
<picture>photo8.png</picture>
</Person>
<Person>
<name>Stuart</name>
<picture>photo9.png</picture>
</Person>
</ListModel>
</model>
<delegate>
<Package>
<Flipable id="MeRect" width="100" height="100">
<properties>
<Property name="r" type="Real" />
</properties>
<transform>
<Perspective angle="90" x="50" y="50" aspect="1" scale="256"/>
<Axis xStart="50" xEnd="50" yStart="0" yEnd="1" rotation="{MeRect.r}" />
</transform>
<front>
<Rect radius="5" color="red" width="100" height="100">
<Text text="{name}" />
</Rect>
</front>
<back>
<Rect radius="5" color="red" width="100" height="100">
<Image anchors.horizontalCenter="{parent.horizontalCenter}" anchors.verticalCenter="{parent.verticalCenter}" file="{picture}" />
</Rect>
</back>
</Flipable>
<Item Package.name="leftBox" id="LeftBox"
width="100" height="100">
<Rect opacity="0.1" width="80" height="80" radius="4"
color="grey" x="10" y="10">
<Text text="{name}" />
<MouseRegion anchors.fill="{parent}" onClick="if(MyItem.currentState=='left') MyItem.currentState='right'; else MyItem.currentState='left';" />
</Rect>
</Item>
<Item Package.name="rightBox" id="RightBox"
width="100" height="100">
<Rect opacity="0.1" width="80" height="80" radius="4"
color="grey" x="10" y="10">
<Text text="{name}" />
<MouseRegion anchors.fill="{parent}" onClick="if(MyItem.currentState=='left') MyItem.currentState='right'; else MyItem.currentState='left';" />
</Rect>
</Item>
<Item id="MyItem">
<states>
<State name="left">
<SetProperty target="{MeRect}" property="moveToParent" value="{LeftBox}" />
</State>
<State name="right">
<SetProperty target="{MeRect}" property="moveToParent" value="{RightBox}" />
<SetProperty target="{MeRect}" property="r" value="180" />
</State>
</states>
<transitions>
<Transition fromState="*" toState="*">
<NumericAnimation property="r" duration="500" />
<SerialAnimation>
<SetPropertyAction target="{MeRect}" property="moveToParent" value="{Bounce}" />
<ParallelAnimation>
<NumericAnimation target="{MeRect}" properties="x" to="0" duration="250" />
<NumericAnimation target="{MeRect}" properties="y" to="0" easing="easeInQuad" duration="250"/>
</ParallelAnimation>
<SetPropertyAction target="{MeRect}" property="moveToParent" />
<ParallelAnimation>
<NumericAnimation target="{MeRect}" properties="x" to="0" duration="250"/>
<NumericAnimation target="{MeRect}" properties="y" to="0" easing="easeOutQuad" duration="250"/>
</ParallelAnimation>
</SerialAnimation>
</Transition>
</transitions>
<currentState>left</currentState>
</Item>
</Package>
</delegate>
</VisualModel>
<Item width="800" height="400" clip="true">
<Item z="100" id="Bounce" x="200" y="300" />
<ListView id="MyListView" width="400" height="400" x="400"
model="{MyVisualModel.parts.rightBox}" />
<ListView id="MyListView2" width="400" height="400"
model="{MyVisualModel.parts.leftBox}" />
</Item>
</Rect>
|