diff options
author | Matt Ebb <matt@mke3.net> | 2010-04-01 05:27:22 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-04-01 05:27:22 +0400 |
commit | 8f5438dcd4faf07583c359b456a9b2db85a0c4d9 (patch) | |
tree | 8a8f0ab1df73ffec6e402068b6b009e6eddc341f /source/blender | |
parent | ea0e0b3f15852a062a0b6578f729d768e848f7d1 (diff) |
Fix [#21775] Double-clicking icons in the file browser doesn't open files
Complicated issue, but this should be correct, and testing goes fine. fingers crossed.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 13 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_dragdrop.c | 6 |
2 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 2f14d23b518..54296b7cd6a 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2073,10 +2073,13 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmE /* first handle click on icondrag type button */ if(event->type==LEFTMOUSE && but->dragpoin) { if(ui_but_mouse_inside_icon(but, data->region, event)) { + + /* tell the button to wait and keep checking further events to + * see if it should start dragging */ button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG); data->dragstartx= event->x; data->dragstarty= event->y; - return WM_UI_HANDLER_BREAK; + return WM_UI_HANDLER_CONTINUE; } } @@ -2092,14 +2095,16 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmE return WM_UI_HANDLER_BREAK; } - /* pass on release as press for other keymaps XXX hack alert! */ + /* If the mouse has been pressed and released, getting to + * this point without triggering a drag, then clear the + * drag state for this button and continue to pass on the event */ if(event->type==LEFTMOUSE && event->val==KM_RELEASE) { button_activate_state(C, but, BUTTON_STATE_EXIT); - event->val= KM_CLICK; return WM_UI_HANDLER_CONTINUE; } - /* while wait drag, always block other events to get handled */ + /* while waiting for a drag to be triggered, always block + * other events from getting handled */ return WM_UI_HANDLER_BREAK; } diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index cf1e58c52fc..3d519a5609b 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -247,10 +247,10 @@ static void wm_drop_operator_draw(char *name, int x, int y) { int width= UI_GetStringWidth(name); - glColor4ub(0, 0, 0, 128); + glColor4ub(0, 0, 0, 50); - uiSetRoundBox(15); - uiRoundBox(x, y, x + width + 8, y + 15, 7); + uiSetRoundBox(15+16); + uiRoundBox(x, y, x + width + 8, y + 15, 4); glColor4ub(255, 255, 255, 255); UI_DrawString(x+4, y+4, name); |