diff options
author | Ton Roosendaal <ton@blender.org> | 2009-06-28 16:30:50 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-06-28 16:30:50 +0400 |
commit | 7d88981a24e16c9ddd5d882183d9421e7ce90d23 (patch) | |
tree | 98be83a758598e91e54364942579501fbb298734 /source/blender | |
parent | 8bf355533e9868f0c39f1e9330753d9da5810b83 (diff) |
2.5
Menu usage: enabled arrow-key based browsing, especially for open and
close sublevels. Only thing missing is to prevent sublevel to open
on creating menu (like SHIFT+A now), this is design conflict in code.
(It sends fake mouse move events causing it)
Implementation note; the 'auto open sublevel' feature gets triggered
with new state var, that checks if mouse was used or not.
Also: on render in editmode, editmode result gets stored, as usual for 2.4x.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 21 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 5 |
2 files changed, 21 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 5049fc0b130..92c888ac772 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -112,6 +112,9 @@ typedef struct uiHandleButtonData { /* tooltip */ ARegion *tooltip; wmTimer *tooltiptimer; + + /* auto open */ + int used_mouse; wmTimer *autoopentimer; /* text selection/editing */ @@ -3344,7 +3347,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s /* automatic open pulldown block timer */ if(ELEM3(but->type, BLOCK, PULLDOWN, ICONTEXTROW)) { - if(!data->autoopentimer) { + if(data->used_mouse && !data->autoopentimer) { int time; if(but->block->auto_open==2) time= 1; // test for toolbox @@ -3447,6 +3450,9 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer()) but->block->auto_open= 0; + if(type == BUTTON_ACTIVATE_OVER) { + data->used_mouse= 1; + } button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); if(type == BUTTON_ACTIVATE_OPEN) { @@ -3765,12 +3771,19 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * button_activate_exit(C, data, but, 1); } else if(menu->menuretval == UI_RETURN_OUT) { - if(ui_mouse_inside_button(data->region, but, event->x, event->y)) { + if(event->type==MOUSEMOVE && ui_mouse_inside_button(data->region, but, event->x, event->y)) { button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); } else { - data->cancel= 1; - button_activate_exit(C, data, but, 1); + but= ui_but_find_activated(data->region); + if(but) { + but->active->used_mouse= 0; + button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); + } + else { + data->cancel= 1; + button_activate_exit(C, data, but, 1); + } } } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 2aa6758850e..dcfdfbf8285 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -59,6 +59,7 @@ #include "ED_util.h" #include "ED_screen.h" #include "ED_mesh.h" +#include "ED_object.h" #include "ED_screen_types.h" #include "RE_pipeline.h" @@ -2509,7 +2510,9 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) /* flush multires changes (for sculpt) */ multires_force_update(CTX_data_active_object(C)); - // get editmode results + /* get editmode results */ + ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */ + // store spare // get view3d layer, local layer, make this nice api call to render // store spare |