diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-02-19 16:54:38 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-02-19 16:54:38 +0000 |
commit | 9e10315b75a8052b0ffa224b415226785810acf6 (patch) | |
tree | 1e32b3f2ca35fb829a15a9cfc2caae4b9defff25 /perl-install/interactive/gtk.pm | |
parent | 46c818d60087c1e79e4ac2121edd7d776c01d50b (diff) | |
download | drakx-backup-do-not-use-9e10315b75a8052b0ffa224b415226785810acf6.tar drakx-backup-do-not-use-9e10315b75a8052b0ffa224b415226785810acf6.tar.gz drakx-backup-do-not-use-9e10315b75a8052b0ffa224b415226785810acf6.tar.bz2 drakx-backup-do-not-use-9e10315b75a8052b0ffa224b415226785810acf6.tar.xz drakx-backup-do-not-use-9e10315b75a8052b0ffa224b415226785810acf6.zip |
don't have a big scrolled window that can be around a local scrolled window.
ensure instead many local scrolled windows
Diffstat (limited to 'perl-install/interactive/gtk.pm')
-rw-r--r-- | perl-install/interactive/gtk.pm | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index 4f074137e..a8783e347 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -603,7 +603,10 @@ sub ask_fromW { my $set_advanced = sub { ($advanced) = @_; $update->($common->{callbacks}{advanced}) if $advanced && !$first_time; - $advanced ? $_->{real_w}->show : $_->{real_w}->hide foreach @before_widgets_advanced, @widgets_advanced; + foreach (@before_widgets_advanced, @widgets_advanced) { + my $w = $_->{embed_scroll} || $_->{real_w}; + $advanced ? $w->show : $w->hide; + } @widgets = (@widgets_always, if_($advanced, @widgets_advanced)); $mainw->sync; #- for $set_all below (mainly for the set of clist) $first_time = 0; @@ -626,13 +629,35 @@ sub ask_fromW { $advanced_button->[0] = $common->{advanced_label_close}; } my $buttons_pack = ($common->{ok} || !exists $common->{ok}) && $mainw->create_okcancel($common->{ok}, $common->{cancel}, '', @help, if_(@$l2, $advanced_button)); + + my @widgets_to_pack; + foreach my $l (\@widgets_always, if_(@widgets_advanced, [ @before_widgets_advanced, @widgets_advanced ])) { + my @grouped; + my $add_grouped = sub { + if (@grouped == 0) { + push @widgets_to_pack, 1 => Gtk2::VBox->new(0,0) if @$l == 0; + } elsif (@grouped == 1 && @$l > 1) { + push @widgets_to_pack, 0 => $grouped[0]{real_w}; + } else { + my $scroll = create_scrolled_window(gtkpack__(Gtk2::VBox->new(0,0), map { $_->{real_w} } @grouped), + [ 'automatic', 'automatic' ], 'none'); + $_->{embed_scroll} = $scroll foreach @grouped; + push @widgets_to_pack, 1 => $scroll; + } + @grouped = (); + }; + foreach (@$l) { + if ($_->{grow}) { + $add_grouped->(); + push @widgets_to_pack, 1 => $_->{real_w}; + } else { + push @grouped, $_; + } + } + $add_grouped->(); + } - gtkpack($pack, - create_scrolled_window(gtkpack_(Gtk2::VBox->new(0,0), - (map { $_->{grow}, $_->{real_w} } - @widgets_always, - if_(@widgets_advanced, @before_widgets_advanced, @widgets_advanced))), - [ 'automatic', 'automatic' ], 'none')) if @$l || !$mainw->{pop_it}; + gtkpack_($pack, @widgets_to_pack); if ($buttons_pack) { if ($::isWizard && !$mainw->{pop_it} && $::isInstall) { |