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>2020-11-26 23:30:31 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-11-27 06:37:21 +0300
commitab4654cdfe8f393d70426456a29c3ae0bfc4ac03 (patch)
tree4ffccc5a2e770c70a7c8ce6b607f61ccb218319d /source/blender/editors/space_outliner/outliner_select.c
parent1709bc51643d57278063562389519705f331a2c0 (diff)
Cleanup: Move logic to `outliner_find_item_at_x_in_row`
Move the logic for determining if the item at a given x position is an icon into the function. This is used for determining selection over an icon, and will be used in a later commit for checking for hover over an icon. No functional changes.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_select.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 0cd5e62e6f6..fa8bce9df6a 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1563,11 +1563,9 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
else {
/* The row may also contain children, if one is hovered we want this instead of current te. */
bool merged_elements = false;
+ bool is_over_icon = false;
TreeElement *activate_te = outliner_find_item_at_x_in_row(
- space_outliner, te, view_mval[0], &merged_elements);
-
- /* If `outliner_find_item_at_x_in_row` returned a different element a row icon was selected. */
- const bool is_row_icon = te != activate_te;
+ space_outliner, te, view_mval[0], &merged_elements, &is_over_icon);
/* If the selected icon was an aggregate of multiple elements, run the search popup */
if (merged_elements) {
@@ -1594,7 +1592,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
outliner_item_select(C, space_outliner, activate_te, select_flag);
/* Only switch properties editor tabs when icons are selected. */
- if (is_row_icon || outliner_item_is_co_over_icon(activate_te, view_mval[0])) {
+ if (is_over_icon) {
outliner_set_properties_tab(C, activate_te, activate_tselem);
}
}