diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-08-20 09:04:08 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-08-20 09:04:08 +0000 |
commit | 17dc93426b1f7aec4c180268713e9dc07388d8af (patch) | |
tree | f3d1073ab7e8a5b7ea077ca72cac0c5b5c706b84 /perl-install/interactive | |
parent | 837440ddd16018431ab121c36c0dbc18e6b8b3f3 (diff) | |
download | drakx-backup-do-not-use-17dc93426b1f7aec4c180268713e9dc07388d8af.tar drakx-backup-do-not-use-17dc93426b1f7aec4c180268713e9dc07388d8af.tar.gz drakx-backup-do-not-use-17dc93426b1f7aec4c180268713e9dc07388d8af.tar.bz2 drakx-backup-do-not-use-17dc93426b1f7aec4c180268713e9dc07388d8af.tar.xz drakx-backup-do-not-use-17dc93426b1f7aec4c180268713e9dc07388d8af.zip |
(create_widget) enable to render Buttons with new 'advanced' install style
Diffstat (limited to 'perl-install/interactive')
-rw-r--r-- | perl-install/interactive/gtk.pm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 9e734c3a1..763f7897a 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -394,11 +394,18 @@ sub create_widget { } elsif ($e->{type} eq 'empty') { $w = gtknew('HBox', height => $e->{height}); } elsif ($e->{type} eq 'button') { - $w = gtknew('Button', + $w = gtknew(($e->{install_button} ? 'Install_Button' : 'Button'), text => '', clicked => $e->{clicked_may_quit_cooked}); - # guard against 'advanced' widgets that are now in their own dialog - # (instead of in another block child of an expander) - $set = sub { $w->child && $w->child->set_label(may_apply($e->{format}, $_[0])) }; + $set = sub { + my $w = $w->child; + # handle Install_Buttons: + if (ref($w) =~ /Gtk2::HBox/) { + ($w) = grep { ref($_) =~ /Gtk2::Label/ } $w->get_children; + }; + # guard against 'advanced' widgets that are now in their own dialog + # (instead of in another block child of an expander): + return if !$w; + $w->set_label(may_apply($e->{format}, $_[0])) }; } elsif ($e->{type} eq 'range') { my $adj = Gtk2::Adjustment->new(${$e->{val}}, $e->{min}, $e->{max} + ($e->{SpinButton} ? 0 : 1), 1, ($e->{max} - $e->{min}) / 10, 1); $w = $e->{SpinButton} ? Gtk2::SpinButton->new($adj, 10, 0) : Gtk2::HScale->new($adj); |