Cycles: get rid of (+) icon for region open, all regions already accesible

through shortcut key or view menu.
This commit is contained in:
Brecht Van Lommel
2011-05-18 19:34:17 +00:00
parent a532b9fa3e
commit 74cccd1566

View File

@@ -479,84 +479,21 @@ static void region_azone_edge(AZone *az, ARegion *ar)
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar)
{
AZone *azt;
int tot=0;
/* count how many actionzones with along same edge are available.
This allows for adding more action zones in the future without
having to worry about correct offset */
for(azt= sa->actionzones.first; azt; azt= azt->next) {
if(azt->edge == az->edge) tot++;
}
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
az->x1= ar->winrct.xmax - tot*2*AZONEPAD_ICON;
az->y1= ar->winrct.ymax + AZONEPAD_ICON;
az->x2= ar->winrct.xmax - tot*AZONEPAD_ICON;
az->y2= ar->winrct.ymax + 2*AZONEPAD_ICON;
break;
case AE_BOTTOM_TO_TOPLEFT:
az->x1= ar->winrct.xmin + AZONEPAD_ICON;
az->y1= ar->winrct.ymin - 2*AZONEPAD_ICON;
az->x2= ar->winrct.xmin + 2*AZONEPAD_ICON;
az->y2= ar->winrct.ymin - AZONEPAD_ICON;
break;
case AE_LEFT_TO_TOPRIGHT:
az->x1= ar->winrct.xmin - 2*AZONEPAD_ICON;
az->y1= ar->winrct.ymax - tot*2*AZONEPAD_ICON;
az->x2= ar->winrct.xmin - AZONEPAD_ICON;
az->y2= ar->winrct.ymax - tot*AZONEPAD_ICON;
break;
case AE_RIGHT_TO_TOPLEFT:
az->x1= ar->winrct.xmax + AZONEPAD_ICON;
az->y1= ar->winrct.ymax - tot*2*AZONEPAD_ICON;
az->x2= ar->winrct.xmax + 2*AZONEPAD_ICON;
az->y2= ar->winrct.ymax - tot*AZONEPAD_ICON;
break;
}
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
/* if more azones on 1 spot, set offset */
for(azt= sa->actionzones.first; azt; azt= azt->next) {
if(az!=azt) {
if( ABS(az->x1-azt->x1) < 2 && ABS(az->y1-azt->y1) < 2) {
if(az->edge==AE_TOP_TO_BOTTOMRIGHT || az->edge==AE_BOTTOM_TO_TOPLEFT) {
az->x1+= AZONESPOT;
az->x2+= AZONESPOT;
}
else{
az->y1-= AZONESPOT;
az->y2-= AZONESPOT;
}
BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
}
}
}
static void region_azone_initialize(ScrArea *sa, ARegion *ar, AZEdge edge)
{
AZone *az;
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type= AZONE_REGION;
az->ar= ar;
az->edge= edge;
if (ar->flag & RGN_FLAG_HIDDEN) {
region_azone_icon(sa, az, ar);
} else {
if(!(ar->flag & RGN_FLAG_HIDDEN)) {
AZone *az;
az= (AZone *)MEM_callocN(sizeof(AZone), "actionzone");
BLI_addtail(&(sa->actionzones), az);
az->type= AZONE_REGION;
az->ar= ar;
az->edge= edge;
region_azone_edge(az, ar);
}
}
/* *************************************************************** */
static void region_azone_add(ScrArea *sa, ARegion *ar, int alignment)