diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-01-31 14:13:31 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-01-31 14:13:31 +0300 |
commit | 127754373216db89fc72cbfd564292dcd1437bdd (patch) | |
tree | 39dccb168f4ab60f913f621fa253046a112a4abe /source/blender/editors/interface/view2d.c | |
parent | 6de25c937f41f180ef3aea4dcac50ce24d9510d7 (diff) |
Various tweaks to View2D code for handling of scrollbar interactions in relation to bug 19881:
* Clearly labelled the way that the scrollbar hiding works. Also see the report comments for an overview
* Added another pair of flags for another one of the cases in which scrollbars should also get ignored; when the entire contents of the view are visible, a pair of flags is now set in the view2d data (instead of for the scrollers tempdata only) for detecting this case too
* Fixed the potential for scrollbars without zoom handles shown to have those handles still considered. This still happened in the User Preferences window, but has now been disabled.
--
These changes still don't solve the bug though. Currently after the scrollbar operator passes through, the Outliner's activate-selection operators still fail to start.
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 7aabc147139..12265715415 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -62,7 +62,12 @@ /* *********************************************************************** */ -/* helper to allow scrollbars to dynamically hide */ +/* helper to allow scrollbars to dynamically hide + * - returns a copy of the scrollbar settings with the flags to display + * horizontal/vertical scrollbars removed + * - input scroll value is the v2d->scroll var + * - hide flags are set per region at drawtime + */ static int view2d_scroll_mapped(int scroll) { if(scroll & V2D_SCROLL_HORIZONTAL_HIDE) @@ -1411,10 +1416,14 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short CLAMP(scrollers->hor_min, hor.xmin, hor.xmax-V2D_SCROLLER_HANDLE_SIZE); } - /* check whether sliders can disappear */ + /* check whether sliders can disappear due to the full-range being used */ if(v2d->keeptot) { - if(fac1 <= 0.0f && fac2 >= 1.0f) + if ((fac1 <= 0.0f) && (fac2 >= 1.0f)) { + v2d->scroll |= V2D_SCROLL_HORIZONTAL_FULLR; scrollers->horfull= 1; + } + else + v2d->scroll &= ~V2D_SCROLL_HORIZONTAL_FULLR; } } @@ -1448,10 +1457,14 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short CLAMP(scrollers->vert_min, vert.ymin, vert.ymax-V2D_SCROLLER_HANDLE_SIZE); } - /* check whether sliders can disappear */ + /* check whether sliders can disappear due to the full-range being used */ if(v2d->keeptot) { - if(fac1 <= 0.0f && fac2 >= 1.0f) + if ((fac1 <= 0.0f) && (fac2 >= 1.0f)) { + v2d->scroll |= V2D_SCROLL_VERTICAL_FULLR; scrollers->vertfull= 1; + } + else + v2d->scroll &= ~V2D_SCROLL_VERTICAL_FULLR; } } |