[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24084] trunk/blender: *Started to add theme editing in Preferences.

William Reynish william at reynish.com
Mon Oct 26 12:03:12 CET 2009


Revision: 24084
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24084
Author:   billrey
Date:     2009-10-26 12:03:12 +0100 (Mon, 26 Oct 2009)

Log Message:
-----------
*Started to add theme editing in Preferences. Isn't visible in the UI yet.
*Moved some preferences around
*Changed the file browser '..' icon (Thanks Elubie!)

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_userpref.py
    trunk/blender/source/blender/editors/space_file/file_draw.c
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/release/scripts/ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/ui/space_userpref.py	2009-10-26 10:19:25 UTC (rev 24083)
+++ trunk/blender/release/scripts/ui/space_userpref.py	2009-10-26 11:03:12 UTC (rev 24084)
@@ -83,38 +83,30 @@
 		sub1.itemR(view, "zoom_to_mouse")
 		sub1.itemR(view, "rotate_around_selection")
 		sub1.itemS()
-		sub1.itemL(text="Zoom Style:")
-		sub1.row().itemR(view, "viewport_zoom_style", expand=True)
-		sub1.itemL(text="Orbit Style:")
-		sub1.row().itemR(view, "view_rotation", expand=True)
-		sub1.itemR(view, "perspective_orthographic_switch")
+		
+		
+		sub1.itemR(view, "auto_perspective")
 		sub1.itemR(view, "smooth_view")
 		sub1.itemR(view, "rotation_angle")
 		
-		col = split.column()
-		sub = col.split(percentage=0.85)
 		
-		sub1 = sub.column()
-		sub1.itemL(text="Menus:")
-		sub1.itemR(view, "open_mouse_over")
-		sub1.itemL(text="Menu Open Delay:")
-		sub1.itemR(view, "open_toplevel_delay", text="Top Level")
-		sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
+		
 
-		sub1.itemS()
-		sub1.itemS()
-		sub1.itemS()			
-
-		sub1.itemL(text="Toolbox:")
-		sub1.itemR(view, "use_column_layout")
-		sub1.itemL(text="Open Toolbox Delay:")
-		sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
-		sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
-
+					
+		
 		col = split.column()
 		sub = col.split(percentage=0.85)
+		sub1 = sub.column()
 		
-		sub1 = sub.column()
+#Toolbox doesn't exist yet
+#		sub1.itemL(text="Toolbox:")
+#		sub1.itemR(view, "use_column_layout")
+#		sub1.itemL(text="Open Toolbox Delay:")
+#		sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB")
+#		sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB")
+		
+		
+		
 		#manipulator
 		sub1.itemR(view, "use_manipulator")
 		sub2 = sub1.column()
@@ -122,6 +114,16 @@
 		sub2.itemR(view, "manipulator_size", text="Size")
 		sub2.itemR(view, "manipulator_handle_size", text="Handle Size")
 		sub2.itemR(view, "manipulator_hotspot", text="Hotspot")	
+		
+		sub1.itemS()
+		sub1.itemS()
+		sub1.itemS()
+		
+		sub1.itemL(text="Menus:")
+		sub1.itemR(view, "open_mouse_over")
+		sub1.itemL(text="Menu Open Delay:")
+		sub1.itemR(view, "open_toplevel_delay", text="Top Level")
+		sub1.itemR(view, "open_sublevel_delay", text="Sub Level")
 
 class USERPREF_PT_edit(bpy.types.Panel):
 	__space_type__ = 'USER_PREFERENCES'
@@ -137,7 +139,6 @@
 		
 		userpref = context.user_preferences
 		edit = userpref.edit
-		view = userpref.view
 		
 		split = layout.split()
 		
@@ -157,9 +158,14 @@
 		sub1.itemS()
 		sub1.itemS()
 		sub1.itemS()
-		sub1.itemL(text="Transform:")
-		sub1.itemR(edit, "drag_immediately")
+		
+		sub1.itemL(text="Undo:")
+		sub1.itemR(edit, "global_undo")
+		sub1.itemR(edit, "undo_steps", text="Steps")
+		sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
+		
 
+
 		col = split.column()
 		sub = col.split(percentage=0.85)
 		
@@ -199,10 +205,8 @@
 		sub1.itemS()
 		sub1.itemS()
 		
-		sub1.itemL(text="Undo:")
-		sub1.itemR(edit, "global_undo")
-		sub1.itemR(edit, "undo_steps", text="Steps")
-		sub1.itemR(edit, "undo_memory_limit", text="Memory Limit")
+		sub1.itemL(text="Transform:")
+		sub1.itemR(edit, "drag_immediately")
 		
 		sub1.itemS()
 		sub1.itemS()
@@ -399,7 +403,7 @@
 		wm = context.manager
 		#input = userpref.input
 		input = userpref
-		view = userpref.view
+		inputs = userpref.inputs
 
 		split = layout.split(percentage=0.25)
 
@@ -416,15 +420,26 @@
 		sub = col.column()
 		sub.itemL(text="Mouse:")
 		sub1 = sub.column()
-		sub1.enabled = (view.select_mouse == 'RIGHT')
-		sub1.itemR(view, "emulate_3_button_mouse")
-		sub.itemR(view, "continuous_mouse")
+		sub1.enabled = (inputs.select_mouse == 'RIGHT')
+		sub1.itemR(inputs, "emulate_3_button_mouse")
+		sub.itemR(inputs, "continuous_mouse")
 
 		sub.itemL(text="Select With:")
-		sub.row().itemR(view, "select_mouse", expand=True)
-		#sub.itemL(text="Middle Mouse:")
-		#sub.row().itemR(view, "middle_mouse", expand=True)
-		#sub.itemR(view, "use_middle_mouse_paste")
+		sub.row().itemR(inputs, "select_mouse", expand=True)
+		sub.itemL(text="Middle Mouse:")
+		sub.row().itemR(inputs, "middle_mouse", expand=True)
+		
+		sub.itemS()
+		sub.itemS()
+		sub.itemS()
+		
+		sub.itemL(text="Orbit Style:")
+		sub.row().itemR(inputs, "view_rotation", expand=True)
+		
+		sub.itemL(text="Zoom Style:")
+		sub.row().itemR(inputs, "viewport_zoom_style", expand=True)
+		
+		#sub.itemR(inputs, "use_middle_mouse_paste")
 
 		#col.itemS()
 
@@ -437,8 +452,8 @@
 
 		sub = col.column()
 		sub.itemL(text="NDOF Device:")
-		sub.itemR(view, "ndof_pan_speed", text="Pan Speed")
-		sub.itemR(view, "ndof_rotate_speed", text="Orbit Speed")
+		sub.itemR(inputs, "ndof_pan_speed", text="Pan Speed")
+		sub.itemR(inputs, "ndof_rotate_speed", text="Orbit Speed")
 
 		row.itemS()
 

Modified: trunk/blender/source/blender/editors/space_file/file_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_draw.c	2009-10-26 10:19:25 UTC (rev 24083)
+++ trunk/blender/source/blender/editors/space_file/file_draw.c	2009-10-26 11:03:12 UTC (rev 24084)
@@ -290,8 +290,12 @@
 
 static int get_file_icon(struct direntry *file)
 {
-	if (file->type & S_IFDIR)
+	if (file->type & S_IFDIR) {
+		if ( strcmp(file->relname, "..") == 0) {
+				return  ICON_FILE_PARENT;
+		}
 		return ICON_FILE_FOLDER;
+	}
 	else if (file->flags & BLENDERFILE)
 		return ICON_FILE_BLEND;
 	else if (file->flags & IMAGEFILE)

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2009-10-26 10:19:25 UTC (rev 24083)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2009-10-26 11:03:12 UTC (rev 24084)
@@ -266,6 +266,8 @@
 	ThemeWireColor tarm[20];
 	/*ThemeWireColor tobj[20];*/
 	
+	int active_theme_group, pad;
+	
 } bTheme;
 
 typedef struct SolidLight {

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2009-10-26 10:19:25 UTC (rev 24083)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2009-10-26 11:03:12 UTC (rev 24084)
@@ -116,6 +116,11 @@
 	return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
 }
 
+static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
+{
+	return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data);
+}
+
 static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
 {
 	return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
@@ -1414,7 +1419,15 @@
 {
 	StructRNA *srna;
 	PropertyRNA *prop;
+	
+	static EnumPropertyItem active_theme_group[] = {
+		{0, "USER_INTERFACE", 0, "User Interface", ""},
+		{1, "VIEW_3D", 0, "View 3D", ""},
+		{2, "GRAPH_EDITOR", 0, "Graph Editor", ""},
+		{3, "FILE_BROWSER", 0, "File Browser", ""},
 
+		{0, NULL, 0, NULL, NULL}};
+
 	srna= RNA_def_struct(brna, "Theme", NULL);
 	RNA_def_struct_sdna(srna, "bTheme");
 	RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface.");
@@ -1423,6 +1436,11 @@
 	RNA_def_property_ui_text(prop, "Name", "Name of the theme.");
 	RNA_def_struct_name_property(srna, prop);
 
+	prop= RNA_def_property(srna, "active_theme_group", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "active_theme_group");
+	RNA_def_property_enum_items(prop, active_theme_group);
+	RNA_def_property_ui_text(prop, "Theme Group", "");
+
 	prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
 	RNA_def_property_flag(prop, PROP_NEVER_NULL);
 	RNA_def_property_pointer_sdna(prop, NULL, "tui");
@@ -1585,35 +1603,13 @@
 {
 	PropertyRNA *prop;
 	StructRNA *srna;
-
-	static EnumPropertyItem view_zoom_styles[] = {
-		{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down."},
-		{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement."},
-		{USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center."},
-		{0, NULL, 0, NULL, NULL}};
 	
-	static EnumPropertyItem select_mouse_items[] = {
-		{USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection."},
-		{0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection."},
-		{0, NULL, 0, NULL, NULL}};
-		
-	static EnumPropertyItem middle_mouse_mouse_items[] = {
-		{0, "PAN", 0, "Pan", "Use the middle mouse button for panning the viewport."},
-		{USER_VIEWMOVE, "ROTATE", 0, "Rotate", "Use the middle mouse button for rotation the viewport."},
-		{0, NULL, 0, NULL, NULL}};
-
-	static EnumPropertyItem view_rotation_items[] = {
-		{0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport."},
-		{USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport."},
-		{0, NULL, 0, NULL, NULL}};
-
-
 	srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
 	RNA_def_struct_sdna(srna, "UserDef");
 	RNA_def_struct_nested(brna, srna, "UserPreferences");
 	RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
 
-	/* View and Controls  */
+	/* View  */
 
 	/* display */
 	prop= RNA_def_property(srna, "tooltips", PROP_BOOLEAN, PROP_NONE);
@@ -1683,10 +1679,6 @@
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
 	RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction.");
 
-	prop= RNA_def_property(srna, "continuous_mouse", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
-	RNA_def_property_ui_text(prop, "Continuous Grab", "Experimental option to allow moving the mouse outside the view");
-
 	prop= RNA_def_property(srna, "global_pivot", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
 	RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views.");
@@ -1696,24 +1688,16 @@
 	RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality.");
 
 	/* view zoom */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list