diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-03 05:24:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-03 05:24:53 +0300 |
commit | 9bda43ed27479534ca15a2189b957f4068d1ba8a (patch) | |
tree | 3125e4e4c9f153d511f8037f2586574144b3a6dd /source/blender | |
parent | e2f5d31453c8893ad072951e7bceeb3ad549ee17 (diff) |
- WM_OT_context_cycle_int wasnt working (also wasnt used anywhere)
- remove console zoom operator, use WM_OT_context_cycle_int instead.
- use WM_OT_context_cycle_int for text editor zoom also (Ctrl +/- and Ctrl+MouseWheel)
Diffstat (limited to 'source/blender')
4 files changed, 32 insertions, 39 deletions
diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h index 92ab3eb3d0c..a90e434246f 100644 --- a/source/blender/editors/space_console/console_intern.h +++ b/source/blender/editors/space_console/console_intern.h @@ -63,7 +63,6 @@ void CONSOLE_OT_clear(struct wmOperatorType *ot); void CONSOLE_OT_history_cycle(struct wmOperatorType *ot); void CONSOLE_OT_copy(struct wmOperatorType *ot); void CONSOLE_OT_paste(struct wmOperatorType *ot); -void CONSOLE_OT_zoom(struct wmOperatorType *ot); void CONSOLE_OT_select_set(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index f3f3853f63b..bf4edb5941c 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -750,38 +750,6 @@ void CONSOLE_OT_paste(wmOperatorType *ot) /* properties */ } -static int zoom_exec(bContext *C, wmOperator *op) -{ - SpaceConsole *sc= CTX_wm_space_console(C); - - int delta= RNA_int_get(op->ptr, "delta"); - - sc->lheight += delta; - CLAMP(sc->lheight, 8, 32); - - ED_area_tag_redraw(CTX_wm_area(C)); - - return OPERATOR_FINISHED; -} - - -void CONSOLE_OT_zoom(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Console Zoom"; - /*optionals - - "Zoom view font." */ - ot->description= "Zoom screen area."; - ot->idname= "CONSOLE_OT_zoom"; - - /* api callbacks */ - ot->exec= zoom_exec; - ot->poll= console_poll; - - /* properties */ - RNA_def_int(ot->srna, "delta", 0, 0, INT_MAX, "Delta", "Scale the view font.", 0, 1000); -} - typedef struct SetConsoleCursor { int sel_old[2]; int sel_init; diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index f4058f4eefb..e9e87a865ef 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -207,7 +207,6 @@ void console_operatortypes(void) WM_operatortype_append(CONSOLE_OT_history_cycle); WM_operatortype_append(CONSOLE_OT_copy); WM_operatortype_append(CONSOLE_OT_paste); - WM_operatortype_append(CONSOLE_OT_zoom); WM_operatortype_append(CONSOLE_OT_select_set); /* console_report.c */ @@ -223,6 +222,7 @@ void console_operatortypes(void) void console_keymap(struct wmKeyConfig *keyconf) { wmKeyMap *keymap= WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0); + wmKeyMapItem *kmi; #ifdef __APPLE__ RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); @@ -235,13 +235,22 @@ void console_keymap(struct wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", HOMEKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_BEGIN); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", ENDKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_END); - RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_zoom", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "delta", 1); - RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_zoom", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "delta", -1); - - RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_zoom", PADPLUSKEY, KM_PRESS, KM_CTRL, 0)->ptr, "delta", 1); - RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_zoom", PADMINUS, KM_PRESS, KM_CTRL, 0)->ptr, "delta", -1); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 1); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 1); + RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_CHAR); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 2f0e631e927..292249bb0e8 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -209,6 +209,7 @@ static void text_operatortypes(void) static void text_keymap(struct wmKeyConfig *keyconf) { wmKeyMap *keymap; + wmKeyMapItem *kmi; keymap= WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0); @@ -229,6 +230,22 @@ static void text_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "TEXT_OT_select_line", AKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0); #endif + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 0); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 1); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 0); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "path", "space_data.font_size"); + RNA_boolean_set(kmi->ptr, "reverse", 1); + WM_keymap_add_item(keymap, "TEXT_OT_new", NKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_open", OKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_reload", RKEY, KM_PRESS, KM_ALT, 0); |