diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-23 09:43:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-23 09:51:00 +0300 |
commit | be3adb51de21652d64a6839cd5614c5096064c6a (patch) | |
tree | b76f6346673205ed3aeb33a4768bd2a182a4c605 /source/blender/editors/include/UI_interface.h | |
parent | 310f288bb03b4197f54b7d7b6d611669f2604d04 (diff) |
UI: ignore events in empty region overlap areas
- Resizable areas use 2D view bounds.
- Header uses the button bounds.
- A margin is added to avoid clicking between buttons.
- Region resize edges clamp to the 2D view bounds.
Resovles T61554
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index dd086461801..3b77146b70e 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -86,6 +86,14 @@ typedef struct uiPopupBlockHandle uiPopupBlockHandle; #define UI_MAX_NAME_STR 128 #define UI_MAX_SHORTCUT_STR 64 +/** + * For #ARegion.overlap regions, pass events though if they don't overlap + * the regions contents (the usable part of the #View2D and buttons). + * + * The margin is needed so it's not possible to accidentally click inbetween buttons. + */ +#define UI_REGION_OVERLAP_MARGIN (U.widget_unit / 3) + /* use for clamping popups within the screen */ #define UI_SCREEN_MARGIN 10 @@ -2302,6 +2310,7 @@ void UI_context_active_but_prop_get_templateID(struct bContext *C, struct ID *UI_context_active_but_get_tab_ID(struct bContext *C); uiBut *UI_region_active_but_get(struct ARegion *ar); +uiBut *UI_region_but_find_rect_over(const struct ARegion *ar, const struct rcti *isect); /* uiFontStyle.align */ typedef enum eFontStyle_Align { |