diff options
-rwxr-xr-x | control-center | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/control-center b/control-center index 0f878dd4..4fa51d37 100755 --- a/control-center +++ b/control-center @@ -780,6 +780,32 @@ sub clean_list { } @$subtree; } +sub build_widget_element { + my ($label) = @_; + my $icon = $programs{$label}{icon}; + + die "$label 's icon is missing" if !$programs{$label} && $::testing; + $tool_callbacks{$label} = sub { + run_tool($label, undef, #$event_box, + $icon, $programs{$label}{description}, $programs{$label}); + }; + # FIX ME: DO THIS AGAIN: + $tool_feedback{$label} = sub {}; #sub { $event_box->window && $event_box->window->set_cursor($hand_cursor) }; + my $real_icon = $icon ? '<IMG SRC="' . ugtk2::_find_imgfile($icon) . '">' : ''; + my @widgets = ( + qq(<TD>$real_icon</TD>), + qq(<TD style="text-align: $align"><DIV>) + . escape_text_for_TextView_markup_format($programs{$label}{description}) + . qq(</DIV></TD>) + ); + @widgets = reverse @widgets if mygtk2::text_direction_rtl(); + qq(<TD WIDTH="49%"> +<A HREF="$label"><TABLE align="$align2"><TR> +@widgets +</TR></TABLE></A></TD> +); +} + sub build_list() { my $i; foreach (@tree) { @@ -856,31 +882,7 @@ foreach (@tree) { map { "<TR>" . join("\n", grep { defined $_ } @$_) . "</TR>" } # "<TR>" . join("\n<TD> </TD>\n", grep { defined $_ } @$_) . "</TR>" } - group_by(2, map { - my $label = $_; - my $icon = $programs{$label}{icon}; - - die "$label 's icon is missing" if !$programs{$label} && $::testing; - $tool_callbacks{$label} = sub { - run_tool($label, undef, #$event_box, - $icon, $programs{$label}{description}, $programs{$label}); - }; - # FIX ME: DO THIS AGAIN: - $tool_feedback{$label} = sub {}; #sub { $event_box->window && $event_box->window->set_cursor($hand_cursor) }; - my $real_icon = $icon ? '<IMG SRC="' . ugtk2::_find_imgfile($icon) . '">' : ''; - my @widgets = ( - qq(<TD>$real_icon</TD>), - qq(<TD style="text-align: $align"><DIV>) - . escape_text_for_TextView_markup_format($programs{$label}{description}) - . qq(</DIV></TD>) - ); - @widgets = reverse @widgets if mygtk2::text_direction_rtl(); - qq(<TD WIDTH="49%"> -<A HREF="$label"><TABLE align="$align2"><TR> -@widgets -</TR></TABLE></A></TD> -); - } @{$subtree->{list}}) + group_by(2, map { build_widget_element($_) } @{$subtree->{list}}) ); $string .= "</TABLE>\n"; |