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
1=== modified file 'src/Widgets/BottomBar.vala'
2--- src/Widgets/BottomBar.vala 2015-06-14 07:02:09 +0000
3+++ src/Widgets/BottomBar.vala 2015-11-10 17:24:14 +0000
4@@ -47,9 +47,9 @@
5 this.enter_notify_event.connect ((event) => { this.hovered = true; return false; });
6 this.leave_notify_event.connect ((event) => { this.hovered = false; return false; });
7
8- transition_type = Gtk.RevealerTransitionType.CROSSFADE;
9+ this.transition_type = Gtk.RevealerTransitionType.SLIDE_UP;
10+
11 var main_actionbar = new Gtk.ActionBar ();
12- main_actionbar.opacity = GLOBAL_OPACITY;
13
14 play_button = new Gtk.Button.from_icon_name ("media-playback-start-symbolic", Gtk.IconSize.BUTTON);
15 play_button.tooltip_text = _("Play");
16@@ -113,8 +113,8 @@
17
18 public Gtk.Revealer get_unfullscreen_button () {
19 unfullscreen_revealer = new Gtk.Revealer ();
20- unfullscreen_revealer.opacity = GLOBAL_OPACITY;
21- unfullscreen_revealer.transition_type = Gtk.RevealerTransitionType.CROSSFADE;
22+ unfullscreen_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN;
23+
24 var unfullscreen_button = new Gtk.Button.from_icon_name ("view-restore-symbolic", Gtk.IconSize.BUTTON);
25 unfullscreen_button.tooltip_text = _("Unfullscreen");
26 unfullscreen_button.clicked.connect (() => {unfullscreen ();});
27
28=== modified file 'src/Widgets/PlayerPage.vala'
29--- src/Widgets/PlayerPage.vala 2015-10-31 19:47:46 +0000
30+++ src/Widgets/PlayerPage.vala 2015-11-10 17:24:14 +0000
31@@ -30,8 +30,6 @@
32 }
33 }
34
35- private int bottom_bar_size = 0;
36-
37 public signal void ended ();
38
39 public PlayerPage () {
40@@ -49,7 +47,6 @@
41 stage.add_child (video_player);
42
43 bottom_bar = new Widgets.BottomBar (video_player);
44- bottom_bar.set_valign (Gtk.Align.END);
45 bottom_bar.play_toggled.connect (() => { video_player.playing = !video_player.playing; });
46 bottom_bar.seeked.connect ((val) => { video_player.progress = val; });
47 bottom_bar.unfullscreen.connect (()=>{set_fullscreen (false);});
48@@ -59,10 +56,14 @@
49
50 bottom_actor = new GtkClutter.Actor.with_contents (bottom_bar);
51 bottom_actor.opacity = GLOBAL_OPACITY;
52+ bottom_actor.add_constraint (new Clutter.BindConstraint (stage, Clutter.BindCoordinate.WIDTH, 0));
53+ bottom_actor.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.Y_AXIS, 1));
54 stage.add_child (bottom_actor);
55
56 unfullscreen_actor = new GtkClutter.Actor.with_contents (unfullscreen_bar);
57 unfullscreen_actor.opacity = GLOBAL_OPACITY;
58+ unfullscreen_actor.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.X_AXIS, 1));
59+ unfullscreen_actor.add_constraint (new Clutter.AlignConstraint (stage, Clutter.AlignAxis.Y_AXIS, 0));
60 stage.add_child (unfullscreen_actor);
61
62 this.size_allocate.connect (on_size_allocate);
63@@ -210,8 +211,6 @@
64 }
65 });
66
67- stage.notify["allocation"].connect (() => {allocate_bottombar ();});
68-
69 add (clutter);
70
71 show_all ();
72@@ -332,21 +331,8 @@
73 return false;
74 }
75
76- private void allocate_bottombar () {
77- bottom_actor.width = stage.get_width ();
78- bottom_bar.queue_resize ();
79- bottom_actor.y = stage.get_height () - bottom_bar_size;
80- unfullscreen_actor.y = 6;
81- unfullscreen_actor.x = stage.get_width () - bottom_bar_size - 6;
82- }
83-
84 public bool update_pointer_position (double y, int window_height) {
85- allocate_bottombar ();
86 App.get_instance ().mainwindow.get_window ().set_cursor (null);
87- if (bottom_bar_size == 0) {
88- int minimum = 0;
89- bottom_bar.get_preferred_height (out minimum, out bottom_bar_size);
90- }
91
92 bottom_bar.reveal_control ();
93

Subscribers

People subscribed via source and target branches