[Bf-blender-cvs] [eed6d1dcf1e] soc-2019-outliner: Outliner: Draw highlights for icons in row
Nathan Craddock
noreply at git.blender.org
Fri Jul 19 06:16:38 CEST 2019
Commit: eed6d1dcf1e9840d480f0c8e8e7e89df07fa7905
Author: Nathan Craddock
Date: Thu Jul 18 11:53:11 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBeed6d1dcf1e9840d480f0c8e8e7e89df07fa7905
Outliner: Draw highlights for icons in row
This draws icon highlights when the row icons are hovered.
===================================================================
M source/blender/editors/space_outliner/outliner_draw.c
M source/blender/editors/space_outliner/outliner_edit.c
===================================================================
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index bcd8af26882..9b5b86fa58f 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2731,7 +2731,10 @@ static void outliner_draw_iconrow_doit(uiBlock *block,
GPU_blend(true); /* Roundbox disables. */
}
- tselem_draw_icon(block, xmax, (float)*offsx, (float)ys, tselem, te, alpha_fac, false);
+ if (tselem->flag & TSE_HIGHLIGHTED) {
+ alpha_fac += 0.5;
+ }
+ tselem_draw_icon(block, xmax, (float)*offsx, (float)ys, tselem, te, alpha_fac, true);
te->xs = *offsx;
te->ys = ys;
te->xend = (short)*offsx + UI_UNIT_X;
@@ -2883,8 +2886,8 @@ static void outliner_set_coord_tree_element(TreeElement *te, int startx, int sta
TreeElement *ten;
/* closed items may be displayed in row of parent, don't change their coordinate! */
- if ((te->flag & TE_ICONROW) == 0) {
- /* store coord and continue, we need coordinates for elements outside view too */
+ if (!ELEM(te->flag, TE_ICONROW, TE_ICONROW_MULTI)) {
+ /* store coord and continue, we need coordinatesfor elements outside view too */
te->xs = startx;
te->ys = starty;
}
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index b26db7345ee..0a32741858c 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]);
+ }
bool changed = false;
if (!hovered_te || !(hovered_te->store_elem->flag & TSE_HIGHLIGHTED)) {
More information about the Bf-blender-cvs
mailing list