From eafbb9221e483010bda5e336f935005006f78e89 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sun, 23 Jan 2011 13:52:24 +0000 Subject: Panels that have the "no header" flag set are now always drawn first in a tab regardless of the order they were registered. * This is a quick and simple workaround until we can define proper ordering for the panels. --- source/blender/makesrna/intern/rna_ui.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_ui.c') diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 0c26741f06c..183c9aea5e2 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -213,7 +213,19 @@ static StructRNA *rna_Panel_register(bContext *C, ReportList *reports, void *dat pt->draw= (have_function[1])? panel_draw: NULL; pt->draw_header= (have_function[2])? panel_draw_header: NULL; - BLI_addtail(&art->paneltypes, pt); + /* XXX use "no header" flag for some ordering of panels until we have real panel ordering */ + if(pt->flag & PNL_NO_HEADER) { + PanelType *pth = art->paneltypes.first; + while(pth && pth->flag & PNL_NO_HEADER) + pth=pth->next; + + if(pth) + BLI_insertlinkbefore(&art->paneltypes, pth, pt); + else + BLI_addtail(&art->paneltypes, pt); + } + else + BLI_addtail(&art->paneltypes, pt); /* update while blender is running */ if(C) -- cgit v1.2.3