From d091856486cffc4351d6ded86de3c33afb3155b4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 9 Jul 2009 19:45:27 +0000 Subject: 2.5: Buttons Window * Fix poll() callback changes in recent commit, note that these have to work with pinned context too. * Hide header for context panels in py layout. * Don't jump back when collapsing a panel, allow the view to be over some empty space until you scroll back. * Fix follow context icon, order had to be reversed in icon file. * ID template now has icon as part of browse button instead of outside the buttons. --- source/blender/editors/screen/area.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/screen/area.c') diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 1a061172ec1..69af4fbb45d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1187,7 +1187,10 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex uiEndBlock(C, block); if(vertical) { - y += yco-style->panelouter; + if(pt->flag & PNL_NO_HEADER) + y += yco; + else + y += yco-style->panelouter; } else { x += w; @@ -1216,13 +1219,20 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex if(vertical) { v2d->keepofs |= V2D_LOCKOFS_X; v2d->keepofs &= ~V2D_LOCKOFS_Y; + + // don't jump back when panels close or hide + y= MAX2(-y, -v2d->cur.ymin); } else { v2d->keepofs &= ~V2D_LOCKOFS_X; v2d->keepofs |= V2D_LOCKOFS_Y; + + // don't jump back when panels close or hide + x= MAX2(x, v2d->cur.xmax); + y= -y; } - UI_view2d_totRect_set(v2d, x, -y); + UI_view2d_totRect_set(v2d, x, y); /* set the view */ UI_view2d_view_ortho(C, v2d); -- cgit v1.2.3