diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-11 03:21:11 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-11 03:29:32 +0300 |
commit | 8953485f5612f6ddf1ce7be2320b349383caefdd (patch) | |
tree | dfef48cc87d8b0dd3b17ae2403cdf67c31c40242 /source/blender/editors | |
parent | 4960780d76bf5a157404cfa5b126cd8ab87caec8 (diff) |
Fix: Selection not possible from outliner gutter
Selection should be possible from the left gutter in object mode. When
in other modes the mode column displays icon buttons which should be
prioritized for selection only in those modes.
Introduced in rB2110af20f5e6.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 688f6d646ff..aebb574578f 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1312,6 +1312,17 @@ bool outliner_is_co_within_mode_column(SpaceOutliner *space_outliner, const floa return space_outliner->flag & SO_MODE_COLUMN && view_mval[0] < UI_UNIT_X; } +static bool outliner_is_co_within_active_mode_column(bContext *C, + SpaceOutliner *space_outliner, + const float view_mval[2]) +{ + ViewLayer *view_layer = CTX_data_view_layer(C); + Object *obact = OBACT(view_layer); + + return outliner_is_co_within_mode_column(space_outliner, view_mval) && obact && + obact->mode != OB_MODE_OBJECT; +} + /** * Action to run when clicking in the outliner, * @@ -1334,7 +1345,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C, if (outliner_is_co_within_restrict_columns(space_outliner, region, view_mval[0])) { return OPERATOR_CANCELLED; } - if (outliner_is_co_within_mode_column(space_outliner, view_mval)) { + if (outliner_is_co_within_active_mode_column(C, space_outliner, view_mval)) { return OPERATOR_CANCELLED; } @@ -1504,7 +1515,7 @@ static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } - if (outliner_is_co_within_mode_column(space_outliner, view_mval)) { + if (outliner_is_co_within_active_mode_column(C, space_outliner, view_mval)) { return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } |