From 89eb0d6fca9810a04c47cf7b8179c46fb8ee882b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 24 Sep 2008 23:36:51 +0000 Subject: (_gtk__MDV_Notebook) handle "flip" option for "Image_using_pixbuf" too (could be done for "Image_using_pixmap" but that's uneeded for now) --- perl-install/mygtk2.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'perl-install') diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index d3de7cbb5..c138fb5bd 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -321,13 +321,15 @@ sub _gtk__Image { $w = Gtk2::Image->new; $w->{format} = delete $opts->{format} if exists $opts->{format}; + $w->{options} = { if_($o_size, size => $o_size), flip => delete $opts->{flip} }; + $w->{set_from_file} = $class =~ /using_pixmap/ ? sub { my ($w, $file) = @_; my $pixmap = mygtk2::pixmap_from_pixbuf($w, gtknew('Pixbuf', file => $file)); $w->set_from_pixmap($pixmap, undef); } : $class =~ /using_pixbuf/ ? sub { my ($w, $file) = @_; - my $pixbuf = _pixbuf_render_alpha(gtknew('Pixbuf', file => $file), 255); + my $pixbuf = _pixbuf_render_alpha(gtknew('Pixbuf', file => $file, %{$w->{options}}), 255); my ($width, $height) = ($pixbuf->get_width, $pixbuf->get_height); $w->set_size_request($width, $height); $w->signal_connect(expose_event => sub { @@ -341,7 +343,7 @@ sub _gtk__Image { }); } : sub { my ($w, $file, $o_size) = @_; - my $pixbuf = gtknew('Pixbuf', file => $file, if_($o_size, size => $o_size), flip => delete $opts->{flip}); + my $pixbuf = gtknew('Pixbuf', file => $file, %{$w->{options}}); $w->set_from_pixbuf($pixbuf); }; } -- cgit v1.2.1