diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-18 17:30:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-18 17:30:25 +0000 |
commit | 42a56d315a86b9fa19d9330583a26a86c7453ab0 (patch) | |
tree | 2745317de1787e1af0b25ab529a60bb907beb8cd /perl-install/my_gtk.pm | |
parent | 623eb752368c94f95a12ac2ee791177da62d78be (diff) | |
download | drakx-42a56d315a86b9fa19d9330583a26a86c7453ab0.tar drakx-42a56d315a86b9fa19d9330583a26a86c7453ab0.tar.gz drakx-42a56d315a86b9fa19d9330583a26a86c7453ab0.tar.bz2 drakx-42a56d315a86b9fa19d9330583a26a86c7453ab0.tar.xz drakx-42a56d315a86b9fa19d9330583a26a86c7453ab0.zip |
enhance look, fix ask_fileW
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r-- | perl-install/my_gtk.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 43c4e9e29..2c983982c 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -392,6 +392,13 @@ sub write_on_pixmap { $darea; } +sub n_line_size { + my ($nbline, $type, $widget) = @_; + my $font = $widget->style->font; + my $spacing = ${{ text => 0, various => 15 }}{$type}; + $nbline * ($font->ascent + $font->descent + $spacing) + 8; +} + #-############################################################################### #- createXXX functions @@ -421,8 +428,7 @@ sub create_box_with_title($@) { $o->{box} = new Gtk::VBox(0,0); $o->{icon} and eval { gtkpack__($o->{box}, gtkset_border_width(gtkpack_(new Gtk::HBox(0,0), 1, gtkpng($o->{icon})),5)); }; if (@_ <= 2 && $o->{box_size} > 4) { - my $font = $o->{box}->style->font; - my $wanted = $o->{box_size} * ($font->ascent + $font->descent) + 8; + my $wanted = n_line_size($o->{box_size}, 'text', $o->{box}); my $height = min(250, $wanted); my $has_scroll = $height < $wanted; |