Merge lp:~vikoadi/audience/audience-slide-animation into lp:~audience-members/audience/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: Cody Garver
Approved revision: 551
Merged at revision: 559
Proposed branch: lp:~vikoadi/audience/audience-slide-animation
Merge into: lp:~audience-members/audience/trunk
Diff against target: 92 lines (+8/-22)
2 files modified
src/Widgets/BottomBar.vala (+4/-4)
src/Widgets/PlayerPage.vala (+4/-18)
To merge this branch: bzr merge lp:~vikoadi/audience/audience-slide-animation
Reviewer Review Type Date Requested Status
Audience Members Pending
Review via email: mp+277159@code.launchpad.net

Commit message

- slide up/down animation for bottombar and unfullscreen button
- replace allocate_bottombar with Actor Constraint

Description of the change

- slide up/down animation for bottombar and unfullscreen button
- replace allocate_bottombar with Actor Constraint

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/BottomBar.vala'
--- src/Widgets/BottomBar.vala 2015-06-14 07:02:09 +0000
+++ src/Widgets/BottomBar.vala 2015-11-10 17:24:14 +0000
@@ -47,9 +47,9 @@
47 this.enter_notify_event.connect ((event) => { this.hovered = true; return false; });47 this.enter_notify_event.connect ((event) => { this.hovered = true; return false; });
48 this.leave_notify_event.connect ((event) => { this.hovered = false; return false; });48 this.leave_notify_event.connect ((event) => { this.hovered = false; return false; });
4949
50 transition_type = Gtk.RevealerTransitionType.CROSSFADE;50 this.transition_type = Gtk.RevealerTransitionType.SLIDE_UP;
51
51 var main_actionbar = new Gtk.ActionBar ();52 var main_actionbar = new Gtk.ActionBar ();
52 main_actionbar.opacity = GLOBAL_OPACITY;
5353
54 play_button = new Gtk.Button.from_icon_name ("media-playback-start-symbolic", Gtk.IconSize.BUTTON);54 play_button = new Gtk.Button.from_icon_name ("media-playback-start-symbolic", Gtk.IconSize.BUTTON);
55 play_button.tooltip_text = _("Play");55 play_button.tooltip_text = _("Play");
@@ -113,8 +113,8 @@
113113
114 public Gtk.Revealer get_unfullscreen_button () {114 public Gtk.Revealer get_unfullscreen_button () {
115 unfullscreen_revealer = new Gtk.Revealer ();115 unfullscreen_revealer = new Gtk.Revealer ();
116 unfullscreen_revealer.opacity = GLOBAL_OPACITY;116 unfullscreen_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN;
117 unfullscreen_revealer.transition_type = Gtk.RevealerTransitionType.CROSSFADE;117
118 var unfullscreen_button = new Gtk.Button.from_icon_name ("view-restore-symbolic", Gtk.IconSize.BUTTON);118 var unfullscreen_button = new Gtk.Button.from_icon_name ("view-restore-symbolic", Gtk.IconSize.BUTTON);
119 unfullscreen_button.tooltip_text = _("Unfullscreen");119 unfullscreen_button.tooltip_text = _("Unfullscreen");
120 unfullscreen_button.clicked.connect (() => {unfullscreen ();});120 unfullscreen_button.clicked.connect (() => {unfullscreen ();});
121121
=== modified file 'src/Widgets/PlayerPage.vala'
--- src/Widgets/PlayerPage.vala 2015-10-31 19:47:46 +0000
+++ src/Widgets/PlayerPage.vala 2015-11-10 17:24:14 +0000
@@ -30,8 +30,6 @@
30 }30 }
31 }31 }
3232
33 private int bottom_bar_size = 0;
34
35 public signal void ended ();33 public signal void ended ();
3634
37 public PlayerPage () {35 public PlayerPage () {
@@ -49,7 +47,6 @@
49 stage.add_child (video_player);47 stage.add_child (video_player);
5048
51 bottom_bar = new Widgets.BottomBar (video_player);49 bottom_bar = new Widgets.BottomBar (video_player);
52 bottom_bar.set_valign (Gtk.Align.END);
53 bottom_bar.play_toggled.connect (() => { video_player.playing = !video_player.playing; });50 bottom_bar.play_toggled.connect (() => { video_player.playing = !video_player.playing; });
54 bottom_bar.seeked.connect ((val) => { video_player.progress = val; });51 bottom_bar.seeked.connect ((val) => { video_player.progress = val; });
55 bottom_bar.unfullscreen.connect (()=>{set_fullscreen (false);});52 bottom_bar.unfullscreen.connect (()=>{set_fullscreen (false);});
@@ -59,10 +56,14 @@
5956
60 bottom_actor = new GtkClutter.Actor.with_contents (bottom_bar);57 bottom_actor = new GtkClutter.Actor.with_contents (bottom_bar);
61 bottom_actor.opacity = GLOBAL_OPACITY;58 bottom_actor.opacity = GLOBAL_OPACITY;
59 bottom_actor.add_constraint (new Clutter.BindConstraint (stage, Clutter.BindCoordinate.WIDTH, 0));
60 bottom_actor.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.Y_AXIS, 1));
62 stage.add_child (bottom_actor);61 stage.add_child (bottom_actor);
6362
64 unfullscreen_actor = new GtkClutter.Actor.with_contents (unfullscreen_bar);63 unfullscreen_actor = new GtkClutter.Actor.with_contents (unfullscreen_bar);
65 unfullscreen_actor.opacity = GLOBAL_OPACITY;64 unfullscreen_actor.opacity = GLOBAL_OPACITY;
65 unfullscreen_actor.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.X_AXIS, 1));
66 unfullscreen_actor.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.Y_AXIS, 0));
66 stage.add_child (unfullscreen_actor);67 stage.add_child (unfullscreen_actor);
6768
68 this.size_allocate.connect (on_size_allocate);69 this.size_allocate.connect (on_size_allocate);
@@ -210,8 +211,6 @@
210 }211 }
211 });212 });
212213
213 stage.notify["allocation"].connect (() => {allocate_bottombar ();});
214
215 add (clutter);214 add (clutter);
216215
217 show_all ();216 show_all ();
@@ -332,21 +331,8 @@
332 return false;331 return false;
333 }332 }
334333
335 private void allocate_bottombar () {
336 bottom_actor.width = stage.get_width ();
337 bottom_bar.queue_resize ();
338 bottom_actor.y = stage.get_height () - bottom_bar_size;
339 unfullscreen_actor.y = 6;
340 unfullscreen_actor.x = stage.get_width () - bottom_bar_size - 6;
341 }
342
343 public bool update_pointer_position (double y, int window_height) {334 public bool update_pointer_position (double y, int window_height) {
344 allocate_bottombar ();
345 App.get_instance ().mainwindow.get_window ().set_cursor (null);335 App.get_instance ().mainwindow.get_window ().set_cursor (null);
346 if (bottom_bar_size == 0) {
347 int minimum = 0;
348 bottom_bar.get_preferred_height (out minimum, out bottom_bar_size);
349 }
350336
351 bottom_bar.reveal_control ();337 bottom_bar.reveal_control ();
352338

Subscribers

People subscribed via source and target branches