[Bf-blender-cvs] [18ac5447add] soc-2019-outliner: Outliner: Fix icons drawing over rename box

Nathan Craddock noreply at git.blender.org
Wed Jul 31 06:11:54 CEST 2019


Commit: 18ac5447addc60815e73709839f98c1fd8cab08b
Author: Nathan Craddock
Date:   Tue Jul 30 22:10:56 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB18ac5447addc60815e73709839f98c1fd8cab08b

Outliner: Fix icons drawing over rename box

The iconrow icons were drawing as buttons, placing them above the
textbutton for item renaming. This reverts an older change which
broke the expected behavior.

===================================================================

M	source/blender/editors/space_outliner/outliner_draw.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 9ef1a6705f5..8f44be7f377 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2618,7 +2618,8 @@ static void tselem_draw_icon(uiBlock *block,
                              float y,
                              TreeStoreElem *tselem,
                              TreeElement *te,
-                             float alpha)
+                             float alpha,
+                             const bool is_clickable)
 {
   TreeElementIcon data = tree_element_get_icon(tselem, te);
 
@@ -2627,7 +2628,7 @@ static void tselem_draw_icon(uiBlock *block,
   }
 
   /* Icon is covered by restrict buttons */
-  if (x >= xmax) {
+  if (!is_clickable || x >= xmax) {
     /* Reduce alpha to match icon buttons */
     alpha *= 0.8f;
 
@@ -2765,7 +2766,7 @@ static void outliner_draw_iconrow_doit(uiBlock *block,
   if (tselem->flag & TSE_HIGHLIGHTED) {
     alpha_fac += 0.5;
   }
-  tselem_draw_icon(block, xmax, (float)*offsx, (float)ys, tselem, te, alpha_fac);
+  tselem_draw_icon(block, xmax, (float)*offsx, (float)ys, tselem, te, alpha_fac, false);
   te->xs = *offsx;
   te->ys = ys;
   te->xend = (short)*offsx + UI_UNIT_X;
@@ -3087,7 +3088,8 @@ static void outliner_draw_tree_element(bContext *C,
 
     /* datatype icon */
     if (!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, TSE_ID_BASE))) {
-      tselem_draw_icon(block, xmax, (float)startx + offsx, (float)*starty, tselem, te, alpha_fac);
+      tselem_draw_icon(
+          block, xmax, (float)startx + offsx, (float)*starty, tselem, te, alpha_fac, true);
       offsx += UI_UNIT_X + 4 * ufac;
     }
     else {



More information about the Bf-blender-cvs mailing list