scroll issues

33 views
Skip to first unread message

Terry Brown

unread,
Aug 13, 2012, 9:36:52 AM8/13/12
to leo-e...@googlegroups.com

I've been trying to get to grips with Leo's ongoing scroll position /
restoration issues.

[F.S. - if you could test the change below with
@bool maintain_scroll = True somewhere in your
settings with rev. 5421 either from bzr or
http://www.greygreen.org/leo/ tomorrow]

LeoPyRef.leo#Code-->Qt gui-->@file ../plugins/qtGui.py--> << define
text widget classes >>--> << define leoQTextEditWidget class
>>-->Widget-specific overrides (leoQTextEditWidget)-->getYScrollPosition (leoQTextEditWidget)

Claims that Qt reports the wrong scroll position when the cursor is not
visible. I'm not convinced. This probe code:

def sp():
print c.frame.body.bodyCtrl.getYScrollPosition(), \
c.frame.body.bodyCtrl.widget.verticalScrollBar().sliderPosition()

if not hasattr(g, '_sp'):
g._sp = sp
g.registerHandler('idle', lambda a,b:g._sp())

g._sp = sp

seems to report sensible scroll position information all the time,
whether adjusted by dragging the scroll bar, mouse wheel rolling,
entering text, etc.

I think doubting getYScrollPosition() has led to use of
ensureCursorVisible() more than it should be. I've added a
maintain_scroll bool @setting to suppress a couple of calls to
ensureCursorVisible() in odd places which caused body text to jump to
the cursor position when focus moved in and out of the Leo window.
This scratched an itch for me, the body text moving when I was
trying to read it against some other text like API docs. in a browser.

I'm not sure if it's impacted body text jump bug.

Cheers -Terry



F.S.

unread,
Aug 14, 2012, 2:42:27 PM8/14/12
to leo-e...@googlegroups.com
Hi Terry,

I tried the new build (rev 5423) and inserted a @bool maintain_scroll = True node in the @settings tree
in leoSettings.leo, and restarted Leo. I didn't observe any change in behavior in body text jumping (i.e. still there).

I tried to run the check-settings script button but got the following error:

exception executing script
IOError: [Errno 9] Bad file descriptor
--------------------
  line 96:         
* line 97:         print(format % (munged_s,match_list))
  line 98:     #@+node:error
  line 99:     def error (self,s):

My Python is 2.7. Scripts appear to be written in Python 3.

Terry Brown

unread,
Aug 14, 2012, 3:19:31 PM8/14/12
to leo-e...@googlegroups.com, speec...@gmail.com
On Tue, 14 Aug 2012 11:42:27 -0700 (PDT)
"F.S." <██████████@████████> wrote:

> I tried the new build (rev 5423) and inserted a @bool maintain_scroll =
> True node in the @settings tree
> in leoSettings.leo, and restarted Leo. I didn't observe any change in
> behavior in body text jumping (i.e. still there).

Ok, thanks - I've since seen it with the new @setting active as well. I
couldn't reproduce the jumping bug with your test file, which makes me
wonder if it's influenced by font (line height) etc. as well.

Cheers -Terry

F.S.

unread,
Aug 14, 2012, 3:59:04 PM8/14/12
to leo-e...@googlegroups.com

I run
Leo 4.11 devel, build 5423, 2012-08-14 02:53:36 -0500
Python 2.7.3, qt version 4.8.2
Windows 6, 1, 7601, 2, Service Pack 1

with default settings that come with the release (no myLeo...), so fonts etc should be default. Windows settings is also standard. Not sure if things like screen resolution would affect the line height etc. I do remember that resizing the body text pane does not change things.
Reply all
Reply to author
Forward
0 new messages