Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-05-25 12:48:31 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-05-25 12:48:31 +0300
commite76ff4df4123b5517599930629dbcf0507b582e9 (patch)
tree3cf9a67f3a3a05c678f39a04533da81f56e66c02 /release/scripts/startup/bl_ui/space_userpref.py
parent15dd6cb66887eb83fcc3ecf44c3b42a53161e390 (diff)
parent528f0b95c4462b2e429600a566ca0434c90310f6 (diff)
Merge branch 'master' into tmp-widget-optitmp-widget-opti
# Conflicts: # source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
Diffstat (limited to 'release/scripts/startup/bl_ui/space_userpref.py')
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py101
1 files changed, 43 insertions, 58 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 153533dbde6..3baedd889e0 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1080,7 +1080,7 @@ class PreferenceThemeSpacePanel:
PreferenceThemeSpacePanel._theme_generic(layout, data, self.theme_area)
-class ThemeGenericClassGenerator():
+class ThemeGenericClassGenerator:
@staticmethod
def generate_panel_classes_for_wcols():
@@ -1436,16 +1436,7 @@ class USERPREF_PT_input_ndof(InputPanel, CenterAlignMixIn, Panel):
prefs = context.preferences
inputs = prefs.inputs
- flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
-
- flow.prop(inputs, "ndof_sensitivity", text="Pan Sensitivity")
- flow.prop(inputs, "ndof_orbit_sensitivity", text="Orbit Sensitivity")
- flow.prop(inputs, "ndof_deadzone", text="Deadzone")
-
- layout.separator()
-
- flow.row().prop(inputs, "ndof_view_navigate_method", expand=True)
- flow.row().prop(inputs, "ndof_view_rotate_method", expand=True)
+ USERPREF_PT_ndof_settings.draw_settings(layout, inputs)
# -----------------------------------------------------------------------------
@@ -1584,71 +1575,65 @@ class USERPREF_PT_ndof_settings(Panel):
bl_label = "3D Mouse Settings"
bl_space_type = 'TOPBAR' # dummy.
bl_region_type = 'HEADER'
+ bl_ui_units_x = 12
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
- layout.use_property_decorate = False # No animation.
-
- input_prefs = context.preferences.inputs
-
- is_view3d = context.space_data.type == 'VIEW_3D'
+ @staticmethod
+ def draw_settings(layout, props, show_3dview_settings=True):
+ col = layout.column()
+ col.prop(props, "ndof_sensitivity", text="Pan Sensitivity")
+ col.prop(props, "ndof_orbit_sensitivity")
+ col.prop(props, "ndof_deadzone")
- col = layout.column(align=True)
- col.prop(input_prefs, "ndof_sensitivity")
- col.prop(input_prefs, "ndof_orbit_sensitivity")
- col.prop(input_prefs, "ndof_deadzone")
+ layout.separator()
- if is_view3d:
- layout.separator()
- layout.prop(input_prefs, "ndof_show_guide")
+ if show_3dview_settings:
+ col = layout.column()
+ col.row().prop(props, "ndof_view_navigate_method", expand=True, text="Navigation")
+ col.row().prop(props, "ndof_view_rotate_method", expand=True, text="Rotation")
layout.separator()
- layout.label(text="Orbit Style")
- layout.row().prop(input_prefs, "ndof_view_navigate_method", text="Navigate")
- layout.row().prop(input_prefs, "ndof_view_rotate_method", text="Orbit")
- layout.separator()
- layout.label(text="Orbit Options")
- split = layout.split(factor=0.6)
- row = split.row()
- row.alignment = 'RIGHT'
- row.label(text="Invert Axis")
- row = split.row(align=True)
- for text, attr in (
- ("X", "ndof_rotx_invert_axis"),
- ("Y", "ndof_roty_invert_axis"),
- ("Z", "ndof_rotz_invert_axis"),
- ):
- row.prop(input_prefs, attr, text=text, toggle=True)
+ col = layout.column()
+ if show_3dview_settings:
+ col.prop(props, "ndof_show_guide")
+ col.prop(props, "ndof_zoom_invert")
+ row = col.row(heading="Pan")
+ row.prop(props, "ndof_pan_yz_swap_axis", text="Swap Y and Z Axes")
- # view2d use pan/zoom
layout.separator()
- layout.label(text="Pan Options")
- split = layout.split(factor=0.6)
- row = split.row()
- row.alignment = 'RIGHT'
- row.label(text="Invert Axis")
- row = split.row(align=True)
+ row = layout.row(heading=("Invert Axis Pan" if show_3dview_settings else "Invert Pan Axis"))
for text, attr in (
("X", "ndof_panx_invert_axis"),
("Y", "ndof_pany_invert_axis"),
("Z", "ndof_panz_invert_axis"),
):
- row.prop(input_prefs, attr, text=text, toggle=True)
+ row.prop(props, attr, text=text, toggle=True)
- layout.prop(input_prefs, "ndof_pan_yz_swap_axis")
-
- layout.label(text="Zoom Options")
- layout.prop(input_prefs, "ndof_zoom_invert")
+ if show_3dview_settings:
+ row = layout.row(heading="Orbit")
+ for text, attr in (
+ ("X", "ndof_rotx_invert_axis"),
+ ("Y", "ndof_roty_invert_axis"),
+ ("Z", "ndof_rotz_invert_axis"),
+ ):
+ row.prop(props, attr, text=text, toggle=True)
- if is_view3d:
layout.separator()
- layout.label(text="Fly/Walk Options")
- layout.prop(input_prefs, "ndof_fly_helicopter")
- layout.prop(input_prefs, "ndof_lock_horizon")
+ col = layout.column(heading="Fly/Walk")
+ col.prop(props, "ndof_lock_horizon")
+ col.prop(props, "ndof_fly_helicopter")
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ input_prefs = context.preferences.inputs
+
+ is_view3d = context.space_data.type == 'VIEW_3D'
+ self.draw_settings(layout, input_prefs, is_view3d)
# -----------------------------------------------------------------------------
# Key-Map Editor Panels