diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-03 14:32:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-03 22:30:35 +0300 |
commit | d7c2b78822ff20fb78418c43d6badd692fa98784 (patch) | |
tree | c1f8b9a0580afc173dd0829615f74a94a3254589 /source/blender/blenloader/intern/readfile.c | |
parent | 9b01e7bc27c4a8c8c9f95aa074f458f3e734d23b (diff) |
UI: add subpanel support.
In the Python API, any panel becomes a subpanel by setting bl_parent_id
to the name of the parent panel. These subpanels can contain advanced or
less commonly used settings.
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d2542e977e3..b0a1789eb7e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6396,19 +6396,24 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd) /* *********** READ AREA **************** */ -static void direct_link_region(FileData *fd, ARegion *ar, int spacetype) +static void direct_link_panel_list(FileData *fd, ListBase *lb) { - Panel *pa; - uiList *ui_list; - - link_list(fd, &ar->panels); + link_list(fd, lb); - for (pa = ar->panels.first; pa; pa = pa->next) { + for (Panel *pa = lb->first; pa; pa = pa->next) { pa->paneltab = newdataadr(fd, pa->paneltab); pa->runtime_flag = 0; pa->activedata = NULL; pa->type = NULL; + direct_link_panel_list(fd, &pa->children); } +} + +static void direct_link_region(FileData *fd, ARegion *ar, int spacetype) +{ + uiList *ui_list; + + direct_link_panel_list(fd, &ar->panels); link_list(fd, &ar->panels_category_active); |