summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive/curses.pm
diff options
context:
space:
mode:
authorThierry.Vignaud <thierry.vignaud@gmail.com>2014-05-28 22:37:23 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-05-28 22:37:23 +0200
commitdf74e103d8de6d7cc45cc3e2a99f4b9c8fff6085 (patch)
tree3ce05fa2bbad4d01d0df7a268abab40315b72e22 /perl-install/interactive/curses.pm
parentac656a1c73103b06962ab6199da16a8607528c19 (diff)
downloaddrakx-df74e103d8de6d7cc45cc3e2a99f4b9c8fff6085.tar
drakx-df74e103d8de6d7cc45cc3e2a99f4b9c8fff6085.tar.gz
drakx-df74e103d8de6d7cc45cc3e2a99f4b9c8fff6085.tar.bz2
drakx-df74e103d8de6d7cc45cc3e2a99f4b9c8fff6085.tar.xz
drakx-df74e103d8de6d7cc45cc3e2a99f4b9c8fff6085.zip
simplify using member()
Diffstat (limited to 'perl-install/interactive/curses.pm')
-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 7b81e9e09..b2dc94bc4 100644
--- a/perl-install/interactive/curses.pm
+++ b/perl-install/interactive/curses.pm
@@ -177,7 +177,7 @@ sub compute_size {
$e->{curses}{'-width'} ||= length($s);
} elsif ($e->{type} eq 'expander') {
$e->{curses}{'-width'} ||= length("<+> $e->{text}");
- } elsif ($e->{type} eq 'text' || $e->{type} eq 'label' || $e->{type} eq 'only_label') {
+ } elsif (member($e->{type}, qw(text label only_label))) {
my @text = _messages(min(80, $width_avail - 1), ${$e->{val}}); #- -1 because of the scrollbar
$e->{curses}{'-focusable'} = 0;
$e->{curses}{'-height'} ||= heights(int(@text), 10, 4);
@@ -352,7 +352,7 @@ sub create_widget {
$w->set_binding('focus-up', Curses::KEY_LEFT());
$w->set_binding('focus-down', Curses::KEY_RIGHT());
$set = sub { $w->set_label(0, sprintf('< %s >', may_apply($e->{format}, $_[0]))) };
- } elsif ($e->{type} eq 'list' || $e->{type} eq 'combo') {
+ } elsif (member($e->{type}, qw(list combo))) {
$w = $win->add(undef, $e->{type} eq 'combo' ? 'Popupmenu' : 'Listbox',
'-values' => $e->{formatted_list},
'-onchange' => $onchange->(sub { $e->{list}[$w->id] }),
@@ -405,7 +405,7 @@ sub create_widget {
} elsif ($e->{type} eq 'label' && $e->{curses}{'-height'} == 1) {
$w = $win->add(undef, 'Label', %options);
$set = sub { $w->text($_[0] || '') };
- } elsif ($e->{type} eq 'label' || $e->{type} eq 'only_label' || $e->{type} eq 'text') {
+ } elsif (member($e->{type}, qw(label only_label text))) {
$w = $win->add(undef, 'TextViewer', %options);
$set = sub {
my ($text) = @_;