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_select.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_select.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 38dfe439b9c..ddb943d6c66 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1246,12 +1246,6 @@ static void outliner_item_toggle_closed(TreeElement *te, const bool toggle_child
}
}
-static bool outliner_item_is_co_within_close_toggle(TreeElement *te, float view_co_x)
-{
- return ((te->flag & TE_ICONROW) == 0) && (view_co_x > te->xs) &&
- (view_co_x < te->xs + UI_UNIT_X);
-}
-
static bool outliner_is_co_within_restrict_columns(const SpaceOutliner *soops,
const ARegion *ar,
float view_co_x)
@@ -1313,8 +1307,18 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
else {
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
- /* the row may also contain children, if one is hovered we want this instead of current te */
- TreeElement *activate_te = outliner_find_item_at_x_in_row(soops, te, view_mval[0]);
+
+ /* The row may also contain children, if one is hovered we want this instead of current te */
+ bool merged_elements = false;
+ TreeElement *activate_te = outliner_find_item_at_x_in_row(
+ soops, te, view_mval[0], &merged_elements);
+
+ /* If the selected icon was an aggregate of multiple elements, run the search popup */
+ if (merged_elements) {
+ merged_element_search_menu_invoke(C, te, activate_te);
+ return OPERATOR_CANCELLED;
+ }
+
TreeStoreElem *activate_tselem = TREESTORE(activate_te);
outliner_item_select(soops, activate_te, extend, extend);