Skip to content

Commit a2e5522

Browse files
committed
Merge pull request nemomobile#2 from faenil/master
NEMO#511: ToolBar animations now work as expected
2 parents 22ed965 + 59e4d68 commit a2e5522

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/meego/ToolBar.qml

+14-9
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ Item {
113113
PropertyChanges { target: root; height: 0; visible: false; }
114114
},
115115
State {
116-
name: ""
117-
when: !(privateVisibility == ToolBarVisibility.Visible || tools == null)
116+
name: "visible"
117+
when: (privateVisibility == ToolBarVisibility.Visible && tools != null)
118118
PropertyChanges { target: root; height: bgImage.height; visible: true; }
119119
}
120120
]
121121

122122
// Transition between active and inactive states.
123123
transitions: Transition {
124-
from: ""; to: "hidden"; reversible: true;
124+
from: "visible"; to: "hidden"; reversible: true;
125125
SequentialAnimation {
126126
PropertyAnimation {
127127
properties: "height";
@@ -182,7 +182,7 @@ Item {
182182

183183
// select container states based on the transition animation
184184
var transitions = {
185-
"set": { "new": "", "old": "hidden" },
185+
"set": { "new": "default", "old": "hidden" },
186186
"push": { "new": "right", "old": "left" },
187187
"pop": { "new": "left", "old": "right" },
188188
"replace": { "new": "front", "old": "back" }
@@ -203,7 +203,7 @@ Item {
203203
__currentContainer.state = animation["old"];
204204
if (tools) {
205205
container.state = animation["new"];
206-
container.state = "";
206+
container.state = "default";
207207
}
208208

209209
__currentContainer = container;
@@ -261,6 +261,11 @@ Item {
261261
PropertyChanges { target: container; visible: true }
262262
PropertyChanges { target: container; scale: 0.85; opacity: 0.0 }
263263
},
264+
State {
265+
name: "default"
266+
PropertyChanges { target: container; visible: true }
267+
PropertyChanges { target: container; scale: 1.0; opacity: 1.0; x: 0.0 }
268+
},
264269
// Inactive state.
265270
State {
266271
name: "hidden"
@@ -272,7 +277,7 @@ Item {
272277
transitions: [
273278
// Pop entry and push exit transition.
274279
Transition {
275-
from: ""; to: "left"; reversible: true
280+
from: "default"; to: "left"; reversible: true
276281
SequentialAnimation {
277282
PropertyAnimation { properties: "x,opacity"; easing.type: Easing.InCubic; duration: platformStyle.contentTransitionDuration / 2 }
278283
PauseAnimation { duration: platformStyle.contentTransitionDuration / 2 }
@@ -281,7 +286,7 @@ Item {
281286
},
282287
// Push entry and pop exit transition.
283288
Transition {
284-
from: ""; to: "right"; reversible: true
289+
from: "default"; to: "right"; reversible: true
285290
SequentialAnimation {
286291
PropertyAnimation { properties: "x,opacity"; easing.type: Easing.InCubic; duration: platformStyle.contentTransitionDuration / 2 }
287292
PauseAnimation { duration: platformStyle.contentTransitionDuration / 2 }
@@ -290,14 +295,14 @@ Item {
290295
},
291296
Transition {
292297
// Replace entry transition.
293-
from: "front"; to: "";
298+
from: "front"; to: "default";
294299
SequentialAnimation {
295300
PropertyAnimation { properties: "scale,opacity"; easing.type: Easing.InOutExpo; duration: platformStyle.contentTransitionDuration }
296301
}
297302
},
298303
Transition {
299304
// Replace exit transition.
300-
from: ""; to: "back";
305+
from: "default"; to: "back";
301306
SequentialAnimation {
302307
PropertyAnimation { properties: "scale,opacity"; easing.type: Easing.InOutExpo; duration: platformStyle.contentTransitionDuration }
303308
ScriptAction { script: if (state == "back") state = "hidden" }

0 commit comments

Comments
 (0)