summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-10-08 15:09:08 +0000
committerThierry Vignaud <tv@mandriva.org>2008-10-08 15:09:08 +0000
commit818d822ea4825e85a58be128bbd2de8db5e44266 (patch)
tree5735e0a358eece8c2279e91375183b28af5430e7 /perl-install/interactive
parent8cbcb1f65e4f802a5dab2b7a0d791fe7a53307ff (diff)
downloaddrakx-818d822ea4825e85a58be128bbd2de8db5e44266.tar
drakx-818d822ea4825e85a58be128bbd2de8db5e44266.tar.gz
drakx-818d822ea4825e85a58be128bbd2de8db5e44266.tar.bz2
drakx-818d822ea4825e85a58be128bbd2de8db5e44266.tar.xz
drakx-818d822ea4825e85a58be128bbd2de8db5e44266.zip
(compute_sizes,filter_widget) properly handle big text in list such as
security level descriptions (#43561)
Diffstat (limited to 'perl-install/interactive')
-rw-r--r--perl-install/interactive/curses.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/perl-install/interactive/curses.pm b/perl-install/interactive/curses.pm
index b8da3c29a..b33caaad9 100644
--- a/perl-install/interactive/curses.pm
+++ b/perl-install/interactive/curses.pm
@@ -80,7 +80,7 @@ sub filter_widget {
#- combo does not allow modifications
$e->{type} = 'entry' if $e->{type} eq 'combo' && !$e->{not_edit};
- $e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ];
+ $e->{formatted_list} = [ map { my $t = warp_text(may_apply($e->{format}, $_), 80); $t } @{$e->{list}} ];
$e->{default_curses} ||= delete $e->{curses};
}
@@ -163,8 +163,8 @@ sub compute_size {
$e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(@{$e->{formatted_list}}), 10, 4);
$e->{curses}{'-width'} ||= max(map { length } @{$e->{formatted_list}}) + 7;
} elsif ($e->{type} =~ /list/) {
- $e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(@{$e->{formatted_list}}), 5, 4);
- $e->{curses}{'-width'} ||= max(map { length } @{$e->{formatted_list}}) + 3;
+ $e->{curses}{'-height'} ||= heights(map { $_ + 2 } int(map { split("\n", $_) } @{$e->{formatted_list}}), 5, 4);
+ $e->{curses}{'-width'} ||= max(map { length } map { split("\n", $_) } @{$e->{formatted_list}}) + 3;
} elsif ($e->{type} eq 'button') {
my $s = sprintf('< %s >', may_apply($e->{format}, ${$e->{val}}));
$e->{curses}{'-width'} ||= length($s);