Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-11-18 13:37:32 +0300
committerJoshua Leung <aligorith@gmail.com>2009-11-18 13:37:32 +0300
commit849ee94cf9d2b4ca92a6f30576922ebbeb622ad5 (patch)
treefca125c29f8fc8e468a639afebcb889476671852 /source/blender/editors
parent624cd67d5571c7e6597151d124416a17a2095d3a (diff)
Partial fixes for #19881: Items existing on the same row as the window dividers are not interactive (selectable, etc.)
The View 2D function for handling scrollbar events now takes into account whether the scrollbar is visible or not, so that it won't block events when the scrollbar isn't visible. Also, made the UI code take this into account too for its region testing code. Unforunately, there still seems to be something else which is still preventing UI buttons from being processed when they are in those regions.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_handlers.c43
-rw-r--r--source/blender/editors/interface/view2d_ops.c7
2 files changed, 43 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index a84a393b3ae..5a1645b449e 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -3747,26 +3747,55 @@ static void ui_blocks_set_tooltips(ARegion *ar, int enable)
static int ui_mouse_inside_region(ARegion *ar, int x, int y)
{
uiBlock *block;
- int mx, my;
+
- /* check if the mouse is in the region, and in case of a view2d also check
- * if it is inside the view2d itself, not over scrollbars for example */
+ /* check if the mouse is in the region */
if(!BLI_in_rcti(&ar->winrct, x, y)) {
for(block=ar->uiblocks.first; block; block=block->next)
block->auto_open= 0;
-
+
return 0;
}
+ /* also, check that with view2d, that the mouse is not over the scrollbars
+ * NOTE: care is needed here, since the mask rect may include the scrollbars
+ * even when they are not visible, so we need to make a copy of the mask to
+ * use to check
+ */
if(ar->v2d.mask.xmin!=ar->v2d.mask.xmax) {
+ View2D *v2d= &ar->v2d;
+ rcti mask_rct;
+ int mx, my;
+
+ /* convert window coordinates to region coordinates */
mx= x;
my= y;
ui_window_to_region(ar, &mx, &my);
-
- if(!BLI_in_rcti(&ar->v2d.mask, mx, my))
+
+ /* make a copy of the mask rect, and tweak accordingly for hidden scrollbars */
+ mask_rct.xmin= v2d->mask.xmin;
+ mask_rct.xmax= v2d->mask.xmax;
+ mask_rct.ymin= v2d->mask.ymin;
+ mask_rct.ymax= v2d->mask.ymax;
+
+ if (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE) {
+ if (v2d->scroll & V2D_SCROLL_LEFT)
+ mask_rct.xmin= v2d->vert.xmin;
+ else if (v2d->scroll & V2D_SCROLL_RIGHT)
+ mask_rct.xmax= v2d->vert.xmax;
+ }
+ if (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE) {
+ if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O))
+ mask_rct.ymin= v2d->hor.ymin;
+ else if (v2d->scroll & V2D_SCROLL_TOP)
+ mask_rct.ymax= v2d->hor.ymax;
+ }
+
+ /* check if in the rect */
+ if(!BLI_in_rcti(&mask_rct, mx, my))
return 0;
}
-
+
return 1;
}
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index ef37f6e530a..79f000113e8 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -1285,6 +1285,13 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_PASS_THROUGH;
}
}
+ /* zone is also inappropriate if scroller is not visible... */
+ if ( ((vsm->scroller=='h') && (v2d->scroll & V2D_SCROLL_HORIZONTAL_HIDE)) ||
+ ((vsm->scroller=='v') && (v2d->scroll & V2D_SCROLL_VERTICAL_HIDE)) )
+ {
+ /* can't catch this event for ourselves, so let it go to someone else? */
+ return OPERATOR_PASS_THROUGH;
+ }
if(vsm->scroller=='h')
v2d->scroll_ui |= V2D_SCROLL_H_ACTIVE;