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/interface/interface_panel.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/interface/interface_panel.c') diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 3e009b50045..a3c456c0a93 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -653,6 +653,14 @@ static int get_panel_header(Panel *pa) return PNL_HEADER; } +static int get_panel_size_y(uiStyle *style, Panel *pa) +{ + if(pa->type && (pa->type->flag & PNL_NO_HEADER)) + return pa->sizey; + + return PNL_HEADER + pa->sizey + style->panelouter; +} + /* this function is needed because uiBlock and Panel itself dont change sizey or location when closed */ static int get_panel_real_ofsy(Panel *pa) @@ -771,18 +779,18 @@ int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag) /* no smart other default start loc! this keeps switching f5/f6/etc compatible */ ps= panelsort; ps->pa->ofsx= 0; - ps->pa->ofsy= -ps->pa->sizey-get_panel_header(ps->pa)-style->panelouter; + ps->pa->ofsy= -get_panel_size_y(style, ps->pa); for(a=0; apa->ofsx= ps->pa->ofsx; - psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - psnext->pa->sizey-get_panel_header(psnext->pa)-style->panelouter; + psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - get_panel_size_y(style, psnext->pa); } else { psnext->pa->ofsx= get_panel_real_ofsx(ps->pa); - psnext->pa->ofsy= ps->pa->ofsy + ps->pa->sizey + get_panel_header(ps->pa) - psnext->pa->sizey - get_panel_header(psnext->pa); + psnext->pa->ofsy= ps->pa->ofsy + get_panel_size_y(style, ps->pa) - get_panel_size_y(style, psnext->pa); } } -- cgit v1.2.3