Page MenuHome

UI: Use arrow icon on context paths
ClosedPublic

Authored by Pablo Vazquez (pablovazquez) on Nov 4 2021, 12:32 PM.

Details

Summary

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)

This patch

Diff Detail

Repository
rB Blender

Event Timeline

Pablo Vazquez (pablovazquez) requested review of this revision.Nov 4 2021, 12:32 PM
Pablo Vazquez (pablovazquez) created this revision.

Looks good in all bundled themes.

This revision is now accepted and ready to land.Nov 4 2021, 12:49 PM

This looks great, so +1 from me.

However, I think this removes all uses of SMALL_TRI_RIGHT_VEC. So this patch should also remove the definition of it in UI_icons.h (948) and the function vicon_small_tri_right_draw in interface_icons.c (262, 985).

There are still plenty of usages of the icon in add-ons. We could still decide to remove it, but it's not as simple as just removing it from code then.

There are still plenty of usages of the icon in add-ons. We could still decide to remove it, but it's not as simple as just removing it from code then.

Crap. I hate having (mostly) dead code around that we aren't going to fix. We could just define SMALL_TRI_RIGHT_VEC to ICON_RIGHTARROW somewhere. Not sure where though, not seeing similar cases anywhere. Oh well, was a thought.

  • Cleanup. Remove vicon_small_tri_right_draw.
  • Define ICON_SMALL_TRI_RIGHT_VEC as ICON_RIGHTARROW. (code by @Yevgeny Makarov (jenkm), thanks!)
Pablo Vazquez (pablovazquez) requested review of this revision.Nov 4 2021, 6:35 PM

Great improvement to consistency!

source/blender/editors/include/UI_resources.h
41

This is a small thing, and a bit nitpicky.

I don't think it's necessary to link the revision here, just adding something like /* Removed icon no longer used, but defined so that addons don't have to be updated. */ should do it.

Generally, comments should explain the current state of the code. The "history" can be left to the commit messages and git blame.

This revision is now accepted and ready to land.Nov 5 2021, 4:15 PM
Pablo Vazquez (pablovazquez) marked an inline comment as done.
  • Clearer comment about the removed icon redefined. (thanks Hans!)
This revision was automatically updated to reflect the committed changes.