Fix T38876: hide area split widget in lower left of widget on OS X.

This is already used by the operating system for window resizing, you must use
the widget in the top right of the area to split.
This commit is contained in:
2014-02-27 23:39:40 +01:00
parent de6b64bca6
commit d7a2d2b693
3 changed files with 24 additions and 11 deletions

View File

@@ -559,7 +559,7 @@ void ED_area_headerprint(ScrArea *sa, const char *str)
/* ************************************************************ */
static void area_azone_initialize(bScreen *screen, ScrArea *sa)
static void area_azone_initialize(wmWindow *win, bScreen *screen, ScrArea *sa)
{
AZone *az;
@@ -570,15 +570,21 @@ static void area_azone_initialize(bScreen *screen, ScrArea *sa)
return;
}
/* set area action zones */
az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type = AZONE_AREA;
az->x1 = sa->totrct.xmin;
az->y1 = sa->totrct.ymin;
az->x2 = sa->totrct.xmin + (AZONESPOT - 1);
az->y2 = sa->totrct.ymin + (AZONESPOT - 1);
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
/* can't click on bottom corners on OS X, already used for resizing */
#ifdef __APPLE__
if(!(sa->totrct.xmin == 0 && sa->totrct.ymin == 0) || WM_window_is_fullscreen(win))
#endif
{
/* set area action zones */
az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type = AZONE_AREA;
az->x1 = sa->totrct.xmin;
az->y1 = sa->totrct.ymin;
az->x2 = sa->totrct.xmin + (AZONESPOT - 1);
az->y2 = sa->totrct.ymin + (AZONESPOT - 1);
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
@@ -1274,7 +1280,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
area_calc_totrct(sa, WM_window_pixels_x(win), WM_window_pixels_y(win));
/* clear all azones, add the area triange widgets */
area_azone_initialize(win->screen, sa);
area_azone_initialize(win, win->screen, sa);
/* region rect sizes */
rect = sa->totrct;

View File

@@ -92,6 +92,7 @@ struct wmWindow *WM_window_open (struct bContext *C, const struct rcti *rect);
int WM_window_pixels_x (struct wmWindow *win);
int WM_window_pixels_y (struct wmWindow *win);
bool WM_window_is_fullscreen (struct wmWindow *win);
/* defines for 'type' WM_window_open_temp */
#define WM_WINDOW_RENDER 0

View File

@@ -1440,3 +1440,9 @@ int WM_window_pixels_y(wmWindow *win)
return (int)(f * (float)win->sizey);
}
bool WM_window_is_fullscreen(wmWindow *win)
{
return win->windowstate == GHOST_kWindowStateFullScreen;
}