summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-03 17:13:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-03 17:13:01 +0000
commit27e95a15d9845fa48696d7d2139335f063de5060 (patch)
tree1fbb2bdb9b4dc289ef4bfd41cd0761ff19ac81de /perl-install
parente493331530ade6ad3a07a9112f7498441e49e045 (diff)
downloaddrakx-backup-do-not-use-27e95a15d9845fa48696d7d2139335f063de5060.tar
drakx-backup-do-not-use-27e95a15d9845fa48696d7d2139335f063de5060.tar.gz
drakx-backup-do-not-use-27e95a15d9845fa48696d7d2139335f063de5060.tar.bz2
drakx-backup-do-not-use-27e95a15d9845fa48696d7d2139335f063de5060.tar.xz
drakx-backup-do-not-use-27e95a15d9845fa48696d7d2139335f063de5060.zip
better sizing for combo boxes
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/interactive_gtk.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index b386d031c..41240ac46 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -329,7 +329,7 @@ sub ask_fromW {
$mainw->sync; # for XPM's creation
#-the widgets
- my (@widgets, @widgets_always, @widgets_advanced, $advanced, $advanced_pack, $has_scroll, $total_size, $max_width);
+ my (@widgets, @widgets_always, @widgets_advanced, $advanced, $advanced_pack, $has_horiz_scroll, $has_scroll, $total_size, $max_width);
my $tooltips = new Gtk::Tooltips;
my $set_all = sub {
@@ -421,6 +421,7 @@ sub ask_fromW {
$w->signal_connect(key_press_event => $may_go_to_next);
$set = sub { $adj->set_value($_[0]) };
$get = sub { $adj->get_value };
+ $size = 2;
} elsif ($e->{type} =~ /list/) {
my $quit_if_double_click =
@@ -454,7 +455,9 @@ sub ask_fromW {
$w->set_popdown_strings(@{$e->{list}});
$w->disable_activate;
($real_w, $w) = ($w, $w->entry);
- $width = max(map { length } @{$e->{list}});
+ my @l = sort { $b <=> $a } map { length } @{$e->{list}};
+ $has_horiz_scroll = 1;
+ $width = $l[@l / 16]; # take the third octile (think quartile)
} else {
$w = new Gtk::Entry;
$w->signal_connect(focus_in_event => sub { $w->select_region });
@@ -522,6 +525,8 @@ sub ask_fromW {
gtkadd($mainw->{window}, $pack);
if ($has_scroll && !$::isEmbedded &&!$::isWizard) {
$mainw->{rwindow}->set_default_size($mainw->{box_width}, $mainw->{box_height});
+ } elsif ($has_horiz_scroll && !$::isEmbedded &&!$::isWizard) {
+ $mainw->{rwindow}->set_default_size($mainw->{box_width}, 0);
}
$set_advanced->(0);
(@widgets ? $widgets[0]{focus_w} : $common->{focus_cancel} ? $mainw->{cancel} : $mainw->{ok})->grab_focus();