diff options
author | Ton Roosendaal <ton@blender.org> | 2009-05-22 19:02:32 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-05-22 19:02:32 +0400 |
commit | 1a69eab4a09f77db63830aa337872fb306372f94 (patch) | |
tree | 5c0673ef771b9500be5625f282c66b4b924c5bb1 /source/blender/editors/screen | |
parent | 5bc3bd7b067bd2b4c23d802445b4485da565de19 (diff) |
2.5
- Added new popup menu type, which can be used to pass on a
running operator too. Needed it for debug menu, allowing to
set variables outside of operator "first do then tweak" system. :)
void uiPupBlockOperator()
Don't forget to tell invoke() return that operator now runs modal!
- Test menu: alt+ctrl+d gives the G.rt debug value.
Values of 0-16 now can be used to shrink areas, stuff like this
then happens (rt==4):
http://download.blender.org/institute/rt5.jpg
Was looking at ways to visually distinguish areas and regions
better. Yes I know, cute rounded corners, etc. Just testing!
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 27 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 53 |
2 files changed, 50 insertions, 30 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index cf72eaf2cdd..99ab7be7106 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -545,15 +545,16 @@ static void region_rect_recursive(ARegion *ar, rcti *remainder, int quad) static void area_calc_totrct(ScrArea *sa, int sizex, int sizey) { - - if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1; + short rt= CLAMPIS(G.rt, 0, 16); + + if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1+rt; else sa->totrct.xmin= sa->v1->vec.x; - if(sa->v4->vec.x<sizex-1) sa->totrct.xmax= sa->v4->vec.x-1; + if(sa->v4->vec.x<sizex-1) sa->totrct.xmax= sa->v4->vec.x-1-rt; else sa->totrct.xmax= sa->v4->vec.x; - if(sa->v1->vec.y>0) sa->totrct.ymin= sa->v1->vec.y+1; + if(sa->v1->vec.y>0) sa->totrct.ymin= sa->v1->vec.y+1+rt; else sa->totrct.ymin= sa->v1->vec.y; - if(sa->v2->vec.y<sizey-1) sa->totrct.ymax= sa->v2->vec.y-1; + if(sa->v2->vec.y<sizey-1) sa->totrct.ymax= sa->v2->vec.y-1-rt; else sa->totrct.ymax= sa->v2->vec.y; /* for speedup */ @@ -582,16 +583,16 @@ void area_azone_initialize(ScrArea *sa) for(az= sa->actionzones.first; az; az= az->next) { if(az->pos==AZONE_SW) { - az->x1= sa->v1->vec.x+1; - az->y1= sa->v1->vec.y+1; - az->x2= sa->v1->vec.x+AZONESPOT; - az->y2= sa->v1->vec.y+AZONESPOT; + az->x1= sa->totrct.xmin; + az->y1= sa->totrct.ymin; + az->x2= sa->totrct.xmin + AZONESPOT-1; + az->y2= sa->totrct.ymin + AZONESPOT-1; } else if (az->pos==AZONE_NE) { - az->x1= sa->v3->vec.x; - az->y1= sa->v3->vec.y; - az->x2= sa->v3->vec.x-AZONESPOT; - az->y2= sa->v3->vec.y-AZONESPOT; + az->x1= sa->totrct.xmax+1; + az->y1= sa->totrct.ymax+1; + az->x2= sa->totrct.xmax-AZONESPOT+1; + az->y2= sa->totrct.ymax-AZONESPOT+1; } } } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index a5950b97f61..1d131e5c103 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -868,30 +868,47 @@ static void scrarea_draw_shape_light(ScrArea *sa, char dir) glDisable(GL_BLEND); } -/** screen edges drawing **/ -static void drawscredge_area(ScrArea *sa) +static void drawscredge_area_draw(int sizex, int sizey, short x1, short y1, short x2, short y2, short a) { - short x1= sa->v1->vec.x; - short y1= sa->v1->vec.y; - short x2= sa->v3->vec.x; - short y2= sa->v3->vec.y; - - cpack(0x0); - /* right border area */ - sdrawline(x2, y1, x2, y2); + if(x2<sizex-1) + sdrawline(x2+a, y1, x2+a, y2); /* left border area */ - if(x1>0) { /* otherwise it draws the emboss of window over */ - sdrawline(x1, y1, x1, y2); - } + if(x1>0) /* otherwise it draws the emboss of window over */ + sdrawline(x1+a, y1, x1+a, y2); /* top border area */ - sdrawline(x1, y2, x2, y2); + if(y2<sizey-1) + sdrawline(x1, y2+a, x2, y2+a); /* bottom border area */ - sdrawline(x1, y1, x2, y1); + if(y1>0) + sdrawline(x1, y1+a, x2, y1+a); + +} + +/** screen edges drawing **/ +static void drawscredge_area(ScrArea *sa, int sizex, int sizey, int center) +{ + short x1= sa->v1->vec.x; + short y1= sa->v1->vec.y; + short x2= sa->v3->vec.x; + short y2= sa->v3->vec.y; + short a, rt; + + rt= CLAMPIS(G.rt, 0, 16); + if(center==0) { + cpack(0x505050); + for(a=-rt; a<=rt; a++) + if(a!=0) + drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2, a); + } + else { + cpack(0x0); + drawscredge_area_draw(sizex, sizey, x1, y1, x2, y2, 0); + } } /* ****************** EXPORTED API TO OTHER MODULES *************************** */ @@ -971,9 +988,11 @@ void ED_screen_draw(wmWindow *win) for(sa= win->screen->areabase.first; sa; sa= sa->next) { if (sa->flag & AREA_FLAG_DRAWJOINFROM) sa1 = sa; if (sa->flag & AREA_FLAG_DRAWJOINTO) sa2 = sa; - drawscredge_area(sa); + drawscredge_area(sa, win->sizex, win->sizey, 0); } - + for(sa= win->screen->areabase.first; sa; sa= sa->next) + drawscredge_area(sa, win->sizex, win->sizey, 1); + /* blended join arrow */ if (sa1 && sa2) { dir = area_getorientation(win->screen, sa1, sa2); |