diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-07-29 14:44:09 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-07-29 14:44:09 +0000 |
commit | b6f82e7dd09c4a0cba68e8547f9aec3fe571d884 (patch) | |
tree | aa1df6c6a452ac603b0e9c5a143df02660e750c6 /perl-install | |
parent | 0093dfc4c1ecbf921e1cb3aa72f85925842cb25d (diff) | |
download | drakx-b6f82e7dd09c4a0cba68e8547f9aec3fe571d884.tar drakx-b6f82e7dd09c4a0cba68e8547f9aec3fe571d884.tar.gz drakx-b6f82e7dd09c4a0cba68e8547f9aec3fe571d884.tar.bz2 drakx-b6f82e7dd09c4a0cba68e8547f9aec3fe571d884.tar.xz drakx-b6f82e7dd09c4a0cba68e8547f9aec3fe571d884.zip |
labels are not able to correctly handle long texts, so rollback to using
TextView instead.
For information on this pb:
- IHM team doesn't like TextView because the text can be selected, and a
contextual menu is available
- IHM team doesn't like the difference between small text (using a Label) and
longer text (using a TextView)
- Label can wrap automatically but not nicely (it doesn't use the full width)
- Label can't wrap CJK text which have no spaces
Apart from this Label vs TextView pb, Titi only left some code which takes
care of small text, causing the text to be wrapped using warp_text (which is
not proportional font aware) and not using a scrolled window (causing the
license to take more than the screen, the buttons disappearing at the bottom
of the screen)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/ugtk2.pm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 3e0cf0988..abc66d95c 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -304,6 +304,21 @@ sub create_box_with_title { return $box; } $o->{box_size} = n_line_size($nbline, 'text', $box); + if (@_ <= 2 && ($nbline > 4 || ($nbline > 1 && ref($::o) && member($::o->{locale}{lang}, qw(ja))))) { + $o->{icon} && !$::isWizard and + eval { gtkpack__($box, gtkset_border_width(gtkpack_(Gtk2::HBox->new(0,0), 1, gtkcreate_img($o->{icon})),5)) }; + my $wanted = $o->{box_size}; + $o->{box_size} = min(200, $o->{box_size}); + my $has_scroll = $o->{box_size} < $wanted; + + my $wtext = Gtk2::TextView->new; + $wtext->set_left_margin(3); + $wtext->can_focus($has_scroll); + chomp(my $text = join("\n", @_)); + my $scroll = create_scrolled_window(gtktext_insert($wtext, $text)); + $scroll->set_size_request(400, $o->{box_size}); + gtkpack($box, $scroll); + } else { my $a = !$::no_separator; undef $::no_separator; if ($o->{icon} && (!$::isWizard || $::isInstall)) { @@ -337,6 +352,7 @@ sub create_box_with_title { if_($a, Gtk2::HSeparator->new) ) } + } } sub _create_dialog { |