On Thursday, September 27, 2012 12:31:33 PM UTC-5, Terry wrote:
> can't the scroll position be read before the call to w.setStyleSheet?
Doesn't work.
[big snip]
> Really, it's very simple when you don't know what you're talking about
:-)
Hahaha.
Well, I now have a dirt simple solution!! Rather than draw the border *in*
the QTextBrowser, the trick is draw the border *around* the QTextBrowser!
This leaves the QTextBrowser completely unchanged, and so nothing *at all*
happens in the body pane. I should have thought of this a long, long time
ago.
The actual code is fairly clean: the g.app.gui.add/remove_border methods
change the stylesheet of c.frame.top.innerBodyFrame (a QFrame) instead of
the body text widget itself.
There is one glitch: on Windows at least, a QFrame with a 5px border looks
very different from a QTextBrowser with a 5px border. Why am I not
surprised ;-) As a workaround, we will need two settings:
@int focus_border_width = 5 # As always, controls the width of the
border in the tree and log panes.
@int focus_body_border_width = 2 # Controls the width of the border
around the body pane.
OMG, this *still* doesn't work. The body pane still scrolls in my test
case. The next step will be to set the color of the QFrame without a
stylesheet, which hopefully will prevent the propagation of the stylesheet
update logic...
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/leo-editor/-/EKqLFB4H1QEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.