summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-24 23:36:51 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-24 23:36:51 +0000
commit89eb0d6fca9810a04c47cf7b8179c46fb8ee882b (patch)
treee9b56c3ac85e6a7aa2a4385aa56fab548c5447cf
parent38f0f8075b9d71035bee5ce46483eb2993143f6c (diff)
downloaddrakx-89eb0d6fca9810a04c47cf7b8179c46fb8ee882b.tar
drakx-89eb0d6fca9810a04c47cf7b8179c46fb8ee882b.tar.gz
drakx-89eb0d6fca9810a04c47cf7b8179c46fb8ee882b.tar.bz2
drakx-89eb0d6fca9810a04c47cf7b8179c46fb8ee882b.tar.xz
drakx-89eb0d6fca9810a04c47cf7b8179c46fb8ee882b.zip
(_gtk__MDV_Notebook) handle "flip" option for "Image_using_pixbuf" too (could
be done for "Image_using_pixmap" but that's uneeded for now)
-rw-r--r--perl-install/mygtk2.pm6
1 files changed, 4 insertions, 2 deletions
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);
};
}