Page MenuHome

UI: Fix Transform Gizmo 2D and Transform Gizmo 3D low highlight contrast and inconsistency throughout all gizmos
Needs RevisionPublic

Authored by Juan (jc4d) on Mon, Jun 15, 11:22 AM.
Tags
None
Subscribers
Tokens
"Like" token, awarded by Kickflipkid687."Love" token, awarded by gilberto_rodrigues."Like" token, awarded by CobraA."Love" token, awarded by jfmatheu."Love" token, awarded by HooglyBoogly.

Details

Summary

This patch addresses two issues:

1- The lack of contrasts when the cursor hovers over the transform gizmo which is almost imperceptible.

2- Giving consistency among all the gizmos.
Before the patch when the cursor hovers over the the Interactive Navigation in the 3D Viewport or when it hovers over the Extrude operation or the Spin operation among others the gizmos always get highlighted with a white color, but the Transform gizmo (drag, rotate and scale) it doesn't follow this rule. Therefore, this patch solve the consistency between all of them.

Here is a video showing the before and after in action:

Thank you for your consideration.

Diff Detail

Repository
rB Blender

Event Timeline

Juan (jc4d) requested review of this revision.Mon, Jun 15, 11:22 AM
Juan (jc4d) created this revision.

Just to inform you,this won't work on light themes or grease pencil template since the background is white, better make it a theme option with a complete different color like orange , yellow etc.

Just to inform you,this won't work on light themes or grease pencil template since the background is white, better make it a theme option with a complete different color like orange , yellow etc.

Yes, I was just following the rest of the gizmos. The same thing happens if you hover over the extrude gizmo on a light background.
The good thing is that I agreed with the developers to move it to the preferences so is not hard coded. 🙂

Brecht Van Lommel (brecht) requested changes to this revision.Thu, Jun 25, 5:42 PM

I guess this patch is work in progress, and that further changes are planned to solve the hardcoded values.

This revision now requires changes to proceed.Thu, Jun 25, 5:42 PM
Juan (jc4d) updated this revision to Diff 26477.Thu, Jul 2, 7:59 PM

This differential update moves the gizmo highlight hardcoded to the preferences where the user can choose any color that adapts better to their personal theme.

Thank you for your consideration.

Hans Goudey (HooglyBoogly) requested changes to this revision.Thu, Jul 2, 8:33 PM

Thanks, a good improvement to have all of these consistent, and themeable! There just seems to be some issues of code placement. Sometimes that's the hardest problem..

Also, these will need versioning to add the new default highlight color to themes when they open the new version for the first time. (see versioning_userdef.c)

source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
65

#include "UI_resources.h" (Same everywhere else)

source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
688

I may be missing something, but it looks like these colors should be set in the "setup" function for each gizmo rather than the "draw" function.
What you have works, but it looks like it's getting the color from the theme on every single redraw, vs on setup, which is the way it looks like it is now.

I think this will be a problem wherever there is a gizmo_color_get call above your new line, or wherever "UI_resources.h" wasn't included already, unless all of the gizmo's colors were hardcoded before.

I might be wrong though, as it looks like gizmo_cage2d_setup is empty, so I'm not sure where its color is defined.

source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c
377

Oops, careful about adding blank space. Using clang format on save will automatically correct this stuff. (see https://wiki.blender.org/wiki/Tools/ClangFormat)

This revision now requires changes to proceed.Thu, Jul 2, 8:33 PM