[Bf-blender-cvs] [bb4c760fddf] master: Preferences: assortment of minor layout tweaks.

Brecht Van Lommel noreply at git.blender.org
Fri Jan 18 16:20:59 CET 2019


Commit: bb4c760fddf8bdd09cb387ad5421ca026eff8378
Author: Brecht Van Lommel
Date:   Fri Jan 18 11:31:26 2019 +0100
Branches: master
https://developer.blender.org/rBbb4c760fddf8bdd09cb387ad5421ca026eff8378

Preferences: assortment of minor layout tweaks.

===================================================================

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/space_topbar/space_topbar.c
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 9b4f9b49a6b..8db0689ad9c 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -216,7 +216,9 @@ class USERPREF_PT_interface_editors(PreferencePanel):
         flow.prop(view, "color_picker_type")
 
 
-class USERPREF_PT_interface_menus(PreferencePanel):
+class USERPREF_PT_interface_menus(Panel):
+    bl_space_type = 'PREFERENCES'
+    bl_region_type = 'WINDOW'
     bl_label = "Menus"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -225,20 +227,13 @@ class USERPREF_PT_interface_menus(PreferencePanel):
         prefs = context.preferences
         return (prefs.active_section == 'INTERFACE')
 
-    def draw_props(self, context, layout):
-        prefs = context.preferences
-        view = prefs.view
-        system = prefs.system
-
-        flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
-
-        flow.prop(view, "use_quit_dialog")
+    def draw(self, context):
+        pass
 
 
 class USERPREF_PT_interface_menus_mouse_over(PreferencePanel):
     bl_label = "Open on Mouse Over"
     bl_parent_id = "USERPREF_PT_interface_menus"
-    bl_options = {'DEFAULT_CLOSED'}
 
     def draw_header(self, context):
         prefs = context.preferences
@@ -261,7 +256,6 @@ class USERPREF_PT_interface_menus_mouse_over(PreferencePanel):
 class USERPREF_PT_interface_menus_pie(PreferencePanel):
     bl_label = "Pie Menus"
     bl_parent_id = "USERPREF_PT_interface_menus"
-    bl_options = {'DEFAULT_CLOSED'}
 
     def draw_props(self, context, layout):
         prefs = context.preferences
@@ -277,32 +271,22 @@ class USERPREF_PT_interface_menus_pie(PreferencePanel):
         flow.prop(view, "pie_menu_confirm")
 
 
-class USERPREF_PT_edit_objects(PreferencePanel):
+class USERPREF_PT_edit_objects(Panel):
     bl_label = "Objects"
+    bl_space_type = 'PREFERENCES'
+    bl_region_type = 'WINDOW'
 
     @classmethod
     def poll(cls, context):
         prefs = context.preferences
         return (prefs.active_section == 'EDITING')
 
-    def draw_props(self, context, layout):
-        prefs = context.preferences
-        edit = prefs.edit
-
-        flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
-
-        flow.prop(edit, "material_link", text="Link Materials to")
-        flow.prop(edit, "object_align", text="Align New Objects to")
-        flow.prop(edit, "use_enter_edit_mode", text="Enter Edit Mode for New Objects")
-
-
-class USERPREF_PT_edit_cursor(PreferencePanel):
-    bl_label = "3D Cursor"
+    def draw(self, context):
+        pass
 
-    @classmethod
-    def poll(cls, context):
-        prefs = context.preferences
-        return (prefs.active_section == 'EDITING')
+class USERPREF_PT_edit_objects_new(PreferencePanel):
+    bl_label = "New Objects"
+    bl_parent_id = "USERPREF_PT_edit_objects"
 
     def draw_props(self, context, layout):
         prefs = context.preferences
@@ -310,20 +294,15 @@ class USERPREF_PT_edit_cursor(PreferencePanel):
 
         flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
 
-        flow.prop(edit, "use_mouse_depth_cursor")
-        flow.prop(edit, "use_cursor_lock_adjust")
+        flow.prop(edit, "material_link", text="Link Materials to")
+        flow.prop(edit, "object_align", text="Align to")
+        flow.prop(edit, "use_enter_edit_mode", text="Enter Edit Mode")
 
 
-class USERPREF_PT_edit_duplicate_data(PreferencePanel):
+class USERPREF_PT_edit_objects_duplicate_data(PreferencePanel):
     bl_label = "Duplicate Data"
-    bl_options = {'DEFAULT_CLOSED'}
     bl_parent_id = "USERPREF_PT_edit_objects"
 
-    @classmethod
-    def poll(cls, context):
-        prefs = context.preferences
-        return (prefs.active_section == 'EDITING')
-
     def draw_props(self, context, layout):
         prefs = context.preferences
         edit = prefs.edit
@@ -347,6 +326,24 @@ class USERPREF_PT_edit_duplicate_data(PreferencePanel):
         col.prop(edit, "use_duplicate_texture", text="Texture")
 
 
+class USERPREF_PT_edit_cursor(PreferencePanel):
+    bl_label = "3D Cursor"
+
+    @classmethod
+    def poll(cls, context):
+        prefs = context.preferences
+        return (prefs.active_section == 'EDITING')
+
+    def draw_props(self, context, layout):
+        prefs = context.preferences
+        edit = prefs.edit
+
+        flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+        flow.prop(edit, "use_mouse_depth_cursor")
+        flow.prop(edit, "use_cursor_lock_adjust")
+
+
 class USERPREF_PT_edit_gpencil(PreferencePanel):
     bl_label = "Grease Pencil"
     bl_options = {'DEFAULT_CLOSED'}
@@ -386,6 +383,7 @@ class USERPREF_PT_edit_annotations(PreferencePanel):
 
 class USERPREF_PT_edit_weight_paint(PreferencePanel):
     bl_label = "Weight Paint"
+    bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
@@ -654,7 +652,7 @@ class USERPREF_PT_viewport_selection(PreferencePanel):
 
 
 class USERPREF_PT_system_memory(PreferencePanel):
-    bl_label = "Memory/Limits"
+    bl_label = "Memory & Limits"
 
     @classmethod
     def poll(cls, context):
@@ -1215,11 +1213,7 @@ class USERPREF_PT_file_paths_development(FilePathsPanel):
 
 class USERPREF_PT_saveload_autorun(PreferencePanel):
     bl_label = "Auto Run Python Scripts"
-
-    @classmethod
-    def poll(cls, context):
-        prefs = context.preferences
-        return (prefs.active_section == 'SAVE_LOAD')
+    bl_parent_id = "USERPREF_PT_saveload_blend"
 
     def draw_header(self, context):
         prefs = context.preferences
@@ -1259,6 +1253,7 @@ class USERPREF_PT_saveload_blend(PreferencePanel):
     def draw_props(self, context, layout):
         prefs = context.preferences
         paths = prefs.filepaths
+        view = prefs.view
 
         flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
 
@@ -1267,6 +1262,7 @@ class USERPREF_PT_saveload_blend(PreferencePanel):
         flow.prop(paths, "use_load_ui")
         flow.prop(paths, "use_save_preview_images")
         flow.prop(paths, "use_tabs_as_spaces")
+        flow.prop(view, "use_quit_dialog")
 
         layout.separator()
 
@@ -1419,16 +1415,14 @@ class USERPREF_PT_navigation_orbit(PreferencePanel):
         flow.prop(inputs, "use_rotate_around_active")
         flow.prop(inputs, "use_auto_perspective")
         flow.prop(inputs, "use_mouse_depth_navigate")
+        if sys.platform == "darwin":
+            flow.prop(inputs, "use_trackpad_natural", text="Natural Trackpad Direction")
 
         flow.separator()
 
         flow.prop(view, "smooth_view")
         flow.prop(view, "rotation_angle")
 
-        if sys.platform == "darwin":
-            flow.separator()
-            flow.prop(inputs, "use_trackpad_natural", text="Natural Trackpad Direction")
-
 
 class USERPREF_PT_navigation_zoom(PreferencePanel):
     bl_label = "Zoom"
@@ -2044,8 +2038,9 @@ classes += (
     USERPREF_PT_viewport_selection,
 
     USERPREF_PT_edit_objects,
+    USERPREF_PT_edit_objects_new,
+    USERPREF_PT_edit_objects_duplicate_data,
     USERPREF_PT_edit_cursor,
-    USERPREF_PT_edit_duplicate_data,
     USERPREF_PT_edit_annotations,
     USERPREF_PT_edit_weight_paint,
     USERPREF_PT_edit_gpencil,
diff --git a/source/blender/editors/space_topbar/space_topbar.c b/source/blender/editors/space_topbar/space_topbar.c
index 567a733309c..fa5e6ec991e 100644
--- a/source/blender/editors/space_topbar/space_topbar.c
+++ b/source/blender/editors/space_topbar/space_topbar.c
@@ -239,7 +239,7 @@ static void recent_files_menu_register(void)
 
 	mt = MEM_callocN(sizeof(MenuType), "spacetype info menu recent files");
 	strcpy(mt->idname, "TOPBAR_MT_file_open_recent");
-	strcpy(mt->label, N_("Open Recent..."));
+	strcpy(mt->label, N_("Open Recent"));
 	strcpy(mt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
 	mt->draw = recent_files_menu_draw;
 	WM_menutype_add(mt);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 82bc384a6eb..391c2c87d50 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3838,7 +3838,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "use_quit_dialog", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_QUIT_PROMPT);
 	RNA_def_property_ui_text(prop, "Prompt Quit",
-	                         "Ask for confirmation when quitting through the window close button");
+	                         "Ask for confirmation when quitting with unsaved changes");
 
 	/* Toolbox click-hold delay */
 	prop = RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);



More information about the Bf-blender-cvs mailing list