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:
authorJulian Eisel <eiseljulian@gmail.com>2018-10-30 01:28:08 +0300
committerJulian Eisel <eiseljulian@gmail.com>2018-10-30 01:29:26 +0300
commit70582cf8d26e4ba5d6ccb0d1044d16e239fa655e (patch)
tree6a0c2ab6548286a6cca99ab0f64e22c859852bfe /source/blender/editors
parenta0d40c6a8c42c774d9286b5de0d80167c1d55fde (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')
-rw-r--r--source/blender/editors/include/ED_screen.h6
-rw-r--r--source/blender/editors/screen/screen_ops.c6
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c10
3 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index 2f2f4847a6f..faa9233bff1 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -364,4 +364,10 @@ void ED_area_type_hud_ensure(struct bContext *C, struct ScrArea *sa);
#define ED_KEYMAP_GPENCIL 32
#define ED_KEYMAP_HEADER 64
+/* SCREEN_OT_space_context_cycle direction */
+enum {
+ SPACE_CONTEXT_CYCLE_PREV,
+ SPACE_CONTEXT_CYCLE_NEXT,
+};
+
#endif /* __ED_SCREEN_H__ */
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 3d32f10582d..7a447bb41d4 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4614,12 +4614,6 @@ static void SCREEN_OT_region_blend(wmOperatorType *ot)
/** \name Space Context Cycle Operator
* \{ */
-/* SCREEN_OT_space_context_cycle direction */
-enum {
- SPACE_CONTEXT_CYCLE_PREV,
- SPACE_CONTEXT_CYCLE_NEXT,
-};
-
static const EnumPropertyItem space_context_cycle_direction[] = {
{SPACE_CONTEXT_CYCLE_PREV, "PREV", 0, "Previous", ""},
{SPACE_CONTEXT_CYCLE_NEXT, "NEXT", 0, "Next", ""},
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;
}