diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-01-23 16:52:24 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-01-23 16:52:24 +0300 |
commit | eafbb9221e483010bda5e336f935005006f78e89 (patch) | |
tree | 3c8c413d23e49222e93ab3ecf92e996526c3c2ff /source/blender/makesrna | |
parent | 7aebf814d27e56ca88087e06c53e294ada5ddb3c (diff) |
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.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 14 |
1 files changed, 13 insertions, 1 deletions
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) |