diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-22 09:56:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-22 09:56:20 +0400 |
commit | a9e25ac43320a253f557d945a8e83245e414a2ea (patch) | |
tree | 646737f30921fba6dabb467435fda5295827b093 /source/blender/editors/include/UI_interface.h | |
parent | b00c3b801bf07a67b98b604ee834e2d93dff0f39 (diff) |
Toggle-Drag UI Feature
Dragging on toggle buttons can now be used to press multiple buttons at once, especially useful for layer and outliner buttons.
notes:
- automatically enabled for all toggle buttons
(may change this if it becomes a problem).
- only buttons of the same type are pressed
(helps avoid annoyances eg; dragging past layer buttons onto other 3d header buttons and pressing by accident).
- automatic axis locking - dragging will lock to X/Y depending on the initial drag direction,
makes swipe motions work better, especially with the outliner.
implementation details:
- may re-implement as a region handler (currently its a modal operator).
- checking buttons in-between cursor motion events could be more efficient (but currently works ok).
- button execution needs to be improved
(currently executing a button thats not under the mouse needed a workaround for passing uiHandleButtonData),
requires further changes to UI code, will do next.
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 648f8bfd8dd..78689c078c6 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -437,6 +437,7 @@ void uiButSetDragValue(uiBut *but); void uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale); int UI_but_active_drop_name(struct bContext *C); +struct uiBut *ui_but_find_mouse_over(struct ARegion *ar, int x, int y); void uiButSetFlag(uiBut *but, int flag); void uiButClearFlag(uiBut *but, int flag); @@ -447,6 +448,8 @@ void uiButClearDrawFlag(uiBut *but, int flag); /* special button case, only draw it when used actively, for outliner etc */ int uiButActiveOnly(const struct bContext *C, uiBlock *block, uiBut *but); +void uiButExecute(const struct bContext *C, uiBut *but); + /* Buttons * |