[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59559] branches/soc-2013-ui_replay/source /blender/editors/space_view3d: Fixed a regression whereby the redo panel' s size was lagging behind.

Vincent Akkermans vincent at ack-err.net
Tue Aug 27 18:44:11 CEST 2013


Revision: 59559
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59559
Author:   ack-err
Date:     2013-08-27 16:44:11 +0000 (Tue, 27 Aug 2013)
Log Message:
-----------
Fixed a regression whereby the redo panel's size was lagging behind.

Modified Paths:
--------------
    branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c
    branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c

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-08-27 16:27:28 UTC (rev 59558)
+++ branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c	2013-08-27 16:44:11 UTC (rev 59559)
@@ -1171,11 +1171,30 @@
 	}
 }
 
+static int view3d_props_sum_panel_heights(ARegion *ar)
+{
+	Panel *pa;
+	int sum = 0;
+	for (pa = ar->panels.first; pa; pa = pa->next) {
+		sum += pa->sizey;
+	}
+	return sum;
+}
 
 
 static void view3d_props_area_draw(const bContext *C, ARegion *ar)
 {
+	/* If in laying out and redrawing the panels this area contains we find that the
+	 * panels have changed in height we'll need to redraw the area so that its height
+	 * is automatically adapted. If  */
+	int total_panel_height = view3d_props_sum_panel_heights(ar);
+	
 	ED_region_panels(C, ar, 1, CTX_data_mode_string(C), -1);
+	
+	if (total_panel_height != view3d_props_sum_panel_heights(ar)) {
+		ED_area_tag_redraw(CTX_wm_area(C));
+		CTX_wm_screen(C)->do_refresh = TRUE;
+	}
 }
 
 static void view3d_props_area_init(wmWindowManager *wm, ARegion *ar)

Modified: branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c	2013-08-27 16:27:28 UTC (rev 59558)
+++ branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c	2013-08-27 16:44:11 UTC (rev 59559)
@@ -150,13 +150,9 @@
 
 	uiItemL(row, name, modeicon);
 
-	// TODO: somehow this centers the button's text
 	but = uiDefIconBut(uiLayoutGetBlock(row), BUT, 0, ICON_TRIA_RIGHT, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Collapse all panels in this toolbar");
-	//but = uiDefIconTextBut(uiLayoutGetBlock(column), BUT, 0, ICON_NONE, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Collapse All"), 0, 0, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
 	uiButSetFunc(but, collapse_all_panels, pa, NULL);
 	
-//	uiItemO(row, "", ICON_NONE, "WM_OT_create_custom_panel");
-	
 	uiDefIconButO(uiLayoutGetBlock(row), BUT, "WM_OT_create_custom_panel", WM_OP_INVOKE_DEFAULT, ICON_PLUS, 0, 0, UI_UNIT_X, UI_UNIT_Y, "Add a custom panel to this toolbar");
 	
 }




More information about the Bf-blender-cvs mailing list