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:
authorCampbell Barton <ideasman42@gmail.com>2019-11-29 11:12:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-11-29 11:12:50 +0300
commit53f27cdc205327739e81e0980c5beb356c5dd793 (patch)
treecb958e3f88921b2581c9f57645ced6f92122815e
parentcaca7e5162c8837d9c0912ce3413488d7427d63a (diff)
UI: use popover for NDOF menu
Number sliders were being used in a menu which doesn't work very well.
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/blender_default.py2
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py2
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py22
3 files changed, 16 insertions, 10 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 3a7a142e310..06fac16292d 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -392,7 +392,7 @@ def km_window(params):
),
# NDOF settings
- op_menu("USERPREF_MT_ndof_settings", {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}),
+ op_panel("USERPREF_PT_ndof_settings", {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}),
("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS'},
{"properties": [("data_path", 'preferences.inputs.ndof_sensitivity'), ("value", 1.1)]}),
("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS'},
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index dc62b6bba68..6bf9a60a3d7 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -196,7 +196,7 @@ def km_window(params):
op_menu("SCREEN_MT_user_menu", {"type": 'TAB', "value": 'PRESS', "shift": True}),
# NDOF settings
- op_menu("USERPREF_MT_ndof_settings", {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}),
+ op_panel("USERPREF_PT_ndof_settings", {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}),
("wm.context_scale_float", {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS'},
{"properties": [("data_path", 'preferences.inputs.ndof_sensitivity'), ("value", 1.1)]}),
("wm.context_scale_float", {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS'},
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 7c6a7ecbcee..ab4d54f039e 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1409,20 +1409,24 @@ class USERPREF_PT_saveload_file_browser(PreferencePanel, Panel):
flow.prop(paths, "hide_system_bookmarks")
-class USERPREF_MT_ndof_settings(Menu):
- # accessed from the window key-bindings in C (only)
+class USERPREF_PT_ndof_settings(Panel):
bl_label = "3D Mouse Settings"
+ bl_space_type = 'TOPBAR' # dummy.
+ bl_region_type = 'HEADER'
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'
- layout.prop(input_prefs, "ndof_sensitivity")
- layout.prop(input_prefs, "ndof_orbit_sensitivity")
- layout.prop(input_prefs, "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")
if is_view3d:
layout.separator()
@@ -1430,8 +1434,8 @@ class USERPREF_MT_ndof_settings(Menu):
layout.separator()
layout.label(text="Orbit Style")
- layout.row().prop(input_prefs, "ndof_view_navigate_method", text="")
- layout.row().prop(input_prefs, "ndof_view_rotate_method", text="")
+ 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")
layout.prop(input_prefs, "ndof_rotx_invert_axis")
@@ -2255,7 +2259,6 @@ classes = (
USERPREF_PT_saveload_autorun,
USERPREF_PT_saveload_file_browser,
- USERPREF_MT_ndof_settings,
USERPREF_MT_keyconfigs,
USERPREF_PT_input_keyboard,
@@ -2278,6 +2281,9 @@ classes = (
USERPREF_PT_experimental_all,
+ # Popovers.
+ USERPREF_PT_ndof_settings,
+
# Add dynamically generated editor theme panels last,
# so they show up last in the theme section.
*ThemeGenericClassGenerator.generate_panel_classes_from_theme_areas(),