summaryrefslogtreecommitdiffstats
path: root/perl-install/my_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-21 23:08:33 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-21 23:08:33 +0000
commit723e9abb3bf09a1764fd4b5f56aeb7af6319b314 (patch)
tree0f0b2b42582e8510ed16a257a5120b8f5724ef98 /perl-install/my_gtk.pm
parentb99d9f882ae0be783ab990a304dcb3f50cbf9685 (diff)
downloaddrakx-723e9abb3bf09a1764fd4b5f56aeb7af6319b314.tar
drakx-723e9abb3bf09a1764fd4b5f56aeb7af6319b314.tar.gz
drakx-723e9abb3bf09a1764fd4b5f56aeb7af6319b314.tar.bz2
drakx-723e9abb3bf09a1764fd4b5f56aeb7af6319b314.tar.xz
drakx-723e9abb3bf09a1764fd4b5f56aeb7af6319b314.zip
hopefully better dialog box sizing
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r--perl-install/my_gtk.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 54f029e89..ad5c61f24 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -677,20 +677,21 @@ sub create_okcancel {
sub create_box_with_title($@) {
my $o = shift;
- $o->{box_size} = sum(map { round(length($_) / 60 + 1/2) } map { split "\n" } @_);
+ my $nbline = sum(map { round(length($_) / 60 + 1/2) } map { split "\n" } @_);
$o->{box} = new Gtk::VBox(0,0);
- if (@_ <= 2 && $o->{box_size} > 4) {
+ $o->{box_size} = n_line_size($nbline, 'text', $o->{box});
+ if (@_ <= 2 && $nbline > 4) {
$o->{icon} && !$::isWizard and
- eval { gtkpack__($o->{box}, gtkset_border_width(gtkpack_(new Gtk::HBox(0,0), 1, gtkpng($o->{icon})),5)); };
- my $wanted = n_line_size($o->{box_size}, 'text', $o->{box});
- my $height = min(250, $wanted);
- my $has_scroll = $height < $wanted;
+ eval { gtkpack__($o->{box}, gtkset_border_width(gtkpack_(new Gtk::HBox(0,0), 1, gtkpng($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 = new Gtk::Text;
$wtext->can_focus($has_scroll);
chomp(my $text = join("\n", @_));
my $scroll = createScrolledWindow(gtktext_insert($wtext, $text));
- $scroll->set_usize(400, $height);
+ $scroll->set_usize(400, $o->{box_size});
gtkpack__($o->{box}, $scroll);
} else {
my $a = !$::no_separator;