Merge lp:~voldyman/pantheon-greeter/no-animate into lp:~elementary-pantheon/pantheon-greeter/trunk

Proposed by Akshay Shekher
Status: Merged
Approved by: Cody Garver
Approved revision: 398
Merged at revision: 398
Proposed branch: lp:~voldyman/pantheon-greeter/no-animate
Merge into: lp:~elementary-pantheon/pantheon-greeter/trunk
Diff against target: 185 lines (+79/-17)
6 files modified
src/Avatar.vala (+16/-5)
src/LoginBox.vala (+22/-5)
src/PantheonGreeter.vala (+5/-1)
src/UserListActor.vala (+6/-1)
src/Utilities.vala (+13/-3)
src/Wallpaper.vala (+17/-2)
To merge this branch: bzr merge lp:~voldyman/pantheon-greeter/no-animate
Reviewer Review Type Date Requested Status
kay van der Zander (community) code Needs Fixing
Review via email: mp+273610@code.launchpad.net

Commit message

Actor.animate is deprecated, stop using it.

Description of the change

Actor.animate is deprecated, stop using it.

To post a comment you must log in.
397. By Akshay Shekher

stoped using actor.animate as it's deprecated

Revision history for this message
kay van der Zander (kay20) wrote :

Hey nice work.

I saw white lines on diff line 16 and 66. Please remove this one.
On diff line 57 sins you are here could you add the brackets around the if statement?

review: Needs Fixing (code)
Revision history for this message
kay van der Zander (kay20) wrote :

Oh i missed one line 74 also a white line remove it please. Other white lines are fine because they give a separation from other pieces of code.

398. By Akshay Shekher

removed extra blank lines, added brackets

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Avatar.vala'
2--- src/Avatar.vala 2015-07-12 23:31:17 +0000
3+++ src/Avatar.vala 2015-10-07 05:55:27 +0000
4@@ -113,17 +113,28 @@
5 this.contents = box;
6 }
7
8- public unowned Clutter.Animation fade_in () {
9- return animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, 400, "opacity", 255);
10+ public void fade_in () {
11+ save_easing_state ();
12+ set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
13+ set_easing_duration (400);
14+ set_opacity (255);
15+ restore_easing_state ();
16 }
17
18- public unowned Clutter.Animation fade_out () {
19- return animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, 400, "opacity", 0);
20+ public void fade_out () {
21+ save_easing_state ();
22+ set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
23+ set_easing_duration (400);
24+ set_opacity (0);
25+ restore_easing_state ();
26 }
27
28 public void dismiss () {
29- fade_out ().completed.connect (() => {
30+ fade_out ();
31+ ulong sid = 0;
32+ sid = transitions_completed.connect (() => {
33 get_parent ().remove_child (this);
34+ disconnect (sid);
35 });
36 }
37
38
39=== modified file 'src/LoginBox.vala'
40--- src/LoginBox.vala 2015-07-12 23:01:27 +0000
41+++ src/LoginBox.vala 2015-10-07 05:55:27 +0000
42@@ -48,14 +48,31 @@
43 // will display a Gtk.Entry for that and we need to hide
44 // the label that would otherwise be at the same position
45 // as the mentioned entry.
46- if (!user.provides_login_name)
47- label.animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, 200, "opacity", 0);
48+ if (!user.provides_login_name) {
49+ label.save_easing_state ();
50+ label.set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
51+ label.set_easing_duration (200);
52+ label.set_opacity (0);
53+ label.restore_easing_state ();
54+ }
55 } else {
56- if (avatar != null)
57+
58+ if (avatar != null) {
59 avatar.deselect ();
60- label.animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, 200, "opacity", 255);
61+ }
62+
63+ label.save_easing_state ();
64+ label.set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
65+ label.set_easing_duration (200);
66+ label.set_opacity (255);
67+ label.restore_easing_state ();
68 }
69- credentials_actor.animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, 200, "opacity", opacity);
70+
71+ credentials_actor.save_easing_state ();
72+ credentials_actor.set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
73+ credentials_actor.set_easing_duration (200);
74+ credentials_actor.opacity = opacity;
75+ credentials_actor.restore_easing_state ();
76 }
77 }
78
79
80=== modified file 'src/PantheonGreeter.vala'
81--- src/PantheonGreeter.vala 2015-04-23 06:09:09 +0000
82+++ src/PantheonGreeter.vala 2015-10-07 05:55:27 +0000
83@@ -213,7 +213,11 @@
84
85 scroll_event.connect (scroll_navigation);
86
87- greeterbox.animate (Clutter.AnimationMode.EASE_OUT_QUART, 250, opacity: 255);
88+ greeterbox.save_easing_state ();
89+ greeterbox.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUART);
90+ greeterbox.set_easing_duration (250);
91+ greeterbox.set_opacity (255);
92+ greeterbox.restore_easing_state ();
93
94 message ("Selecting last used user...");
95
96
97=== modified file 'src/UserListActor.vala'
98--- src/UserListActor.vala 2014-10-09 17:44:34 +0000
99+++ src/UserListActor.vala 2015-10-07 05:55:27 +0000
100@@ -85,7 +85,12 @@
101 for (int i = 0; i < userlist.size; i++) {
102 LoginOption user = userlist.get_user (i);
103 LoginBox box = boxes.get (user);
104- box.animate (Clutter.AnimationMode.EASE_IN_OUT_QUAD, 300, y: y_vars[i]);
105+
106+ box.save_easing_state ();
107+ box.set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
108+ box.set_easing_duration (300);
109+ box.y = y_vars[i];
110+ box.restore_easing_state ();
111
112 box.selected = (user == current_user);
113 if (user == current_user) {
114
115=== modified file 'src/Utilities.vala'
116--- src/Utilities.vala 2014-07-09 10:25:25 +0000
117+++ src/Utilities.vala 2015-10-07 05:55:27 +0000
118@@ -191,9 +191,13 @@
119 });
120
121 this.leave_event.connect (() => {
122- this.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 200, opacity:0).
123+ this.save_easing_state ();
124+ this.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
125+ this.set_easing_duration (200);
126+ this.set_opacity (0);
127+ this.restore_easing_state ();
128
129- completed.connect (() => {
130+ transitions_completed.connect (() => {
131 this.get_stage ().remove_child (this);
132 this.destroy ();
133 });
134@@ -202,7 +206,13 @@
135 });
136
137 this.opacity = 0;
138- this.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 200, opacity:255);
139+
140+ this.save_easing_state ();
141+ this.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
142+ this.set_easing_duration (200);
143+ this.set_opacity (255);
144+ this.restore_easing_state ();
145+
146 }
147
148 public Gtk.Widget get_content_area () {
149
150=== modified file 'src/Wallpaper.vala'
151--- src/Wallpaper.vala 2015-04-22 21:10:35 +0000
152+++ src/Wallpaper.vala 2015-10-07 05:55:27 +0000
153@@ -114,15 +114,30 @@
154 new_wallpaper.set_from_pixbuf (buf);
155 resize (new_wallpaper);
156 add_child (new_wallpaper);
157- new_wallpaper.animate (Clutter.AnimationMode.EASE_OUT_QUINT, 500, opacity: 255);
158+
159+ new_wallpaper.save_easing_state ();
160+ new_wallpaper.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUINT);
161+ new_wallpaper.set_easing_duration (500);
162+ new_wallpaper.set_opacity (255);
163+ new_wallpaper.restore_easing_state ();
164
165 // abort all currently loading wallpapers
166 foreach (var c in loading_wallpapers) {
167 c.cancel ();
168 }
169+
170 foreach (var other_wallpaper in wallpapers) {
171 wallpapers.remove (other_wallpaper);
172- other_wallpaper.animate (Clutter.AnimationMode.EASE_IN_QUINT, 500, opacity: 0).completed.connect (() => {
173+
174+ other_wallpaper.save_easing_state ();
175+ other_wallpaper.set_easing_mode (Clutter.AnimationMode.EASE_IN_QUINT);
176+ other_wallpaper.set_easing_duration (500);
177+ other_wallpaper.set_opacity (0);
178+ other_wallpaper.restore_easing_state ();
179+
180+ ulong sid = 0;
181+ sid = other_wallpaper.transitions_completed.connect (() => {
182+ other_wallpaper.disconnect (sid);
183 remove_child (other_wallpaper);
184 unused_wallpapers.push_tail (other_wallpaper);
185 });

Subscribers

People subscribed via source and target branches