~shutter/shutter/devel

« back to all changes in this revision

Viewing changes to share/shutter/resources/modules/Shutter/App/ShutterNotification.pm

  • Committer: Mario Kemper (Romario)
  • Date: 2010-10-19 20:30:21 UTC
  • mfrom: (942.1.2 text_notify)
  • Revision ID: mario.kemper@googlemail.com-20101019203021-jqm0blnw773ptdii
merged text_notify

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
                
62
62
                #shape the window
63
63
                my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file  ($self->{_sc}->get_root . "/share/shutter/resources/icons/notify.svg");
64
 
                my ($pixmap, $mask) = $pixbuf->render_pixmap_and_mask (1);
65
 
                $self->{_notifications_window}->shape_combine_mask($mask, 0, 0);
 
64
                #~ my ($pixmap, $mask) = $pixbuf->render_pixmap_and_mask (1);
 
65
                #~ $self->{_notifications_window}->shape_combine_mask($mask, 0, 0);
66
66
                
67
67
                #add a widget to control size of the window
68
68
                my $fixed = Gtk2::Fixed->new;
76
76
                        return FALSE unless $self->{_summary};
77
77
 
78
78
                        #current monitor
79
 
                        my $mon         = $self->{_sc}->get_current_monitor;
 
79
                        my $mon = $self->{_sc}->get_current_monitor;
80
80
 
81
81
                        #initial position
82
82
                        unless(defined $self->{_notifications_window}->{'pos'}){
100
100
 
101
101
                        #pango layout
102
102
                        my $layout = Gtk2::Pango::Cairo::create_layout($cr);
103
 
                        $layout->set_width( ($w - $font_size * 2) * Gtk2::Pango->scale );
 
103
                        $layout->set_width( ($w - 30) * Gtk2::Pango->scale );
104
104
 
105
105
                        if ( Gtk2::Pango->CHECK_VERSION( 1, 20, 0 ) ) {
106
 
                                $layout->set_height( $h * Gtk2::Pango->scale );
 
106
                                $layout->set_height( ($h - 20) * Gtk2::Pango->scale );
107
107
                        }else{
108
108
                                warn "WARNING: \$layout->set_height is not available - outdated Pango version\n";
109
109
                        }
120
120
                        #set text
121
121
                        $layout->set_markup("<span font_desc=\"$font_fam $font_size\" weight=\"bold\" foreground=\"#FFFFFF\">" . Glib::Markup::escape_text( $self->{_summary} ) . "</span><span font_desc=\"$font_fam $font_size\" foreground=\"#FFFFFF\">\n" . Glib::Markup::escape_text( $self->{_body} ) . "</span>");
122
122
 
123
 
                        #fill window
124
123
                        $cr->set_operator('source');
125
124
 
126
125
                        if($self->{_sc}->get_mainwindow->get_screen->is_composited){
127
 
                                $cr->set_source_rgba( $sel_bg->red / 257 / 255, $sel_bg->green / 257 / 255, $sel_bg->blue / 257 / 255, 0.9 );
 
126
                                $cr->set_source_rgba( 1.0, 1.0, 1.0, 0 );
 
127
                                Gtk2::Gdk::Cairo::Context::set_source_pixbuf( $cr, $pixbuf, 0, 0 );
128
128
                                $cr->paint;
129
129
                        }else{
130
130
                                $cr->set_source_rgb( $sel_bg->red / 257 / 255, $sel_bg->green / 257 / 255, $sel_bg->blue / 257 / 255 );
131
131
                                $cr->paint;
132
132
                        }
133
133
 
 
134
                        $cr->set_operator('over');
 
135
 
134
136
                        #get layout size
135
137
                        my ( $lw, $lh ) = $layout->get_pixel_size;                      
136
138
                        $cr->move_to( ($w - $lw) / 2, ($h - $lh) / 2 );