[Bf-blender-cvs] [7c755293330] blender-v3.0-release: UI: Use arrow icon on context paths

Pablo Vazquez noreply at git.blender.org
Fri Nov 5 16:23:24 CET 2021


Commit: 7c755293330e8ebe8717b0a34e6031b4e3186f0d
Author: Pablo Vazquez
Date:   Fri Nov 5 16:22:48 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB7c755293330e8ebe8717b0a34e6031b4e3186f0d

UI: Use arrow icon on context paths

The current `ICON_SMALL_TRI_RIGHT_VEC` uses dark hard-coded colors ([`0.2`, `0.2`, `0.2`])
which makes it impossible to theme and hard to see in dark contexts.

Use `ICON_RIGHTARROW` to match the Outliner's breadcrumbs. This icon uses `TH_TEXT` so it's visible as long as the rest of the text is.

##### Master
(Properties editor background made red on purpose to be able to see the triangle icon)
{F11713038, size=full}

#### This patch
{F11713039, size=full}

Reviewed By: #user_interface, Severin, HooglyBoogly

Maniphest Tasks: T92771

Differential Revision: https://developer.blender.org/D13106

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

M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/editors/space_graph/graph_buttons.c
M	source/blender/editors/space_nla/nla_buttons.c

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

diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 61da496d344..c3a00bedaf8 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -39,6 +39,10 @@ typedef enum {
 
 #define BIFICONID_FIRST (ICON_NONE)
 
+/* Removed icon no longer used, defined so that add-ons don't have to be \
+ * updated. */
+#define ICON_SMALL_TRI_RIGHT_VEC (ICON_RIGHTARROW)
+
 /* use to denote intentionally unset theme color */
 #define TH_UNDEFINED -1
 
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index c20129b4184..5784af90834 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -259,31 +259,6 @@ static void viconutil_set_point(int pt[2], int x, int y)
   pt[1] = y;
 }
 
-static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float alpha)
-{
-  int pts[3][2];
-  const int cx = x + w / 2 - 4;
-  const int cy = y + w / 2;
-  const int d = w / 5, d2 = w / 7;
-
-  viconutil_set_point(pts[0], cx - d2, cy + d);
-  viconutil_set_point(pts[1], cx - d2, cy - d);
-  viconutil_set_point(pts[2], cx + d2, cy);
-
-  uint pos = GPU_vertformat_attr_add(
-      immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
-  immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-  immUniformColor4f(0.2f, 0.2f, 0.2f, alpha);
-
-  immBegin(GPU_PRIM_TRIS, 3);
-  immVertex2iv(pos, pts[0]);
-  immVertex2iv(pos, pts[1]);
-  immVertex2iv(pos, pts[2]);
-  immEnd();
-
-  immUnbindProgram();
-}
-
 static void vicon_keytype_draw_wrapper(
     int x, int y, int w, int h, float alpha, short key_type, short handle_type)
 {
@@ -982,8 +957,6 @@ static void init_internal_icons(void)
     }
   }
 
-  def_internal_vicon(ICON_SMALL_TRI_RIGHT_VEC, vicon_small_tri_right_draw);
-
   def_internal_vicon(ICON_KEYTYPE_KEYFRAME_VEC, vicon_keytype_keyframe_draw);
   def_internal_vicon(ICON_KEYTYPE_BREAKDOWN_VEC, vicon_keytype_breakdown_draw);
   def_internal_vicon(ICON_KEYTYPE_EXTREME_VEC, vicon_keytype_extreme_draw);
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 600b04f8563..f5107cb13fd 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -1225,7 +1225,7 @@ static void buttons_panel_context_draw(const bContext *C, Panel *panel)
 
     /* Add > triangle. */
     if (!first) {
-      uiItemL(row, "", ICON_SMALL_TRI_RIGHT_VEC);
+      uiItemL(row, "", ICON_RIGHTARROW);
     }
 
     if (ptr->data == NULL) {
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 275616f3bcb..26a056ce1fb 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -924,7 +924,7 @@ static void graph_draw_driven_property_panel(uiLayout *layout, ID *id, FCurve *f
   uiItemL(row, id->name + 2, icon);
 
   /* -> user friendly 'name' for F-Curve/driver target */
-  uiItemL(row, "", ICON_SMALL_TRI_RIGHT_VEC);
+  uiItemL(row, "", ICON_RIGHTARROW);
   uiItemL(row, name, ICON_RNA);
 }
 
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index 215e865d194..81932589663 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -312,7 +312,7 @@ static void nla_panel_animdata(const bContext *C, Panel *panel)
     uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT);
 
     uiItemL(row, id->name + 2, RNA_struct_ui_icon(id_ptr.type)); /* id-block (src) */
-    uiItemL(row, "", ICON_SMALL_TRI_RIGHT_VEC);                  /* expander */
+    uiItemL(row, "", ICON_RIGHTARROW);                           /* expander */
     uiItemL(row, IFACE_("Animation Data"), ICON_ANIM_DATA);      /* animdata */
 
     uiItemS(layout);



More information about the Bf-blender-cvs mailing list