summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-08-31 16:25:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-08-31 16:25:32 +0000
commit7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465 (patch)
tree9bd6d341f500a8eebf427d208fa3e0a30d893dd3
parent56391bbfee030c761865d93b8694ecba108579b9 (diff)
downloaddrakx-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar
drakx-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar.gz
drakx-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar.bz2
drakx-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar.xz
drakx-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.zip
simpler and better code, allowing forcing scrolling to bottom
-rw-r--r--perl-install/mygtk2.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index 74a8921c7..da360de16 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -903,10 +903,9 @@ sub _allow_scroll_TextView_to_bottom {
$textView->get_buffer->create_mark('end', $textView->get_buffer->get_end_iter, 0);
sub {
- my $new_scroll = $scrolledWindow->get_vadjustment->get_value;
- $textView->{no_scroll_down} ||= $new_scroll < ($textView->{prev_scroll} || 0);
- $textView->{prev_scroll} = $new_scroll;
- if (!$textView->{no_scroll_down}) {
+ my ($o_force) = @_;
+ my $adjustment = $scrolledWindow->get_vadjustment;
+ if ($o_force || $adjustment->page_size + $adjustment->value == $adjustment->upper) {
$textView->scroll_to_mark($textView->get_buffer->get_mark('end'), 0, 1, 0, 1);
}
};