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
This commit is contained in:
2019-04-23 16:43:50 +10:00
parent 310f288bb0
commit be3adb51de
12 changed files with 319 additions and 22 deletions

View File

@@ -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 {