summaryrefslogtreecommitdiffstats
path: root/perl-install/ugtk2.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-03-24 11:15:18 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-03-24 11:15:18 +0000
commit4aee15de468be338158f2a1d32a95a62c65c5391 (patch)
tree3409a3e8ba9de2027d8e64d1ba99fc2c79a10e20 /perl-install/ugtk2.pm
parente089d8aca1b128a8d656fd7d1393f7b67397efae (diff)
downloaddrakx-backup-do-not-use-4aee15de468be338158f2a1d32a95a62c65c5391.tar
drakx-backup-do-not-use-4aee15de468be338158f2a1d32a95a62c65c5391.tar.gz
drakx-backup-do-not-use-4aee15de468be338158f2a1d32a95a62c65c5391.tar.bz2
drakx-backup-do-not-use-4aee15de468be338158f2a1d32a95a62c65c5391.tar.xz
drakx-backup-do-not-use-4aee15de468be338158f2a1d32a95a62c65c5391.zip
(Gtk2::Banner::new) ensure icon is centered vertically
Diffstat (limited to 'perl-install/ugtk2.pm')
-rw-r--r--perl-install/ugtk2.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index f0ae478eb..c147064eb 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -1530,7 +1530,8 @@ sub new {
my ($_class, $icon, $text, $o_options) = @_;
my $darea = Gtk2::DrawingArea->new;
- $darea->set_size_request(-1, 75);
+ my $d_height = 75;
+ $darea->set_size_request(-1, $d_height);
$darea->modify_font(Gtk2::Pango::FontDescription->from_string(common::N("_banner font:\nSans 14")));
$darea->{icon} = ugtk2::gtkcreate_pixbuf($icon);
$darea->{text} = $text;
@@ -1540,9 +1541,10 @@ sub new {
$darea->signal_connect(expose_event => sub {
my $style = $darea->get_style;
my $height = $darea->{icon}->get_height;
+ my $padding = int(($d_height - $height)/2);
$darea->{icon}->render_to_drawable($darea->window, $style->bg_gc('normal'),
- 0, 0, 10, 10, -1, -1, 'none', 0, 0);
- $darea->window->draw_layout($style->text_gc('normal'), $height + 20, $o_options->{txt_ypos} || 25,
+ 0, 0, $padding, $padding, -1, -1, 'none', 0, 0);
+ $darea->window->draw_layout($style->text_gc('normal'), $height + $padding*2, $o_options->{txt_ypos} || 25,
$darea->{layout});
1;
});