diff options
Diffstat (limited to 'perl-install/bootlook.pm')
-rw-r--r-- | perl-install/bootlook.pm | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/perl-install/bootlook.pm b/perl-install/bootlook.pm index f5ad0cddc..75c772f60 100644 --- a/perl-install/bootlook.pm +++ b/perl-install/bootlook.pm @@ -22,6 +22,7 @@ use MDK::Common; use Gtk; +use Gtk::Gdk::Pixbuf; use Config; init Gtk; use POSIX; @@ -102,7 +103,8 @@ my %themes = ('path'=>'/usr/share/bootsplash/themes/', 'lilo'=>{'file'=>'/lilo/message', 'thumb'=>'/lilo/thumb.png'} , 'boot'=>{'path'=>'/images/', - 'thumb'=>'/images/thumb.png',}, + #'thumb'=>'/images/thumb.png', + }, ); my ($cur_res) = cat_('/etc/lilo.conf') =~ /vga=(.*)/; @@ -137,9 +139,12 @@ foreach (keys (%combo)) { $combo{'thms'}->set_popdown_strings(@thms); $combo{'lilo'}->set_popdown_strings(@lilo_thms); $combo{'boot'}->set_popdown_strings(@boot_thms); +my $lilo_pixbuf = new_from_file Gtk::Gdk::Pixbuf($themes{'def_thmb'}); +my $lilo_pic = new Gtk::Pixmap($lilo_pixbuf->render_pixmap_and_mask(0),'');#gtkcreate_png($themes{'def_thmb'})); + +my $boot_pixbuf = new_from_file Gtk::Gdk::Pixbuf($themes{'def_thmb'}); +my $boot_pic = new Gtk::Pixmap($boot_pixbuf->render_pixmap_and_mask(0),'');#gtkcreate_png($themes{'def_thmb'})); -my $lilo_pic = new Gtk::Pixmap(gtkcreate_png($themes{'def_thmb'})); -my $boot_pic = new Gtk::Pixmap(gtkcreate_png($themes{'def_thmb'})); my $thm_button = new Gtk::Button(_("Install themes")); my $logo_thm = new Gtk::CheckButton(_("Display theme under console")); my $B_create = new Gtk::Button(_("Create new theme")); @@ -160,15 +165,17 @@ $combo{'thms'}->entry->signal_connect(changed => sub { $combo{'lilo'}->entry->signal_connect(changed => sub { my $new_file = $themes{'path'} . $combo{'lilo'}->entry->get_text() . $themes{'lilo'}{'thumb'}; - $lilo_pic->set(gtkcreate_png(-r $new_file ? $new_file : $themes{'def_thmb'})); + undef($lilo_pixbuf); + $lilo_pixbuf = new_from_file Gtk::Gdk::Pixbuf(-r $new_file ? $new_file : $themes{'def_thmb'}); + $lilo_pic->set($lilo_pixbuf->render_pixmap_and_mask(0),''); }); $combo{'boot'}->entry->signal_connect( changed => sub { - my $new_file = $themes{'path'}.$combo{'boot'}->entry->get_text().$themes{'boot'}{'thumb'}; - if (! -f $new_file && -f $themes{'path'}.$combo{'boot'}->entry->get_text().$themes{'boot'}{'path'}."bootsplash-$cur_res.jpg"){ - system("convert -scale 159x119 ".$themes{'path'}.$combo{'boot'}->entry->get_text().$themes{'boot'}{'path'}."bootsplash-$cur_res.jpg $new_file") and $in->ask_warn(_("Error"),_("Can't create Bootsplash preview")); - } - $boot_pic->set(gtkcreate_png(-r $new_file ? $new_file : $themes{'def_thmb'})); + local $img_file = $themes{'path'}.$combo{'boot'}->entry->get_text().$themes{'boot'}{'path'}."bootsplash-$cur_res.jpg"; + undef($boot_pixmap); + $boot_pixmap = new_from_file Gtk::Gdk::Pixbuf(-r $new_file ? $new_file : $img_file); + $boot_pixmap = $boot_pixmap->scale_simple(159,119,0); + $boot_pic->set($boot_pixmap->render_pixmap_and_mask(0),''); }); $combo{'thms'}->entry->set_text($themes{'default'}); |