summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-02-22 20:24:45 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-02-22 20:24:45 +0000
commit576f95164e566ae9daad807ca0b2d6071388df66 (patch)
tree669ac2ccbba10c390ffc03c412134a162f628a8b /perl-install/interactive
parentc0789f2902e7e5a631d7c2c023a1ad496037ef1e (diff)
downloaddrakx-576f95164e566ae9daad807ca0b2d6071388df66.tar
drakx-576f95164e566ae9daad807ca0b2d6071388df66.tar.gz
drakx-576f95164e566ae9daad807ca0b2d6071388df66.tar.bz2
drakx-576f95164e566ae9daad807ca0b2d6071388df66.tar.xz
drakx-576f95164e566ae9daad807ca0b2d6071388df66.zip
in $::expert, use a SpinButton instead of HScale for type "range"
(useful in diskdrake to enter the partition size directly)
Diffstat (limited to 'perl-install/interactive')
-rw-r--r--perl-install/interactive/gtk.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index 581e422a3..5aeef16a9 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -441,10 +441,11 @@ sub ask_fromW {
$set = sub { $w->child->set(may_apply($e->{format}, $_[0])) };
$width = length may_apply($e->{format}, ${$e->{val}});
} elsif ($e->{type} eq 'range') {
- my $adj = create_adjustment(${$e->{val}}, $e->{min}, $e->{max});
+ my $want_scale = !$::expert;
+ my $adj = Gtk2::Adjustment->new(${$e->{val}}, $e->{min}, $e->{max} + ($want_scale ? 1 : 0), 1, ($e->{max} - $e->{min}) / 10, 1);
$adj->signal_connect(value_changed => $changed);
- $w = Gtk2::HScale->new($adj);
- $w->set_size_request(200, -1);
+ $w = $want_scale ? Gtk2::HScale->new($adj) : Gtk2::SpinButton->new($adj, 10, 0);
+ $w->set_size_request($want_scale ? 200 : 100, -1);
$w->set_digits(0);
$w->signal_connect(key_press_event => $may_go_to_next);
$set = sub { $adj->set_value($_[0]) };