Fade out the notification.
authorAndrew Ruthven <puck@catalyst.net.nz>
Tue, 23 Sep 2008 02:39:23 +0000 (14:39 +1200)
committerAndrew Ruthven <puck@dirk.wgtn.cat-it.co.nz>
Tue, 23 Sep 2008 02:39:23 +0000 (14:39 +1200)
Now to get notifications to move up the screen when a new one arrives.

lib/Display/Notifications.pm

index c2270fd..c75819b 100644 (file)
@@ -66,6 +66,18 @@ sub expire {
 
   for my $block ($self->{'blocks'}->members()) {
     if ($block->{'expire'} <= time()) {
+      my $old_effect = Clutter::EffectTemplate->new_for_duration(1000, 'main::smoothstep_inc' );
+      my $old = Clutter::Effect->fade($old_effect, $block->{'block'}, 0, $self->can('post_fade_out'), $self);
+      $old->start();
+    }
+  }
+}
+
+sub post_fade_out {
+  my ($old_timeline, $self) = @_;
+
+  for my $block ($self->{'blocks'}->members()) {
+    if ($block->{'expire'} <= time()) {
       $self->{'stage'}->remove($block->{'block'});
       $self->{'blocks'}->remove($block);
     }