From 3c55ae215572e4b490e564234adac06ec3855b3c Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 28 Oct 2009 16:03:58 +0000 Subject: factorize entry width computing --- perl-install/fs/partitioning_wizard.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index 857354470..a4f79a43b 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -313,6 +313,7 @@ sub create_display_box { my $w = Gtk2::Label->new($info); my @colorized_fs_types = qw(ext2 ext3 ext4 xfs swap vfat ntfs ntfs-3g); $ev = Gtk2::EventBox->new; + $entry->{width} = $entry->{size} * $initial_ratio + $minwidth; my $part; if ($last && $last->{device} eq "$entry->{device}") { $part = $last; @@ -332,7 +333,7 @@ sub create_display_box { $hpane->add2($ev2); $hpane->child2_shrink(0); $hpane->set_position(ceil($ratio * $part->{req_size})); - ugtk2::gtkset_size_request($hpane, $ratio * $part->{size} + $minwidth, 0); + ugtk2::gtkset_size_request($hpane, $entry->{width}, 0); ugtk2::gtkpack__($display_box, $hpane); my $size = int($hpane->get_position / $ratio); @@ -399,7 +400,7 @@ sub create_display_box { $entry->{fs_type} && member($entry->{fs_type}, @colorized_fs_types) ? $entry->{fs_type} : 'other')); } - $ev->set_size_request($entry->{size} * $ratio + $minwidth, 0); + $ev->set_size_request($entry->{width}, 0); ugtk2::gtkpack($display_box, $ev); } $ev->add($w); -- cgit v1.2.1