summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_gtk.pm
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-01-11 18:37:54 +0000
committerdamien <damien@mandriva.com>2002-01-11 18:37:54 +0000
commitd35bc8533949fe72cf77712a9e0250fd0e579fc9 (patch)
tree62c904da58e6b32c8b251f79a46e0dcf66b7d334 /perl-install/install_steps_gtk.pm
parentd4a1e20bfd2ee92b5975336380d8f96dc7b320c3 (diff)
downloaddrakx-d35bc8533949fe72cf77712a9e0250fd0e579fc9.tar
drakx-d35bc8533949fe72cf77712a9e0250fd0e579fc9.tar.gz
drakx-d35bc8533949fe72cf77712a9e0250fd0e579fc9.tar.bz2
drakx-d35bc8533949fe72cf77712a9e0250fd0e579fc9.tar.xz
drakx-d35bc8533949fe72cf77712a9e0250fd0e579fc9.zip
advertising engine works !
champagne. still some display bugs, but they will be corrected later. need new ads and adequat description file
Diffstat (limited to 'perl-install/install_steps_gtk.pm')
-rw-r--r--perl-install/install_steps_gtk.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 4221e15e1..fdeaf5fae 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -536,12 +536,15 @@ sub installPackages {
my $f = $install_any::advertising_images[$i++ % @install_any::advertising_images];
log::l("advertising $f");
my $pl = $f; $pl =~ s/\.png$/\.pl/;
- my ($width, $height, @data);
- eval(cat_($pl));
+ my ($draw_text, $width, $height, @data);
+ -e $pl and $draw_text = 1;
+ eval(cat_($pl)) if $draw_text;
my ($pix, undef) = gtkcreate_png($f);
my $dbl_area;
my $darea = new Gtk::DrawingArea;
- gtkpack($box, $advertising = gtksignal_connect(gtkset_usize($darea, $width, $height), expose_event => sub {
+ gtkpack($box, $advertising = !$draw_text ?
+ gtkpng($f) :
+ gtksignal_connect(gtkset_usize($darea, $width, $height), 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'),
@@ -549,14 +552,15 @@ sub installPackages {
my $gc_text = new Gtk::Gdk::GC($darea->window);
$gc_text->set_foreground(gtkcolor(65535, 65535, 65535));
foreach (@data) {
+ my ($text, $x, $y, $area_width, $area_height) = @$_;
my ($width, $height, $lines, $widths, $heights, $ascents, $descents) =
- get_text_coord ($_->[0], $darea->style, $_->[3], $_->[4], 1, 0, 1, 1);
+ get_text_coord ($text, $darea->style, $area_width, $area_height, 1, 0, 1, 1);
my $i = 0;
foreach (@{$lines}) {
$dbl_area->draw_string($darea->style->font, $gc_text,
- ${$widths}[$i], ${$heights}[$i], $_);
+ $x + ${$widths}[$i], $y + ${$heights}[$i], $_);
$dbl_area->draw_string($darea->style->font, $gc_text,
- ${$widths}[$i] + 1, ${$heights}[$i], $_);
+ $x + ${$widths}[$i] + 1, $y + ${$heights}[$i], $_);
$i++;
}
}