diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-10-30 01:28:08 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-10-30 01:29:26 +0300 |
commit | 70582cf8d26e4ba5d6ccb0d1044d16e239fa655e (patch) | |
tree | 6a0c2ab6548286a6cca99ab0f64e22c859852bfe /source/blender/editors/space_buttons/space_buttons.c | |
parent | a0d40c6a8c42c774d9286b5de0d80167c1d55fde (diff) |
UI: Support using Ctrl+Scrollwheel to cycle properties editor tabs
Small side effect is that area operators (toggle fullscreen/maximized, duplicate
area) are now displayed in RMB-menu. Makes sense anyway.
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 413d0ab376a..0e52b8ad320 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -351,8 +351,14 @@ static void buttons_operatortypes(void) static void buttons_keymap(struct wmKeyConfig *keyconf) { wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Property Editor", SPACE_BUTS, 0); + wmKeyMapItem *kmi; WM_keymap_add_item(keymap, "BUTTONS_OT_context_menu", RIGHTMOUSE, KM_PRESS, 0, 0); + + kmi = WM_keymap_add_item(keymap, "SCREEN_OT_space_context_cycle", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "direction", SPACE_CONTEXT_CYCLE_PREV); + kmi = WM_keymap_add_item(keymap, "SCREEN_OT_space_context_cycle", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "direction", SPACE_CONTEXT_CYCLE_NEXT); } /* add handlers, stuff you only do once or on area/region changes */ @@ -410,7 +416,11 @@ static void buttons_header_region_message_subscribe( static void buttons_navigation_bar_region_init(wmWindowManager *wm, ARegion *ar) { + wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Property Editor", SPACE_BUTS, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); + ar->flag |= RGN_FLAG_PREFSIZE_OR_HIDDEN; + ED_region_panels_init(wm, ar); ar->v2d.keepzoom |= V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y; } |