diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-02 16:45:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-02 16:47:51 +0300 |
commit | 9ece0ee5fe27ab83faacec7ec56824884088bbc2 (patch) | |
tree | c9f7799dbd7f73dee5eede7250d3ef60e2b38515 /source | |
parent | 8a3728800cac83a0a9e524790ff46b7eca82cfbd (diff) |
UI: add UI_SELECT_DRAW flag
Allow to draw as pressed w/o interfering with behavior.
Resolves issue where buttons raised on mouse-over.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 6 |
3 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 7ee18549342..537ecf8c65b 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -119,6 +119,7 @@ enum { UI_ACTIVE = (1 << 2), UI_HAS_ICON = (1 << 3), UI_HIDDEN = (1 << 4), + UI_SELECT_DRAW = (1 << 5), /* Display selected, doesn't impact interaction. */ /* warn: rest of uiBut->flag in UI_interface.h */ }; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index f0179cb852f..a6bbe725403 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -846,7 +846,7 @@ static uiBut *uiItemFullO_ptr_ex( UI_block_emboss_set(block, UI_EMBOSS); if (flag & UI_ITEM_O_DEPRESS) { - but->flag |= UI_SELECT; + but->flag |= UI_SELECT_DRAW; } if (layout->redalert) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 9c80b30100d..78090c67770 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -67,7 +67,7 @@ #define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect)) #define UI_BUT_FLAGS_PUBLIC \ - (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_HIDDEN) + (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_HIDDEN | UI_SELECT_DRAW) /* Don't overlap w/ UI_BUT_FLAGS_PUBLIC buts. */ enum { @@ -3909,6 +3909,10 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct state = but->flag & UI_BUT_FLAGS_PUBLIC; + if (state & UI_SELECT_DRAW) { + state |= UI_SELECT; + } + if ((but->editstr) || (UNLIKELY(but->flag & UI_BUT_DRAG_MULTI) && ui_but_drag_multi_edit_get(but))) { |