Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2011-01-23 16:52:24 +0300
committerJanne Karhu <jhkarh@gmail.com>2011-01-23 16:52:24 +0300
commiteafbb9221e483010bda5e336f935005006f78e89 (patch)
tree3c8c413d23e49222e93ab3ecf92e996526c3c2ff /source/blender/makesrna/intern/rna_ui.c
parent7aebf814d27e56ca88087e06c53e294ada5ddb3c (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/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c14
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)