diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-03-08 15:57:15 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-03-08 17:21:34 +0300 |
commit | 5a67407d5aa8800faf78f40811b703d07e8f7300 (patch) | |
tree | 3b10f385b1d26d6399d6fdaa75f5792a18384369 /release | |
parent | e20b31504a2381011e60c5eadffb67f18918bc71 (diff) |
File Browser: scroll selected files into view
Add operator `FILE_OT_view_selected` to the file browser (and thus also
to the asset browser) that scrolls selected files into view.
This includes the active file, even though it is not selected. In
certain cases the active file can loose its selected state (clicking
next to it, or refreshing the asset browser), but then it's still shown
in the right-hand sidebar. Because of this, I found it important to take
it into account when scrolling.
This also includes a change to the keymaps:
- Blender default: {key NUMPAD_PERIOD} is removed from the "reload"
operator, and assigned to the new "view selected files" operator. The
reload operator was already doubly bound, and now {key R} is the only
remaining hotkey for it.
- Industry compatible: {key F} is assigned to the new "view selected
files" operator. This is consistent with the other "view selected"
operators in other editors.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D10583
Diffstat (limited to 'release')
3 files changed, 3 insertions, 1 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 949cfcae2b1..577448554b7 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -2011,7 +2011,6 @@ def km_file_browser_main(params): # operator (i.e. in regular editor mode). ("file.select", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, {"properties": [("open", True), ("deselect_all", not params.legacy)]}), - ("file.refresh", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), ("file.select", {"type": 'LEFTMOUSE', "value": 'PRESS'}, {"properties": [("open", False), ("deselect_all", not params.legacy)]}), ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True}, @@ -2053,6 +2052,7 @@ def km_file_browser_main(params): {"properties": [("mode", 'SUB')]}), ("file.highlight", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None), ("file.sort_column_ui_context", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ("file.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), ]) return keymap 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 234781b7bc8..214b8f98ff6 100644 --- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py +++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py @@ -1309,6 +1309,7 @@ def km_file_browser_main(params): {"properties": [("mode", 'ADD')]}), ("file.highlight", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None), ("file.sort_column_ui_context", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ("file.view_selected", {"type": 'F', "value": 'PRESS'}, None), ]) return keymap diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index ef4f47c9399..b236b2ee7cf 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -494,6 +494,7 @@ class FILEBROWSER_MT_view(Menu): layout.prop(st, "show_region_toolbar", text="Source List") layout.prop(st, "show_region_ui", text="File Path") + layout.operator("file.view_selected") layout.separator() |