summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center9
1 files changed, 5 insertions, 4 deletions
diff --git a/control-center b/control-center
index b7689356..38a7972f 100755
--- a/control-center
+++ b/control-center
@@ -1237,7 +1237,7 @@ foreach (@tree) {
# Create right notebook pages :
my $tbl = create_packtable({ col_spacings => $spacing, row_spacings => $spacing, homogeneous => 1, mcc => 1 },
- group_by3(map {
+ group_by($option_values{use_long_dscr} ? 2 : 3, map {
my $label = $_;
my $icon = $programs{$label}{icon};
my $text = $option_values{use_long_dscr} ? $programs{$label}{long_description} : $programs{$label}{description};
@@ -1365,10 +1365,11 @@ if ($program) {
Gtk2->main;
-sub group_by3 {
+sub group_by {
+ my $nb = shift @_;
my @l;
- for (my $i = 0; $i < @_; $i += 3) {
- push @l, [ $_[$i], $_[$i+1], $_[$i+2] ];
+ for (my $i = 0; $i < @_; $i += $nb) {
+ push @l, [ map { $_[$_] } $i..$i+$nb-1 ], # $_[$i], $_[$i+1], $_[$i+2] ];
}
@l;
}