[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59659] trunk/blender: minor ui edits

Campbell Barton ideasman42 at gmail.com
Fri Aug 30 13:49:35 CEST 2013


Revision: 59659
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59659
Author:   campbellbarton
Date:     2013-08-30 11:49:35 +0000 (Fri, 30 Aug 2013)
Log Message:
-----------
minor ui edits
- move addon refresh button into header
- uilist, use icon for sorting by name (gives more room for name, icon is used in fileselector for same purpose).
- rename orderby to sort in rna and flag names.
- simplify BKE_nurb_handle_calc_simple

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
    trunk/blender/source/blender/blenkernel/intern/curve.c
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_templates.c
    trunk/blender/source/blender/makesdna/DNA_screen_types.h
    trunk/blender/source/blender/makesrna/intern/rna_ui.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2013-08-30 11:46:19 UTC (rev 59658)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2013-08-30 11:49:35 UTC (rev 59659)
@@ -62,6 +62,7 @@
             layout.operator("wm.keyconfig_export")
         elif userpref.active_section == 'ADDONS':
             layout.operator("wm.addon_install", icon="FILESEL")
+            layout.operator("wm.addon_refresh", icon='FILE_REFRESH')
             layout.menu("USERPREF_MT_addons_dev_guides")
         elif userpref.active_section == 'THEMES':
             layout.operator("ui.reset_default_theme")
@@ -1147,7 +1148,6 @@
         split = layout.split(percentage=0.2)
         col = split.column()
         col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
-        col.operator("wm.addon_refresh", icon='FILE_REFRESH')
 
         col.label(text="Supported Level")
         col.prop(context.window_manager, "addon_support", expand=True)

Modified: trunk/blender/source/blender/blenkernel/intern/curve.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/curve.c	2013-08-30 11:46:19 UTC (rev 59658)
+++ trunk/blender/source/blender/blenkernel/intern/curve.c	2013-08-30 11:49:35 UTC (rev 59659)
@@ -3088,25 +3088,8 @@
  * figures out the previous and next for us */
 void BKE_nurb_handle_calc_simple(Nurb *nu, BezTriple *bezt)
 {
-	int index = (int)(bezt - nu->bezt);
-	BezTriple *prev, *next;
-
-	BLI_assert(ARRAY_HAS_ITEM(bezt, nu->bezt, nu->pntsu));
-
-	if (nu->pntsu > 1) {
-		if (index == 0) {
-			prev = (nu->flagu & CU_NURB_CYCLIC) ? &nu->bezt[nu->pntsu - 1] : NULL;
-			next = bezt + 1;
-		}
-		else if (index == nu->pntsu - 1) {
-			prev = bezt - 1;
-			next = (nu->flagu & CU_NURB_CYCLIC) ? &nu->bezt[0] : NULL;
-		}
-	}
-	else {
-		prev = next = NULL;
-	}
-
+	BezTriple *prev = BKE_nurb_bezt_get_prev(nu, bezt);
+	BezTriple *next = BKE_nurb_bezt_get_next(nu, bezt);
 	BKE_nurb_handle_calc(bezt, prev, next, 0);
 }
 

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-08-30 11:46:19 UTC (rev 59658)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-08-30 11:49:35 UTC (rev 59659)
@@ -6589,7 +6589,7 @@
 
 				/* activate up/down the list */
 				value = value_orig;
-				if ((ui_list->filter_orderby_flag & UILST_FLT_ORDERBY_REVERSE) != 0) {
+				if ((ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) != 0) {
 					inc = ELEM(type, UPARROWKEY, WHEELUPMOUSE) ? 1 : -1;
 				}
 				else {

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2013-08-30 11:46:19 UTC (rev 59658)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2013-08-30 11:49:35 UTC (rev 59659)
@@ -2513,9 +2513,9 @@
 	        (ui_list->filter_flag & UILST_FLT_EXCLUDE) ? ICON_ZOOM_OUT : ICON_ZOOM_IN);
 
 	subrow = uiLayoutRow(row, TRUE);
-	uiItemR(subrow, &listptr, "use_filter_orderby_name", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
-	uiItemR(subrow, &listptr, "use_filter_orderby_invert", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "",
-	        (ui_list->filter_orderby_flag & UILST_FLT_ORDERBY_REVERSE) ? ICON_TRIA_UP : ICON_TRIA_DOWN);
+	uiItemR(subrow, &listptr, "use_filter_sort_alpha", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+	uiItemR(subrow, &listptr, "use_filter_sort_reverse", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "",
+	        (ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) ? ICON_TRIA_UP : ICON_TRIA_DOWN);
 }
 
 typedef struct {
@@ -2538,7 +2538,7 @@
 	const char *filter_raw = ui_list->filter_byname;
 	char *filter = (char *)filter_raw, filter_buff[32], *filter_dyn = NULL;
 	bool filter_exclude = (ui_list->filter_flag & UILST_FLT_EXCLUDE) != 0;
-	bool order_by_name = (ui_list->filter_orderby_flag & UILST_FLT_ORDERBY_NAME) != 0;
+	bool order_by_name = (ui_list->filter_sort_flag & UILST_FLT_SORT_ALPHA) != 0;
 	int len = RNA_property_collection_length(dataptr, prop);
 
 	dyn_data->items_shown = dyn_data->items_len = len;
@@ -2838,7 +2838,7 @@
 	/* Filter list items! (not for compact layout, though) */
 	if (dataptr->data && prop) {
 		int filter_exclude = ui_list->filter_flag & UILST_FLT_EXCLUDE;
-		bool order_reverse = (ui_list->filter_orderby_flag & UILST_FLT_ORDERBY_REVERSE) != 0;
+		bool order_reverse = (ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) != 0;
 		int items_shown, idx = 0;
 #if 0
 		int prev_ii = -1, prev_i;
@@ -3092,7 +3092,7 @@
 			uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
 
 			uiBlockSetEmboss(subblock, UI_EMBOSS);
- 		}
+		}
 	}
 
 	if (items_ptr) {

Modified: trunk/blender/source/blender/makesdna/DNA_screen_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_screen_types.h	2013-08-30 11:46:19 UTC (rev 59658)
+++ trunk/blender/source/blender/makesdna/DNA_screen_types.h	2013-08-30 11:49:35 UTC (rev 59659)
@@ -147,7 +147,7 @@
 	/* Filtering data. */
 	char filter_byname[64];	      /* defined as UI_MAX_NAME_STR */
 	int filter_flag;
-	int filter_orderby_flag;
+	int filter_sort_flag;
 
 	/* Custom sub-classes properties. */
 	IDProperty *properties;
@@ -284,11 +284,11 @@
 
 /* uiList filter orderby type */
 enum {
-	UILST_FLT_ORDERBY_NAME         = 1 << 0,
-	UILST_FLT_ORDERBY_REVERSE      = 1 << 31  /* Special value, bitflag used to reverse order! */
+	UILST_FLT_SORT_ALPHA         = 1 << 0,
+	UILST_FLT_SORT_REVERSE      = 1 << 31  /* Special value, bitflag used to reverse order! */
 };
 
-#define UILST_FLT_ORDERBY_MASK (((unsigned int)UILST_FLT_ORDERBY_REVERSE) - 1)
+#define UILST_FLT_SORT_MASK (((unsigned int)UILST_FLT_SORT_REVERSE) - 1)
 
 /* regiontype, first two are the default set */
 /* Do NOT change order, append on end. Types are hardcoded needed */

Modified: trunk/blender/source/blender/makesrna/intern/rna_ui.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_ui.c	2013-08-30 11:46:19 UTC (rev 59658)
+++ trunk/blender/source/blender/makesrna/intern/rna_ui.c	2013-08-30 11:49:35 UTC (rev 59659)
@@ -1048,12 +1048,13 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "filter_flag", UILST_FLT_EXCLUDE);
 	RNA_def_property_ui_text(prop, "Invert", "Invert filtering (show hidden items, and vice-versa)");
 
-	prop = RNA_def_property(srna, "use_filter_orderby_name", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "filter_orderby_flag", UILST_FLT_ORDERBY_NAME);
-	RNA_def_property_ui_text(prop, "Order by Name", "Order shown items by their names");
+	prop = RNA_def_property(srna, "use_filter_sort_alpha", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "filter_sort_flag", UILST_FLT_SORT_ALPHA);
+	RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0);
+	RNA_def_property_ui_text(prop, "Sort by Name", "Sort items by their name");
 
-	prop = RNA_def_property(srna, "use_filter_orderby_invert", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "filter_orderby_flag", UILST_FLT_ORDERBY_REVERSE);
+	prop = RNA_def_property(srna, "use_filter_sort_reverse", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "filter_sort_flag", UILST_FLT_SORT_REVERSE);
 	RNA_def_property_ui_text(prop, "Invert", "Invert the order of shown items");
 
 	/* draw_item */




More information about the Bf-blender-cvs mailing list