[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    khtmlw-0.7: Resize & Scrollbars
From:       Sven Radej <a9509961 () unet ! univie ! ac ! at>
Date:       1997-05-31 14:48:04
[Download RAW message or body]

Hi,

I belive that this problem is still actual.

The problem is this. khtmlview class has an interesting way to hide/unhide
scrollbars. If khtmlwidget (subclass of khtmlview) is smaller then whole
document, scrollbars are painted ontop of khtmlwidget and khtmlwidget is forced
to resize to smaller size (by ->setGeometry) the problem is that khtmlwidget
parses again and sends documentChange signal which causes khtmlview to
recalculate if scrolbars are needed (becouse documentChange may occure without
resizeing) which sets/removes scrollbars on top khtmlwidget and resizes it ...
it doesnt go ad infinitum, but takes a while, and scrollbars are usualy badly
written or is khtmlwidget wrongly resized.

The above problem is only for horizontal scrollbar, since vertical is
implemented so that khtmlwidget has right border of 20 pixels and ver.
scrollbar is placed so it never hides text (or whatever) under it.

What I think:

Let's make rightborder 10 pixels as it was before. 
Khtmlwidget (further html) has geometry (0, 0, w, h)
We set ClipppingRegion to (0, 0, w, h) (in screen coordinates)

1)  html->parse() => signal documentChanged
a) If DocumentSize > ClippingRegion we make clipping region smaller for the
width/height of needed scrollbars and paste them on top of html. Scrollbars
hide somee text, but it doesn't matter since we can see it if we move
scrollbars. No need for repaint/parse.
If scrollbars allready exist we just adjust their range.

b) If DocumentSize < Clipping region we enlarge clipping region for
width/height of no longer needed scrollbars. Here we must reparse if we want
areas where scrollbars were to be used.
If we allready don't have scrollbars we do nothing

2) resizeEvent
ClippingRegion = html->geometry()
We remove scrollbars if we have them

a) If DocumentSize > ClippingRegion we make clipping region smaller for the
sizes of needed scrollbars, and paste them on top of html. We reparse. Reparsing
causes 1a) but we allready have scrollbars so we just adjust their range there.

b) If DocumentSize < ClippingRegion we remove scrollbars if we had them, and
reparse. This causes 1b) where we do nothing.

Paint event in html should paint only inside Clipping region... if event is
resizeEvent. I'm not sure about this. 

I'll try to make it so tonight. Am I totaly wrong? Comments? Pros? Cons? 

                        Bye
--                               
                             Sven <sven.radej@iname.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic