diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-09-17 19:00:55 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-09-17 19:00:55 +0000 |
commit | 04dee177fa057726c04b3956812a8fc4dd4d8e88 (patch) | |
tree | 38c1cfa6b25e3acd7e339196aba6bf2c9b112942 /perl-install/interactive | |
parent | d1ce6f73e11c9353ae9146fd9ae864c1806889f1 (diff) | |
download | drakx-04dee177fa057726c04b3956812a8fc4dd4d8e88.tar drakx-04dee177fa057726c04b3956812a8fc4dd4d8e88.tar.gz drakx-04dee177fa057726c04b3956812a8fc4dd4d8e88.tar.bz2 drakx-04dee177fa057726c04b3956812a8fc4dd4d8e88.tar.xz drakx-04dee177fa057726c04b3956812a8fc4dd4d8e88.zip |
(create_widget,create_widgets_block) better layout for right aligned widgets
Diffstat (limited to 'perl-install/interactive')
-rw-r--r-- | perl-install/interactive/gtk.pm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index d6780f826..f31793980 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -403,7 +403,7 @@ sub create_widget { ); $w = $e->{title} ? gtknew('Title2', label => escape_text_for_TextView_markup_format(${$e->{val}}), @common) : - gtknew('Label_Left', + gtknew($e->{alignment} eq 'right' ? 'Label_Right' : 'Label_Left', line_wrap => 1, text_markup => ${$e->{val}}, @common); } elsif ($e->{type} eq 'label') { $w = gtknew('WrappedLabel', text_markup => ${$e->{val}}); @@ -616,6 +616,7 @@ sub create_widgets_block { my ($o, $common, $l, $update, $ignore_ref) = @_; my $label_sizegrp = Gtk2::SizeGroup->new('horizontal'); + my $right_label_sizegrp = Gtk2::SizeGroup->new('horizontal'); my $realw_sizegrp = Gtk2::SizeGroup->new('horizontal'); @$l = map_index { @@ -638,8 +639,9 @@ sub create_widgets_block { my $label_w; if ($e->{label} || !$e->{no_indent}) { - $label_w = gtknew('Label_Left', text_markup => $e->{label} || '', - if_($e->{alignment} ne 'right', size_group => $label_sizegrp), alignment => [ 0, 0.5 ]); + $label_w = gtknew($e->{alignment} eq 'right' ? 'Label_Right' : 'Label_Left', text_markup => $e->{label} || '', + size_group => ($e->{alignment} eq 'right' ? $right_label_sizegrp : $label_sizegrp), + ); $realw_sizegrp->add_widget($e->{real_w}); } @@ -650,13 +652,10 @@ 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_($eater, 1, $eater), - if_($label_w, 0, $label_w), - (!$eater, $e->{real_w}), + if_($label_w, $e->{alignment} eq 'right', $label_w), + (1, $e->{real_w}), ); } gtknew('VBox', children => [ map { $_->{grow} || 0, $_->{real_w} } @$l ]); |