diff options
author | Pablo Vazquez <pablo@blender.org> | 2021-09-28 16:13:23 +0300 |
---|---|---|
committer | Pablo Vazquez <pablo@blender.org> | 2021-09-29 16:57:57 +0300 |
commit | 901fa96b7f595fb1d77075aaa68b2e14f57a8e31 (patch) | |
tree | d13ecc7609dcc359e024d5ac6a4a8cd8cc07320f /release/scripts | |
parent | 1f4545dc9c91d5f27102ff6c05943de1903d7b42 (diff) |
Keymap: New preference to open folders on single click in file browser
Introduce a new keymap preference to navigate into folders by clicking on them once instead of twice.
Makes browsing folders faster albeit non-standard, so keeping this off by default for now.
Does not affect Industry Compatible or other keymaps.
It is still the possible to right-click to open context menu, hold Ctrl or Shift to select multiple items:
{F10651030, size=full}
----
Keymap preference:
{F10652759, size=full}
Part of T91537
Reviewed By: fsiddi, campbellbarton
Differential Revision: https://developer.blender.org/D12667
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/presets/keyconfig/Blender.py | 14 | ||||
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 14 |
2 files changed, 25 insertions, 3 deletions
diff --git a/release/scripts/presets/keyconfig/Blender.py b/release/scripts/presets/keyconfig/Blender.py index b165eaddcf5..1852e150589 100644 --- a/release/scripts/presets/keyconfig/Blender.py +++ b/release/scripts/presets/keyconfig/Blender.py @@ -217,6 +217,15 @@ class Prefs(bpy.types.KeyConfigPreferences): update=update_fn, ) + use_file_single_click: BoolProperty( + name="Open Folders on Single Click", + description=( + "Navigate into folders by clicking on them once instead of twice" + ), + default=False, + update=update_fn, + ) + def draw(self, layout): from bpy import context @@ -273,6 +282,10 @@ class Prefs(bpy.types.KeyConfigPreferences): sub.prop(self, "use_pie_click_drag") sub.prop(self, "use_v3d_shade_ex_pie") + # File Browser settings. + col = layout.column() + col.label(text="File Browser") + col.row().prop(self, "use_file_single_click") blender_default = bpy.utils.execfile(os.path.join(DIRNAME, "keymap_data", "blender_default.py")) @@ -312,6 +325,7 @@ def load(): ), use_alt_click_leader=kc_prefs.use_alt_click_leader, use_pie_click_drag=kc_prefs.use_pie_click_drag, + use_file_single_click=kc_prefs.use_file_single_click, ), ) diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 41b5d6f7998..35eb6490265 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -66,6 +66,7 @@ class Params: # Alt-MMB axis switching 'RELATIVE' or 'ABSOLUTE' axis switching. "v3d_alt_mmb_drag_action", + "use_file_single_click", # Convenience variables: # (derived from other settings). # @@ -106,6 +107,7 @@ class Params: use_alt_tool_or_cursor=False, use_alt_click_leader=False, use_pie_click_drag=False, + use_file_single_click=False, v3d_tilde_action='VIEW', v3d_alt_mmb_drag_action='RELATIVE', ): @@ -190,6 +192,8 @@ class Params: self.use_alt_click_leader = use_alt_click_leader self.use_pie_click_drag = use_pie_click_drag + self.use_file_single_click = use_file_single_click + # Convenience variables: self.use_fallback_tool_rmb = self.use_fallback_tool if self.select_mouse == 'RIGHT' else False self.select_mouse_value_fallback = 'CLICK' if self.use_fallback_tool_rmb else self.select_mouse_value @@ -2151,16 +2155,20 @@ def km_file_browser_main(params): {"items": items}, ) + if not params.use_file_single_click: + items.extend([ + ("file.select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, + {"properties": [("open", True), ("deselect_all", not params.legacy)]}), + ]) + items.extend([ ("file.mouse_execute", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), # Both .execute and .select are needed here. The former only works if # there's a file operator (i.e. not in regular editor mode) but is # needed to load files. The latter makes selection work if there's no # operator (i.e. in regular editor mode). - ("file.select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, - {"properties": [("open", True), ("deselect_all", not params.legacy)]}), ("file.select", {"type": 'LEFTMOUSE', "value": 'PRESS'}, - {"properties": [("open", False), ("deselect_all", not params.legacy)]}), + {"properties": [("open", params.use_file_single_click), ("deselect_all", not params.legacy)]}), ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True}, {"properties": [("extend", True), ("open", False)]}), ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, |