summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-19 15:51:08 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-19 15:51:08 +0000
commit903833eb53d14dc77d95f7d796e9cdb5e460e0ed (patch)
tree0b179966b6c1c550ee0c4bc647f10113468d6186
parent429dd82740456237e012bbd3e52f9de3bfce4b55 (diff)
downloaddrakx-903833eb53d14dc77d95f7d796e9cdb5e460e0ed.tar
drakx-903833eb53d14dc77d95f7d796e9cdb5e460e0ed.tar.gz
drakx-903833eb53d14dc77d95f7d796e9cdb5e460e0ed.tar.bz2
drakx-903833eb53d14dc77d95f7d796e9cdb5e460e0ed.tar.xz
drakx-903833eb53d14dc77d95f7d796e9cdb5e460e0ed.zip
(Gtk2::Banner->new) better heuristics for vertically positionning the
Banner's text, according to the actual text's height
-rw-r--r--perl-install/ugtk2.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index b1f339d53..155db3086 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -1461,11 +1461,13 @@ sub new {
my $x_blue = $is_rtl ? $d_width - $blue_part->get_width : 0;
my $x_icon = $is_rtl ? $d_width - $padding - $width : $padding;
my $x_text = $is_rtl ? $x_icon - $padding - 32 - $darea->{txt_width} : $width + $padding +32;
+ $darea->{layout_height} ||= (($darea->{layout}->get_size)[1])/Gtk2::Pango->PANGO_SCALE;
$blue_part->render_to_drawable($darea->window, $style->bg_gc('normal'),
0, 0, $x_blue, 0, -1, -1, 'none', 0, 0);
$darea->{icon}->render_to_drawable($darea->window, $style->bg_gc('normal'),
0, 0, $x_icon, $padding, -1, -1, 'none', 0, 0);
- $darea->window->draw_layout($style->fg_gc('normal'), $x_text, $o_options->{txt_ypos} || $d_height/3,
+ $darea->window->draw_layout($style->fg_gc('normal'), $x_text,
+ $o_options->{txt_ypos} || ($d_height - $darea->{layout_height})/2,
$darea->{layout});
1;
});