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
This commit is contained in:
Pablo Vazquez 2021-11-05 16:22:48 +01:00 committed by Pablo Vazquez
parent 87e2154daf
commit 7c75529333
Notes: blender-bot 2023-02-14 03:46:57 +01:00
Referenced by issue #92771, Different hierarchy icon between properties editor and geonodes editor
5 changed files with 7 additions and 30 deletions

View File

@ -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

View File

@ -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);

View File

@ -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) {

View File

@ -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);
}

View File

@ -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);