Merge lp:~sindriava+launchpad/pantheon-notify/hover-tweak into lp:~tombeckmann/pantheon-notify/trunk

Proposed by Jiří Šebele
Status: Merged
Merge reported by: Tom Beckmann
Merged at revision: not available
Proposed branch: lp:~sindriava+launchpad/pantheon-notify/hover-tweak
Merge into: lp:~tombeckmann/pantheon-notify/trunk
Diff against target: 43 lines (+14/-2)
1 file modified
src/pantheon-notify.vala (+14/-2)
To merge this branch: bzr merge lp:~sindriava+launchpad/pantheon-notify/hover-tweak
Reviewer Review Type Date Requested Status
Tom Beckmann Pending
Review via email: mp+102899@code.launchpad.net

Description of the change

On hover, the notification doesn't disappear anymore. On hover out, the timeout resets to 3 seconds.

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/pantheon-notify.vala'
2--- src/pantheon-notify.vala 2012-04-20 16:23:04 +0000
3+++ src/pantheon-notify.vala 2012-04-20 16:55:59 +0000
4@@ -114,11 +114,13 @@
5 this.width = WIDTH;
6 this.reactive = true;
7
8+ uint timer = 0;
9+
10 //slide in anim
11 this.scale_x = 0.0f;
12 this.scale_gravity = Clutter.Gravity.EAST;
13 this.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, scale_x:1.0f).completed.connect ( () => {
14- Timeout.add ((timeout == uint32.MAX)?EXPIRE:timeout, () => {
15+ timer = Timeout.add ((timeout == uint32.MAX)?EXPIRE:timeout, () => {
16 this.close ();
17 return false;
18 });
19@@ -128,6 +130,9 @@
20 this.enter_event.connect ( () => {
21 closeb.animate (Clutter.AnimationMode.EASE_OUT_ELASTIC, 400, scale_x:1.0f, scale_y:1.0f);
22
23+ // Stop the timer
24+ Source.remove (timer);
25+
26 float height;
27 text.get_preferred_size (null, null, null, out height);
28 var new_h = this.height + (height - text.height) + SHADOW;
29@@ -138,7 +143,14 @@
30 });
31 this.leave_event.connect ( () => {
32 closeb.animate (Clutter.AnimationMode.EASE_IN_ELASTIC, 400, scale_x:0.0f, scale_y:0.0f);
33- this.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, height:HEIGHT+0.0f);
34+
35+ // Reset the timer for 3 seconds
36+ timer = Timeout.add ((timeout == uint32.MAX) ? 3000 : timeout, () => {
37+ this.close ();
38+ return false;
39+ });
40+
41+ this.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, height:HEIGHT+0.0f);
42 return true;
43 });
44

Subscribers

People subscribed via source and target branches

to all changes: