summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_gtk.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-01-29 17:52:29 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-01-29 17:52:29 +0000
commit71d7193957a6ef0df69e36f43b9a3fd467ef3462 (patch)
treedc31d3fc03253e2ac6465f9846ee05697799d8f2 /perl-install/install_steps_gtk.pm
parent9dfec71bfe7ba85adf008f3bbac3ae5d6976f2af (diff)
downloaddrakx-71d7193957a6ef0df69e36f43b9a3fd467ef3462.tar
drakx-71d7193957a6ef0df69e36f43b9a3fd467ef3462.tar.gz
drakx-71d7193957a6ef0df69e36f43b9a3fd467ef3462.tar.bz2
drakx-71d7193957a6ef0df69e36f43b9a3fd467ef3462.tar.xz
drakx-71d7193957a6ef0df69e36f43b9a3fd467ef3462.zip
advertising:
- support leftish and centered text - support arbitrary bold text with ml-like syntax <b>foo</b> in strings - simplify get_text_coord and unexport it, no one else than wrap_paragraph uses it nowadays
Diffstat (limited to 'perl-install/install_steps_gtk.pm')
-rw-r--r--perl-install/install_steps_gtk.pm17
1 files changed, 6 insertions, 11 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 4214b5c4a..96e9d7153 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -516,7 +516,7 @@ sub installPackages {
log::l("advertising $f");
my $pl = $f; $pl =~ s/\.png$/.pl/;
my $icon_name = $f; $icon_name =~ s/\.png$/_icon.png/;
- my ($draw_text, $width, $height, $y_start, $title, @text);
+ my ($draw_text, $width, $height, $border, $y_start, @text);
-e $pl and $draw_text = 1;
eval(cat_($pl)) if $draw_text;
my $pix = gtkcreate_pixbuf($f);
@@ -531,20 +531,15 @@ sub installPackages {
$pix->render_to_drawable($darea->window, $darea->style->bg_gc('normal'), 0, 0,
($dx-$width)/2, 0, $width, $height, 'none', 0, 0);
- my ($width, $lines, $widths, $heights) = wrap_paragraph([ $title, '', @text ], $darea, 520);
- my $i = 0;
- foreach (@$lines) {
- my $layout = $darea->create_pango_layout($_);
+ my @lines = wrap_paragraph([ @text ], $darea, $border, $width);
+ foreach my $line (@lines) {
+ my $layout = $darea->create_pango_layout($line->{text});
my $draw_lay = sub {
my ($gc, $decx) = @_;
- $darea->window->draw_layout($gc,
- ($dx-$width)/2 + $widths->[$i] + $decx,
- $y_start + $heights->[$i],
- $layout);
+ $darea->window->draw_layout($gc, $line->{'x'} + $decx, $y_start + $line->{'y'}, $layout);
};
$draw_lay->($darea->style->black_gc, 0);
- $i == 0 and $draw_lay->($darea->style->black_gc, 1);
- $i++;
+ $line->{options}{bold} and $draw_lay->($darea->style->black_gc, 1);
}
}
}));