From aeb3d3d73bdd0c098fd4011bd2be3907341a94a4 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 22 Aug 2008 13:45:31 +0000 Subject: (create_widgets_block) add support for new 'alignment' parameter (only 'right' value is supported for now) --- perl-install/interactive.pm | 1 + perl-install/interactive/gtk.pm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index d8014f679..f6bf95127 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -45,6 +45,7 @@ use do_pkgs; #- validate => function called when "Ok" is pressed. If it returns false, this entry is focused, otherwise it quits #- disabled => function returning wether it should be disabled (grayed) #- focus => function returning wether it should be focused +#- alignment => preferred alignment #- do_not_expand => do not eat all horizontal space #- install_button => if possible, use improved graphical style #- gtk => gtk preferences diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index f3240474b..1330fb0dd 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -622,10 +622,13 @@ sub create_widgets_block { ]); } + my $eater = gtknew('Label') if $e->{alignment} eq 'right'; + $e->{real_w} = gtkpack_(Gtk2::HBox->new, if_($e->{icon}, 0, eval { gtkcreate_img($e->{icon}) }), if_($label_w, 0, $label_w), - (1, $e->{real_w}), + if_($eater, 1, $eater), + (!$eater, $e->{real_w}), ); } gtknew('VBox', children => [ map { $_->{grow} || 0, $_->{real_w} } @$l ]); -- cgit v1.2.1