[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59769] branches/soc-2013-ui_replay/source /blender: The operator redo panel now stays open when the toolbar is hidden .

Vincent Akkermans vincent at ack-err.net
Tue Sep 3 17:26:25 CEST 2013


Revision: 59769
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59769
Author:   ack-err
Date:     2013-09-03 15:26:24 +0000 (Tue, 03 Sep 2013)
Log Message:
-----------
The operator redo panel now stays open when the toolbar is hidden. This only works when region overlap is turned on in the user preferences.

Modified Paths:
--------------
    branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c
    branches/soc-2013-ui_replay/source/blender/editors/interface/interface_panel.c
    branches/soc-2013-ui_replay/source/blender/editors/screen/area.c
    branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c

Modified: branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c	2013-09-03 11:41:18 UTC (rev 59768)
+++ branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c	2013-09-03 15:26:24 UTC (rev 59769)
@@ -237,6 +237,13 @@
 				ar->regiontype = RGN_TYPE_TOOLS;
 				ar->alignment = RGN_ALIGN_LEFT;
 				//ar->flag = RGN_FLAG_HIDDEN;
+				
+				/* tool props */
+				ar = MEM_callocN(sizeof(ARegion), "tool properties for view3d");
+				
+				BLI_addtail(lb, ar);
+				ar->regiontype = RGN_TYPE_TOOL_PROPS;
+				ar->alignment = RGN_SPLIT_PREV | RGN_ALIGN_BOTTOM;
 
 				/* buttons/list view */
 				ar = MEM_callocN(sizeof(ARegion), "buttons for view3d");

Modified: branches/soc-2013-ui_replay/source/blender/editors/interface/interface_panel.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/interface/interface_panel.c	2013-09-03 11:41:18 UTC (rev 59768)
+++ branches/soc-2013-ui_replay/source/blender/editors/interface/interface_panel.c	2013-09-03 15:26:24 UTC (rev 59769)
@@ -1370,8 +1370,11 @@
 			ED_region_tag_redraw(ar);
 			if (align)
 				panel_activate_state(C, block->panel, PANEL_STATE_ANIMATION);
-			if (ar->regiontype == RGN_TYPE_TOOL_PROPS)
+			if (ar->regiontype == RGN_TYPE_TOOL_PROPS) {
 				WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+				/* The size of the redo panel region needs to be calculated again */
+				CTX_wm_screen(C)->do_refresh = TRUE;
+			}
 			break;
 		case 3:
 			uiPupBlock(C, panel_popup_create_block, block->panel);

Modified: branches/soc-2013-ui_replay/source/blender/editors/screen/area.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/screen/area.c	2013-09-03 11:41:18 UTC (rev 59768)
+++ branches/soc-2013-ui_replay/source/blender/editors/screen/area.c	2013-09-03 15:26:24 UTC (rev 59769)
@@ -969,10 +969,6 @@
 	if (ar->flag & RGN_FLAG_HIDDEN) {
 		/* hidden is user flag */
 	}
-	else if (rct_fits(remainder, 'v', 1) < 0 || rct_fits(remainder, 'h', 1) < 0) {
-		/* remainder is too small for any usage */
-		ar->flag |= RGN_FLAG_TOO_SMALL;
-	}
 	else if (alignment == RGN_ALIGN_NONE) {
 		/* typically last region */
 		ar->winrct = *remainder;
@@ -985,9 +981,8 @@
 			Panel *pa = NULL;
 			for (pa = ar->panels.first; pa; pa = pa->next) {
 				// TODO: is there a better way to test for the identity of a panel type?
-				if (pa->type && strcmp(pa->type->idname, "VIEW3D_PT_last_operator") == 0) {
+				if (pa->type && strcmp(pa->type->idname, "VIEW3D_PT_last_operator") == 0)
 					break;
-				}
 			}
 			
 			prefsizey = ((pa && !uiPanelClosed(pa)) ? pa->sizey : 0) + 26;
@@ -1012,6 +1007,12 @@
 				ar->winrct.ymax = ar->winrct.ymin + prefsizey - 1;
 				remainder->ymin = ar->winrct.ymax + 1;
 			}
+			
+			/* Make sure we don't hide the tool props region when the toolbar is hidden.
+			 * This only works nicely with overlapping regions. */
+			if (ar->overlap && ar->regiontype == RGN_TYPE_TOOL_PROPS && ar->prev && (ar->prev->flag & RGN_FLAG_HIDDEN || ar->prev->flag & RGN_FLAG_TOO_SMALL)) {
+					ar->winrct.xmax = prefsizex - 1;
+			}
 		}
 	}
 	else if (ELEM(alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) {

Modified: branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c	2013-09-03 11:41:18 UTC (rev 59768)
+++ branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c	2013-09-03 15:26:24 UTC (rev 59769)
@@ -98,37 +98,37 @@
 	return arnew;
 }
 
-ARegion *view3d_has_tools_region(ScrArea *sa)
-{
-	ARegion *ar, *artool = NULL, *arhead;
-	
-	for (ar = sa->regionbase.first; ar; ar = ar->next) {
-		if (ar->regiontype == RGN_TYPE_TOOLS)
-			artool = ar;
-	}
-	
-	/* tool region hide/unhide also hides props */
-	if (artool) return artool;
-	
-	if (artool == NULL) {
-		/* add subdiv level; after header */
-		for (arhead = sa->regionbase.first; arhead; arhead = arhead->next)
-			if (arhead->regiontype == RGN_TYPE_HEADER)
-				break;
-		
-		/* is error! */
-		if (arhead == NULL) return NULL;
-		
-		artool = MEM_callocN(sizeof(ARegion), "tools for view3d");
-		
-		BLI_insertlinkafter(&sa->regionbase, arhead, artool);
-		artool->regiontype = RGN_TYPE_TOOLS;
-		artool->alignment = RGN_ALIGN_LEFT;
-		artool->flag = RGN_FLAG_HIDDEN;
-	}
-	
-	return artool;
-}
+//ARegion *view3d_has_tools_region(ScrArea *sa)
+//{
+//	ARegion *ar, *artool = NULL, *arhead;
+//	
+//	for (ar = sa->regionbase.first; ar; ar = ar->next) {
+//		if (ar->regiontype == RGN_TYPE_TOOLS)
+//			artool = ar;
+//	}
+//	
+//	/* tool region hide/unhide also hides props */
+//	if (artool) return artool;
+//	
+//	if (artool == NULL) {
+//		/* add subdiv level; after header */
+//		for (arhead = sa->regionbase.first; arhead; arhead = arhead->next)
+//			if (arhead->regiontype == RGN_TYPE_HEADER)
+//				break;
+//		
+//		/* is error! */
+//		if (arhead == NULL) return NULL;
+//		
+//		artool = MEM_callocN(sizeof(ARegion), "tools for view3d");
+//		
+//		BLI_insertlinkafter(&sa->regionbase, arhead, artool);
+//		artool->regiontype = RGN_TYPE_TOOLS;
+//		artool->alignment = RGN_ALIGN_LEFT;
+//		artool->flag = RGN_FLAG_HIDDEN;
+//	}
+//	
+//	return artool;
+//}
 
 /* ****************************************************** */
 
@@ -785,7 +785,7 @@
 {
 	Scene *scene = sc->scene;
 	View3D *v3d = sa->spacedata.first;
-	
+
 	/* context changes */
 	switch (wmn->category) {
 		case NC_ANIMATION:
@@ -936,7 +936,6 @@
 					rv3d->rflag |= RV3D_GPULIGHT_UPDATE;
 				}
 				ED_region_tag_redraw(ar);
-				sc->do_refresh = TRUE;
 			}
 			break;
 		case NC_ID:




More information about the Bf-blender-cvs mailing list