summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-02-17 11:16:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-02-17 11:16:11 +0000
commite6cb66c6cd279bdef3cfc247e9f315dd834496ae (patch)
tree354afe3de538f70c50c603b6eee503dc6cb9fe46 /perl-install
parent0ba55bb1251279fc006d58453ab0d2c902f8af36 (diff)
downloaddrakx-e6cb66c6cd279bdef3cfc247e9f315dd834496ae.tar
drakx-e6cb66c6cd279bdef3cfc247e9f315dd834496ae.tar.gz
drakx-e6cb66c6cd279bdef3cfc247e9f315dd834496ae.tar.bz2
drakx-e6cb66c6cd279bdef3cfc247e9f315dd834496ae.tar.xz
drakx-e6cb66c6cd279bdef3cfc247e9f315dd834496ae.zip
don't have a scroll inside a scroll which causes display pbs.
alas it doesn't fix the "Tab" navigation when having a global scroll + a Listbox. You have to use the right arrow to exit the Listbox
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/interactive/newt.pm30
1 files changed, 19 insertions, 11 deletions
diff --git a/perl-install/interactive/newt.pm b/perl-install/interactive/newt.pm
index 79dd93eba..b08b9b0b2 100644
--- a/perl-install/interactive/newt.pm
+++ b/perl-install/interactive/newt.pm
@@ -97,7 +97,7 @@ sub ask_fromW {
}
sub ask_fromW_real {
- my ($_o, $common, $l, $l2) = @_;
+ my ($o, $common, $l, $l2) = @_;
my $ignore; #-to handle recursivity
my $old_focus = -2;
@@ -166,10 +166,12 @@ sub ask_fromW_real {
};
$size = $count->($data_tree);
- my ($h) = @l == 1 && $height > 30 ? 10 : 5;
- my $scroll = $size > $h;
- $has_scroll = 1;
- $size = min($size, $h);
+ my $prefered_size = @l == 1 && $height > 30 ? 10 : 5;
+ my $scroll;
+ if ($size > $prefered_size && !$o->{no_individual_scroll}) {
+ $has_scroll = $scroll = 1;
+ $size = $prefered_size;
+ }
$w = Newt::Component::Tree($size, $scroll);
@@ -215,12 +217,15 @@ sub ask_fromW_real {
1;
};
} elsif ($e->{type} =~ /list/) {
- my ($h) = @l == 1 && $height > 30 ? 10 : 5;
- my $scroll = @{$e->{list}} > $h ? 1 << 2 : 0;
- $has_scroll = 1;
- $size = min(int @{$e->{list}}, $h);
+ $size = @{$e->{list}};
+ my ($prefered_size) = @l == 1 && $height > 30 ? 10 : 5;
+ my $scroll;
+ if ($size > $prefered_size && !$o->{no_individual_scroll}) {
+ $has_scroll = $scroll = 1;
+ $size = $prefered_size;
+ }
- $w = Newt::Component::Listbox($size, $scroll); #- NEWT_FLAG_SCROLL
+ $w = Newt::Component::Listbox($size, $scroll ? 1 << 2 : 0); #- NEWT_FLAG_SCROLL
my @l = map {
my $t = simplify_string(may_apply($e->{format}, $_), $width - 10);
@@ -280,7 +285,10 @@ sub ask_fromW_real {
if (@l > 3 && $total_size > $height_avail) {
$grid->GridPlace(1, 1); #- Uh?? otherwise the size allocated is bad
if ($has_scroll) {
- #- :'-(
+ #- trying again with no_individual_scroll set
+ $o->{no_individual_scroll} and internal_error('no_individual_scroll already set, argh...');
+ $o->{no_individual_scroll} = 1;
+ goto &ask_fromW_real; #- same player shoot again!
}
$has_scroll = 1;
$total_size = $height_avail;