GNOME Bugzilla – Bug 595997
Fix interaction of borders/background and scrolling
Last modified: 2009-10-01 19:32:57 UTC
These two patches allow us to set a border or a background on a NbtkBoxLayout that is being scrolled. The second patch just removes NbtkViewport rather than fixing it for the clipping change to NbtkScrollView, since we don't use NbtkViewport anyways.
Created attachment 143742 [details] [review] Remove NbtkViewport from our tree NbtkBoxLayout provides the basic functionality of 2-dimensional scrolling and we don't use NbtkViewport anywhere, so remove it. This avoids fixing NbtkViewport up for the interaction of scrolling and borders/padding, which would be a little involved and require a test program for NbtkViewport to be written.
Created attachment 143743 [details] [review] Fix interaction of borders/background and scrolling NbtkBoxLayout: Make consistent that the area scrolled and clipped to is the content area (excluding borders and padding.) Translate back appropriately when chaining up so that the parent background is drawn at the right place and picking on the box (if it's reactive) picks at the right place on the screen. clip-to-allocation is removed from NbtkScrollView since it's just not right - if the child has any non-moving elements, like headers or borders, it will need to set a narrower clip. And even if the entire child scrolls, we want to clip to an arrow that excludes the scrollbars.
Created attachment 144330 [details] [review] Fix interaction of borders/background and scrolling StBoxLayout: Make consistent that the area scrolled and clipped to is the content area (excluding borders and padding.) Translate back appropriately when chaining up so that the parent background is drawn at the right place and picking on the box (if it's reactive) picks at the right place on the screen. clip-to-allocation is removed from StScrollView since it's just not right - if the child has any non-moving elements, like headers or borders, it will need to set a narrower clip. And even if the entire child scrolls, we want to clip to an arrow that excludes the scrollbars.
Review of attachment 144330 [details] [review]: Had to think about the interaction here if someone set a clip on the actor, or in the (admittedly pathological) recursive scrolled element inside a scrolled element, but it all looks OK to me.
Attachment 144330 [details] pushed as a15205e - Fix interaction of borders/background and scrolling