]> git.etc.gen.nz Git - picture-display.git/commitdiff
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 c2270fd92c62be4078b2efe595bdfb1ad7548196..c75819b9541042759a248f012bc4607f9ad44dd6 100644 (file)
@@ -64,6 +64,18 @@ sub add {
 sub expire {
   my ($self) = @_[OBJECT];
 
+  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'});