}
sub add {
- my ($self, $kernel, $notification) = @_[OBJECT, KERNEL, ARG0];
+ my ($self, $kernel, $notification, $logo) = @_[OBJECT, KERNEL, ARG0, ARG1];
my $block = Clutter::Group->new();
$block->set_opacity(0);
$bg->set_position(10, $self->{'stage'}->get_height() - 10);
$notification->set_anchor_point(1, $notification->get_height());
- $notification->set_position(20, $self->{'stage'}->get_height() - 20);
- $notification->set_width($bg->get_width() - 20);
+
+ if (defined $logo) {
+ $block->add($logo);
+ $logo->set('keep-aspect-ratio' => 1);
+ $logo->set('sync-size' => 1);
+ $logo->set_height($notification->get_height());
+
+ $logo->set_position(20, $self->{'stage'}->get_height() - $bg->get_height - 20);
+ $notification->set_width($bg->get_width() - $logo->get_width() - 20 - 20);
+ $notification->set_position(20 + $logo->get_width() + 20, $self->{'stage'}->get_height() - 20);
+ } else {
+ $notification->set_position(20, $self->{'stage'}->get_height() - 20);
+ $notification->set_width($bg->get_width() - 20);
+ }
my $expire = time() + $delay;
use POE qw( Component::Client::Asterisk::Manager );
use Data::Dumper;
+use Clutter;
+use FindBin qw/$Bin/;
sub new {
my $proto = shift;
bless ($self, $class);
+ $self->{'logo'} = Clutter::Texture->new("$Bin/share/Asterisk.png");
+
$self->{'kernel'}->state('asterisk_delayed_start', $self, 'delayed_start');
POE::Component::Client::Asterisk::Manager->new(
$text->set_color(Clutter::Color->parse('White'));
$text->set_ellipsize('end');
- $kernel->post('display', 'notifications_add', $text);
+ $kernel->post('display', 'notifications_add', $text, $self->{'logo'});
}
use POSIX qw/strftime/;
use POE::Session;
use base ('Display::Plugin');
+use FindBin qw/$Bin/;
use strict;
my $delay = 5;
$self->{'file'} = $current->file();
- $kernel->yield('notifications_add', $self->{'status'});
+ $kernel->yield('notifications_add', $self->{'status'}, $self->{'logo'});
}
$self->delay();
$self->{'status'}->set_color(Clutter::Color->parse('White'));
$self->{'status'}->set_ellipsize('end');
+ $self->{'logo'} = Clutter::Texture->new("$Bin/share/MPD.png");
+
$self->{'kernel'}->yield('mpd_display');
}