[Bf-blender-cvs] [a883f0fd54d] blender2.8: UI: add separators in properties editor header tabs.

Brecht Van Lommel noreply at git.blender.org
Thu Jul 5 19:29:42 CEST 2018


Commit: a883f0fd54df89c18ac32e2a1f2d04c56081b8a6
Author: Brecht Van Lommel
Date:   Thu Jul 5 19:19:43 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa883f0fd54df89c18ac32e2a1f2d04c56081b8a6

UI: add separators in properties editor header tabs.

===================================================================

M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/makesrna/intern/rna_space.c

===================================================================

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)) {



More information about the Bf-blender-cvs mailing list