diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-08-31 16:25:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-08-31 16:25:32 +0000 |
commit | 7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465 (patch) | |
tree | 9bd6d341f500a8eebf427d208fa3e0a30d893dd3 /perl-install/mygtk2.pm | |
parent | 56391bbfee030c761865d93b8694ecba108579b9 (diff) | |
download | drakx-backup-do-not-use-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar drakx-backup-do-not-use-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar.gz drakx-backup-do-not-use-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar.bz2 drakx-backup-do-not-use-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.tar.xz drakx-backup-do-not-use-7cc91015fcbe7ddfe28abe0fe8a1e84fbca4a465.zip |
simpler and better code, allowing forcing scrolling to bottom
Diffstat (limited to 'perl-install/mygtk2.pm')
-rw-r--r-- | perl-install/mygtk2.pm | 7 |
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); } }; |