[Bf-blender-cvs] [56a4e7cba0c] userpref_redesign: More tweaks to Preferences
William Reynish
noreply at git.blender.org
Sun Dec 23 14:19:53 CET 2018
Commit: 56a4e7cba0cb309cc737802656283c91d44b018b
Author: William Reynish
Date: Sun Dec 23 13:48:01 2018 +0100
Branches: userpref_redesign
https://developer.blender.org/rB56a4e7cba0cb309cc737802656283c91d44b018b
More tweaks to Preferences
* Brighter navigation bar background to avoid conflicts with subpanel backgrounds
* Group together device input settings into one panel (with sub-panels)
* Group together view manipulation settings into one panel (with sub-panels)
* Move Save Preferences button back to header until own region for it is ready
===================================================================
M release/datafiles/userdef/userdef_default_theme.c
M release/scripts/startup/bl_ui/space_userpref.py
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index 6fe61c60470..008aeffd9bd 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -821,7 +821,7 @@ const bTheme U_theme_default = {
.button_title = RGBA(0xffffffff),
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
- .navigation_bar = RGBA(0x373737ff),
+ .navigation_bar = RGBA(0x4b4b4bff),
.panelcolors = {
.header = RGBA(0x42424200),
.back = RGBA(0x333333b3),
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 87d0a14b51d..44b09701541 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -32,8 +32,16 @@ class USERPREF_HT_header(Header):
def draw(self, context):
layout = self.layout
+ layout.operator_context = 'EXEC_AREA'
+
layout.template_header()
+ row = layout.row()
+
+ row.separator_spacer()
+
+ row.operator("wm.save_userpref")
+
class USERPREF_PT_navigation(Panel):
bl_label = ""
@@ -53,11 +61,6 @@ class USERPREF_PT_navigation(Panel):
col.scale_y = 1.3
col.prop(prefs, "active_section", expand=True)
- col.separator_spacer()
- #Doesn't work vertically yet
-
- col.operator("wm.save_userpref")
-
class PreferencePanel(Panel):
bl_space_type = 'PREFERENCES'
@@ -100,6 +103,10 @@ class USERPREF_PT_interface_display(PreferencePanel):
layout.prop(view, "ui_scale", text="Scale")
layout.prop(view, "ui_line_width", text="Line Width")
+ layout.separator()
+
+ layout.row().prop(view, "header_align_default", expand=True)
+
class USERPREF_PT_interface_display_info(PreferencePanel):
bl_label = "Information"
@@ -134,42 +141,6 @@ class USERPREF_PT_interface_develop(PreferencePanel):
layout.prop(view, "show_developer_ui")
-class USERPREF_PT_interface_view_manipulation(PreferencePanel):
- bl_label = "View Manipulation"
- bl_options = {'DEFAULT_CLOSED'}
-
- @classmethod
- def poll(cls, context):
- prefs = context.preferences
- return (prefs.active_section == 'INTERFACE')
-
- def draw_props(self, context, layout):
- prefs = context.preferences
- view = prefs.view
-
- layout.prop(view, "smooth_view")
- layout.prop(view, "rotation_angle")
-
- layout.separator()
-
- layout.prop(view, "use_mouse_depth_cursor")
- layout.prop(view, "use_cursor_lock_adjust")
-
- layout.separator()
-
- layout.prop(view, "use_auto_perspective")
- layout.prop(view, "use_mouse_depth_navigate")
-
- layout.separator()
-
- layout.prop(view, "use_zoom_to_mouse")
- layout.prop(view, "use_rotate_around_active")
-
- layout.separator()
-
- layout.prop(view, "use_camera_lock_parent")
-
-
class USERPREF_PT_interface_viewports(PreferencePanel):
bl_label = "Viewports"
bl_options = {'DEFAULT_CLOSED'}
@@ -191,6 +162,11 @@ class USERPREF_PT_interface_viewports_3d(PreferencePanel):
prefs = context.preferences
view = prefs.view
+ layout.prop(view, "smooth_view")
+ layout.prop(view, "rotation_angle")
+
+ layout.separator()
+
layout.prop(view, "object_origin_size")
layout.separator()
@@ -1315,14 +1291,33 @@ class USERPREF_MT_ndof_settings(Menu):
layout.prop(input_prefs, "ndof_lock_horizon", icon='NDOF_DOM')
-class USERPREF_PT_input_mouse(PreferencePanel):
- bl_label = "Mouse"
+class USERPREF_PT_input_devices(PreferencePanel):
+ bl_label = "Devices"
@classmethod
def poll(cls, context):
prefs = context.preferences
return (prefs.active_section == 'INPUT')
+ def draw(self, context):
+ pass
+
+
+class USERPREF_PT_input_devices_keyboard(PreferencePanel):
+ bl_label = "Keyboard"
+ bl_parent_id = "USERPREF_PT_input_devices"
+
+ def draw_props(self, context, layout):
+ prefs = context.preferences
+ inputs = prefs.inputs
+
+ layout.prop(inputs, "use_emulate_numpad")
+
+
+class USERPREF_PT_input_devices_mouse(PreferencePanel):
+ bl_label = "Mouse"
+ bl_parent_id = "USERPREF_PT_input_devices"
+
def draw_props(self, context, layout):
prefs = context.preferences
inputs = prefs.inputs
@@ -1335,19 +1330,45 @@ class USERPREF_PT_input_mouse(PreferencePanel):
class USERPREF_PT_input_view(PreferencePanel):
- bl_label = "View"
+ bl_label = "View Manipulation"
+ bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
prefs = context.preferences
return (prefs.active_section == 'INPUT')
+ def draw(self, context):
+ pass
+
+
+class USERPREF_PT_input_view_orbit(PreferencePanel):
+ bl_label = "Orbit & Pan"
+ bl_parent_id = "USERPREF_PT_input_view"
+ bl_options = {'DEFAULT_CLOSED'}
+
def draw_props(self, context, layout):
import sys
prefs = context.preferences
inputs = prefs.inputs
layout.row().prop(inputs, "view_rotate_method", expand=True)
+ layout.prop(inputs, "use_rotate_around_active")
+ layout.prop(inputs, "use_auto_perspective")
+ layout.prop(inputs, "use_mouse_depth_navigate")
+
+ if sys.platform == "darwin":
+ layout.prop(inputs, "use_trackpad_natural", text="Natural Trackpad Direction")
+
+
+class USERPREF_PT_input_view_zoom(PreferencePanel):
+ bl_label = "Zoom"
+ bl_parent_id = "USERPREF_PT_input_view"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw_props(self, context, layout):
+ prefs = context.preferences
+ inputs = prefs.inputs
layout.prop(inputs, "view_zoom_method", text="Zoom Method")
if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}:
@@ -1356,9 +1377,21 @@ class USERPREF_PT_input_view(PreferencePanel):
layout.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
#sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
+ layout.prop(inputs, "use_zoom_to_mouse")
+
+
+class USERPREF_PT_input_view_cursor(PreferencePanel):
+ bl_label = "Cursor"
+ bl_parent_id = "USERPREF_PT_input_view"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw_props(self, context, layout):
+ prefs = context.preferences
+ inputs = prefs.inputs
+
+ layout.prop(inputs, "use_mouse_depth_cursor")
+ layout.prop(inputs, "use_cursor_lock_adjust")
- if sys.platform == "darwin":
- layout.prop(inputs, "use_trackpad_natural", text="Natural Trackpad Direction")
class USERPREF_PT_input_view_fly_walk(PreferencePanel):
bl_label = "Fly & Walk"
@@ -1370,6 +1403,7 @@ class USERPREF_PT_input_view_fly_walk(PreferencePanel):
inputs = prefs.inputs
layout.row().prop(inputs, "navigation_mode", expand=True)
+ layout.prop(inputs, "use_camera_lock_parent")
layout.label(text="Walk Navigation:")
@@ -1405,20 +1439,6 @@ class USERPREF_PT_input_view_fly_walk_gravity(PreferencePanel):
layout.prop(walk, "jump_height")
-class USERPREF_PT_input_devices(PreferencePanel):
- bl_label = "Devices"
-
- @classmethod
- def poll(cls, context):
- prefs = context.preferences
- return (prefs.active_section == 'INPUT')
-
- def draw_props(self, context, layout):
- prefs = context.preferences
- inputs = prefs.inputs
-
- layout.prop(inputs, "use_emulate_numpad")
-
class USERPREF_PT_input_devices_tablet(PreferencePanel):
bl_label = "Tablet"
bl_parent_id = "USERPREF_PT_input_devices"
@@ -1958,7 +1978,6 @@ classes += (
USERPREF_PT_interface_display,
USERPREF_PT_interface_display_info,
- USERPREF_PT_interface_view_manipulation,
USERPREF_PT_interface_viewports,
USERPREF_PT_interface_viewports_3d,
USERPREF_PT_interface_viewports_3d_weight_paint,
@@ -2006,15 +2025,18 @@ classes += (
USERPREF_MT_ndof_settings,
USERPREF_MT_keyconfigs,
- USERPREF_PT_input_mouse,
USERPREF_PT_input_devices,
+ USERPREF_PT_input_devices_keyboard,
+ USERPREF_PT_input_devices_mouse,
USERPREF_PT_input_devices_tablet,
USERPREF_PT_input_devices_ndof,
USERPREF_PT_input_view,
+ USERPREF_PT_input_view_orbit,
+ USERPREF_PT_input_view_zoom,
+ USERPREF_PT_input_view_cursor,
USERPREF_PT_input_view_fly_walk,
USERPREF_PT_input_view_fly_walk_gravity,
-
USERPREF_PT_keymap,
USERPREF_MT_addons_online_resources,
USERPREF_PT_addons,
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 69a6fd017cd..cadea5d6043 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3824,44 +3824,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Header Position", "Default header position for new space-types");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop = RNA_def_property(srna, "use_mouse_depth_navigate", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DEPTH_NAVIGATE);
- RNA_def_property_ui_text(prop, "Auto Depth",
- "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
-
- prop = RNA_def_property(srna, "use_mouse_depth_cursor", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DEPTH_CURSOR);
- RNA_def_property_ui_text(prop, "Cursor Surface Project",
- "Use the surface depth for cursor placement");
-
- prop = RNA_def_property(srna, "use_cursor_lock_adjust", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCK_CURSOR_ADJUST);
- RNA_def_property_ui_text(prop, "Cursor Lock Adjust",
- "Place the cursor without 'jumping' to the new location (when lock-to-cursor is used)");
-
- prop = RNA_def_property(srna, "use_camera_lock_parent", PRO
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list