From: Andrew Ruthven Date: Tue, 23 Sep 2008 02:39:23 +0000 (+1200) Subject: Fade out the notification. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ab0be8f6dc7e5fe727d57ffc99e2d85170e0cb6;p=picture-display.git Fade out the notification. Now to get notifications to move up the screen when a new one arrives. --- diff --git a/lib/Display/Notifications.pm b/lib/Display/Notifications.pm index c2270fd..c75819b 100644 --- a/lib/Display/Notifications.pm +++ b/lib/Display/Notifications.pm @@ -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'});