summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_gtk.pm
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-12-17 18:27:05 +0000
committerdamien <damien@mandriva.com>2001-12-17 18:27:05 +0000
commit216b34fe5c11975bca9feb2c31912d4281b023bb (patch)
treebe60f432444d6f76f34d68a19cae0188d3f6296d /perl-install/install_steps_gtk.pm
parent39e245aba1359c916866258fd7eeb96a280cc617 (diff)
downloaddrakx-216b34fe5c11975bca9feb2c31912d4281b023bb.tar
drakx-216b34fe5c11975bca9feb2c31912d4281b023bb.tar.gz
drakx-216b34fe5c11975bca9feb2c31912d4281b023bb.tar.bz2
drakx-216b34fe5c11975bca9feb2c31912d4281b023bb.tar.xz
drakx-216b34fe5c11975bca9feb2c31912d4281b023bb.zip
power graphical backend update : text is now centered
Diffstat (limited to 'perl-install/install_steps_gtk.pm')
-rw-r--r--perl-install/install_steps_gtk.pm32
1 files changed, 31 insertions, 1 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index f3edb9923..1d4d7a58c 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -532,7 +532,37 @@ sub installPackages {
$change_time = time();
my $f = $install_any::advertising_images[$i++ % @install_any::advertising_images];
log::l("advertising $f");
- eval { gtkpack($box, $advertising = gtkpng($f)) };
+ eval { my $pl = $f; $pl =~ s/\.png$/\.pl/;
+ my ($width, $height, @data);
+ eval(cat_($pl));
+ my ($pix, undef) = gtkcreate_png($f);
+ my $dbl_area;
+ my $darea = new Gtk::DrawingArea
+ gtkpack($box, $advertising = gtksignal_connect(gtkset_usize($darea, $width, eight), expose_event => sub {
+ if (!defined($dbl_area)) {
+ $dbl_area = new Gtk::Gdk::Pixmap($darea->window, $width, $height);
+ $dbl_area->draw_pixmap($darea->style->bg_gc('normal'),
+ $pix, 0, 0, $width, $height);
+ my $font = $darea->style->font;
+ my $style= new Gtk::Style;
+ $style->font(Gtk::Gdk::Font->fontset_load($font));
+ my $gc_text = new Gtk::Gdk::GC($darea->window);
+ $gc_text->set_foreground(gtkcolor(255, 255, 255));
+ foreach (@data) {
+ my ($width, $height, $lines, $widths, $heights, $ascents, $descents) = get_text_coord (
+ $_->[0], $style, $_->[3], $_->[4], 0, 1, 0);
+ my $i = 0;
+ foreach (@{$lines}) {
+ $dbl_area->draw_string($style->font, $gc_text, ${$widths}[$i], ${$ascents}[$i] + ${$heights}[$i], $_);
+ $i++;
+ }
+ }
+ } else {
+ $darea->window->draw_pixmap($darea->style->bg_gc('normal'),
+ $dbl_area, 0, 0, 0, 0, $width, $height);
+ }
+ }));
+ }
} else {
$advertising = undef;
}