diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-01 18:51:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-01 18:51:31 +0300 |
commit | 192e5d65a746798f6bddf897570ff8aba55c9c5a (patch) | |
tree | 3e2622f02fccafcf8edde8b9102c4d5d17998056 /release | |
parent | 36a9436d808837110a9c1bb2ec897a358ea62d56 (diff) |
Keymap: add generally useful popups to F-Keys 1..4
This allows key bindings: link/append and user-preferences
to be accessed via keys - without having to assign keys to each action.
- F1: Context sensitive help.
- F2: File Context Menu.
- F3: Search.
- F4: Window Context Menu.
Other keys F5..10, remain free,
ideally they can be kept for user actions.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 19516fda301..f54a5903801 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -579,11 +579,48 @@ class INFO_MT_help(Menu): layout.operator("wm.splash", icon='BLENDER') +class TOPBAR_MT_file_specials(Menu): + bl_label = "File Context Menu" + + def draw(self, context): + layout = self.layout + + layout.operator_context = 'INVOKE_AREA' + layout.operator("wm.link", text="Link", icon='LINK_BLEND') + layout.operator("wm.append", text="Append", icon='APPEND_BLEND') + + layout.separator() + + layout.menu("INFO_MT_file_import", icon='IMPORT') + layout.menu("INFO_MT_file_export", icon='EXPORT') + + +class TOPBAR_MT_window_specials(Menu): + bl_label = "Window Context Menu" + + def draw(self, context): + layout = self.layout + + layout.operator_context = 'EXEC_AREA' + + layout.operator("wm.window_new") + + layout.operator_context = 'INVOKE_AREA' + + layout.operator("screen.area_dupli") + + layout.separator() + + layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES') + + classes = ( TOPBAR_HT_upper_bar, TOPBAR_HT_lower_bar, TOPBAR_PT_pivot_point, TOPBAR_PT_snapping, + TOPBAR_MT_file_specials, + TOPBAR_MT_window_specials, INFO_MT_editor_menus, INFO_MT_file, INFO_MT_file_import, |