diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-05 20:19:43 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-05 20:27:50 +0300 |
commit | a883f0fd54df89c18ac32e2a1f2d04c56081b8a6 (patch) | |
tree | a2de274e4958d79768263ebd3efbd918feed564f /source | |
parent | dbdafe1209a4787d6f8dcafa034bc9ced3c7f365 (diff) |
UI: add separators in properties editor header tabs.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 12 |
3 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 9b9199538d6..358131fcb87 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -680,10 +680,13 @@ static void ui_item_enum_expand( } for (item = item_array; item->identifier; item++) { - if (!item->identifier[0]) { + if (!item->identifier[0] && (item+1)->identifier) { if (radial && layout_radial) { uiItemS(layout_radial); } + else { + uiItemS(block->curlayout); + } continue; } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 4ad62ec705d..19a55c2e3cd 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1009,10 +1009,10 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) name = RNA_struct_name_get_alloc(ptr, namebuf, sizeof(namebuf), NULL); if (name) { - if ((!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE, BCONTEXT_VIEW_LAYER) && ptr->type == &RNA_Scene)) { + if ((!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE, BCONTEXT_VIEW_LAYER, BCONTEXT_WORLD) && ptr->type == &RNA_Scene)) { uiItemLDrag(row, ptr, "", icon); /* save some space */ } - else if ((!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE, BCONTEXT_VIEW_LAYER) && ptr->type == &RNA_ViewLayer)) { + else if ((!ELEM(sbuts->mainb, BCONTEXT_RENDER, BCONTEXT_SCENE, BCONTEXT_VIEW_LAYER, BCONTEXT_WORLD) && ptr->type == &RNA_ViewLayer)) { uiItemLDrag(row, ptr, "", icon); /* save some space */ } else { diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 249f6b29143..df7cc228fc4 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1241,6 +1241,14 @@ static const EnumPropertyItem *rna_SpaceProperties_context_itemf( RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_TOOL); } + if (sbuts->pathflag & (1 << BCONTEXT_WORKSPACE)) { + RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORKSPACE); + } + + if (totitem) { + RNA_enum_item_add_separator(&item, &totitem); + } + if (sbuts->pathflag & (1 << BCONTEXT_RENDER)) { RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER); } @@ -1257,8 +1265,8 @@ static const EnumPropertyItem *rna_SpaceProperties_context_itemf( RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORLD); } - if (sbuts->pathflag & (1 << BCONTEXT_WORKSPACE)) { - RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORKSPACE); + if (totitem) { + RNA_enum_item_add_separator(&item, &totitem); } if (sbuts->pathflag & (1 << BCONTEXT_OBJECT)) { |