Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Craddock <nzcraddock@gmail.com>2019-08-09 00:37:32 +0300
committerNathan Craddock <nzcraddock@gmail.com>2019-08-16 21:30:54 +0300
commit01006aa45d1afc9f45d2f6a42f6981f5c92af051 (patch)
treee536491fb252a2728363e65d6aea55ebc5ec8f67 /source/blender/editors/space_outliner/outliner_edit.c
parentbf95ab6bb24103e67856e76f9c3e058bf3e9e6de (diff)
Outliner: Allow select on row icons
Allow selection of subtree elements on a collapsed element's row. Because subtree elements are aggregated by type, a select on an icon that represents multiple subtree elements will invoke a popup menu to select the specific subtree element. Also draws highlights on cursor hover over a row icon. Any child elements that are linked to multiple collections will only be listed in the popup one time, and selection from the popup will select the first instance in the subtree.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_edit.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 57fea544c77..842502ec82f 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -101,9 +101,15 @@ static int outliner_highlight_update(bContext *C, wmOperator *UNUSED(op), const
ARegion *ar = CTX_wm_region(C);
SpaceOutliner *soops = CTX_wm_space_outliner(C);
- const float my = UI_view2d_region_to_view_y(&ar->v2d, event->mval[1]);
- TreeElement *hovered_te = outliner_find_item_at_y(soops, &soops->tree, my);
+ float view_mval[2];
+ UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &view_mval[0], &view_mval[1]);
+
+ TreeElement *hovered_te = outliner_find_item_at_y(soops, &soops->tree, view_mval[1]);
+
+ if (hovered_te) {
+ hovered_te = outliner_find_item_at_x_in_row(soops, hovered_te, view_mval[0], NULL);
+ }
bool changed = false;
if (!hovered_te || !(hovered_te->store_elem->flag & TSE_HIGHLIGHTED)) {