[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59802] branches/soc-2013-ui_replay/source /blender/editors/space_view3d/view3d_toolbar.c: The popup menu to hide panels now shows the toggles in the right order.

Vincent Akkermans vincent at ack-err.net
Wed Sep 4 16:40:04 CEST 2013


Revision: 59802
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59802
Author:   ack-err
Date:     2013-09-04 14:40:04 +0000 (Wed, 04 Sep 2013)
Log Message:
-----------
The popup menu to hide panels now shows the toggles in the right order.

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

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-09-04 14:34:09 UTC (rev 59801)
+++ branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c	2013-09-04 14:40:04 UTC (rev 59802)
@@ -132,6 +132,14 @@
 		printf("popup callback\n");
 }
 
+static int sort_panels_by_sortorder(void *o1, void *o2)
+{
+	Panel *pa1 = (Panel*)o1;
+	Panel *pa2 = (Panel*)o2;
+	
+	return pa1->sortorder > pa2->sortorder;
+}
+
 static uiBlock *active_panel_menu_popup_create_block(bContext *C, ARegion *cur_ar, void *arg_ar)
 {
 	uiBlock *block;
@@ -153,6 +161,7 @@
 	col = uiLayoutColumn(layout, TRUE);
 	
 	CTX_wm_region_set(C, ar);
+	BLI_sortlist(&ar->panels, sort_panels_by_sortorder);
 	for (pa = ar->panels.first; pa; pa = pa->next) {
 		/* Create a button with a callback for each panel that belongs fits the mode */
 		if (!pa->type || pa->type->flag & PNL_NO_HEADER




More information about the Bf-blender-cvs mailing list