[Bf-blender-cvs] [9fc79a40337] blender2.8: UI: disable broken horizontal properties editor alignment.

Brecht Van Lommel noreply at git.blender.org
Fri Jul 6 14:33:27 CEST 2018


Commit: 9fc79a403374d06a23080df6249c207357009716
Author: Brecht Van Lommel
Date:   Fri Jul 6 13:46:26 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9fc79a403374d06a23080df6249c207357009716

UI: disable broken horizontal properties editor alignment.

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

M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/space_buttons/space_buttons.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index bc69b1d99fc..8dae3b235c2 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1033,7 +1033,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
 						SpaceButs *sbuts = (SpaceButs *) sl;
 
 						sbuts->v2d.maxzoom = 1.2f;
-						sbuts->align = 1;	/* horizontal default */
 
 						if (sbuts->mainb == BUTS_LAMP) {
 							sbuts->mainb = CONTEXT_SHADING;
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 8107254f30b..a99a6610e88 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -117,12 +117,17 @@ static void panel_activate_state(const bContext *C, Panel *pa, uiHandlePanelStat
 /*********************** space specific code ************************/
 /* temporary code to remove all sbuts stuff from panel code         */
 
+/* SpaceButs.align */
+typedef enum eSpaceButtons_Align {
+	BUT_HORIZONTAL = 0,
+	BUT_VERTICAL = 1,
+	BUT_AUTO = 2,
+} eSpaceButtons_Align;
+
 static int panel_aligned(ScrArea *sa, ARegion *ar)
 {
-	if (sa->spacetype == SPACE_BUTS && ar->regiontype == RGN_TYPE_WINDOW) {
-		SpaceButs *sbuts = sa->spacedata.first;
-		return sbuts->align;
-	}
+	if (sa->spacetype == SPACE_BUTS && ar->regiontype == RGN_TYPE_WINDOW)
+		return BUT_VERTICAL;
 	else if (sa->spacetype == SPACE_USERPREF && ar->regiontype == RGN_TYPE_WINDOW)
 		return BUT_VERTICAL;
 	else if (sa->spacetype == SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS)
@@ -180,10 +185,8 @@ static bool panels_need_realign(ScrArea *sa, ARegion *ar, Panel **pa_animate)
 	if (sa->spacetype == SPACE_BUTS && ar->regiontype == RGN_TYPE_WINDOW) {
 		SpaceButs *sbuts = sa->spacedata.first;
 
-		if (sbuts->align) {
-			if (sbuts->re_align || sbuts->mainbo != sbuts->mainb) {
-				return true;
-			}
+		if (sbuts->mainbo != sbuts->mainb) {
+			return true;
 		}
 	}
 	else if (sa->spacetype == SPACE_IMAGE && ar->regiontype == RGN_TYPE_PREVIEW) {
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 55ca3524a61..6f7a4ca971a 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -65,7 +65,6 @@ static SpaceLink *buttons_new(const ScrArea *UNUSED(area), const Scene *UNUSED(s
 
 	sbuts = MEM_callocN(sizeof(SpaceButs), "initbuts");
 	sbuts->spacetype = SPACE_BUTS;
-	sbuts->align = BUT_VERTICAL;
 
 	sbuts->mainb = sbuts->mainbuser = BCONTEXT_OBJECT;
 
@@ -109,17 +108,8 @@ static void buttons_free(SpaceLink *sl)
 }
 
 /* spacetype; init callback */
-static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
+static void buttons_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
 {
-	SpaceButs *sbuts = sa->spacedata.first;
-
-	/* auto-align based on size */
-	if (sbuts->align == BUT_AUTO || !sbuts->align) {
-		if (sa->winx > sa->winy)
-			sbuts->align = BUT_HORIZONTAL;
-		else
-			sbuts->align = BUT_VERTICAL;
-	}
 }
 
 static SpaceLink *buttons_duplicate(SpaceLink *sl)
@@ -146,8 +136,6 @@ static void buttons_main_region_init(wmWindowManager *wm, ARegion *ar)
 
 static void buttons_main_region_layout_properties(const bContext *C, SpaceButs *sbuts, ARegion *ar)
 {
-	const bool vertical = (sbuts->align == BUT_VERTICAL);
-
 	buttons_context_compute(C, sbuts);
 
 	const char *contexts[2] = {NULL, NULL};
@@ -203,12 +191,12 @@ static void buttons_main_region_layout_properties(const bContext *C, SpaceButs *
 			break;
 	}
 
+	const bool vertical = true;
 	ED_region_panels_layout_ex(C, ar, contexts, sbuts->mainb, vertical);
 }
 
-static void buttons_main_region_layout_tool(const bContext *C, SpaceButs *sbuts, ARegion *ar)
+static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar)
 {
-	const bool vertical = (sbuts->align == BUT_VERTICAL);
 	const char *contexts[3] = {NULL};
 
 	const WorkSpace *workspace = CTX_wm_workspace(C);
@@ -263,6 +251,7 @@ static void buttons_main_region_layout_tool(const bContext *C, SpaceButs *sbuts,
 		/* TODO */
 	}
 
+	const bool vertical = true;
 	ED_region_panels_layout_ex(C, ar, contexts, -1, vertical);
 }
 
@@ -272,13 +261,12 @@ static void buttons_main_region_layout(const bContext *C, ARegion *ar)
 	SpaceButs *sbuts = CTX_wm_space_buts(C);
 
 	if (sbuts->mainb == BCONTEXT_TOOL) {
-		buttons_main_region_layout_tool(C, sbuts, ar);
+		buttons_main_region_layout_tool(C, ar);
 	}
 	else {
 		buttons_main_region_layout_properties(C, sbuts, ar);
 	}
 
-	sbuts->re_align = 0;
 	sbuts->mainbo = sbuts->mainb;
 }
 
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index bbfbf660774..d6d043b03ae 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -138,8 +138,8 @@ typedef struct SpaceButs {
 	short space_subtype;
 
 	short mainb, mainbo, mainbuser; /* context tabs */
-	short re_align, align;          /* align for panels */
 	short preview;                  /* preview is signal to refresh */
+	short pad[2];
 	char flag;
 	char collection_context;
 
@@ -213,14 +213,6 @@ typedef enum eSpaceButtons_Flag {
 	SB_SHADING_CONTEXT = (1 << 4),
 } eSpaceButtons_Flag;
 
-/* SpaceButs.align */
-typedef enum eSpaceButtons_Align {
-	BUT_FREE = 0,
-	BUT_HORIZONTAL = 1,
-	BUT_VERTICAL = 2,
-	BUT_AUTO = 3,
-} eSpaceButtons_Align;
-
 /** \} */
 
 /* -------------------------------------------------------------------- */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 92913e29f69..2a7bb5994c3 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1326,14 +1326,6 @@ static void rna_SpaceProperties_context_update(Main *UNUSED(bmain), Scene *UNUSE
 	}
 }
 
-static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
-{
-	SpaceButs *sbuts = (SpaceButs *)(ptr->data);
-
-	sbuts->align = value;
-	sbuts->re_align = 1;
-}
-
 /* Space Console */
 static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
 {
@@ -3161,12 +3153,6 @@ static void rna_def_space_buttons(BlenderRNA *brna)
 	StructRNA *srna;
 	PropertyRNA *prop;
 
-	static const EnumPropertyItem align_items[] = {
-		{BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
-		{BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
-		{0, NULL, 0, NULL, NULL}
-	};
-
 	srna = RNA_def_struct(brna, "SpaceProperties", "Space");
 	RNA_def_struct_sdna(srna, "SpaceButs");
 	RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
@@ -3178,13 +3164,6 @@ static void rna_def_space_buttons(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
 
-	prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
-	RNA_def_property_enum_sdna(prop, NULL, "align");
-	RNA_def_property_enum_items(prop, align_items);
-	RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL);
-	RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
-
 	/* pinned data */
 	prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "pinid");



More information about the Bf-blender-cvs mailing list