Page MenuHome

UI: Fix drawing of the sidebar tabs
ClosedPublic

Authored by Yevgeny Makarov (jenkm) on Sep 29 2020, 9:47 AM.
Tokens
"Love" token, awarded by gilberto_rodrigues."Like" token, awarded by Imaginer."Like" token, awarded by Blendify."Love" token, awarded by hlorus.

Diff Detail

Repository
rB Blender

Event Timeline

Yevgeny Makarov (jenkm) requested review of this revision.Sep 29 2020, 9:47 AM
Yevgeny Makarov (jenkm) created this revision.

This is awesome, really great to clean up this stuff. All this one-off tab drawing code had no business existing in this file anyway.

For anyone who isn't zooming in very very close, I don't think I would exactly call this a "fix", it's really a cleanup and a slight visual change.

The end result looks good in my opinion. The rectangles for inactive tabs are darker, but I think it's a good balance. I would suggest the following tweaks to accompany this though:

  1. Tab outline to 2E2E2E -- Makes the edge of the inactive tabs pop just a little bit, so they still look clickable
  2. Tab active to 424242 -- Just a subtle change to match the active tab in the properties editor and the panel headers
  3. Decrease the factor for padding between tabs from 6 to 4. -- They look a bit too spaced out after this change IMO, and this will also let people fit more tabs
PatchWith my tweaks
source/blender/editors/interface/interface_panel.c
1229

This should be 6.0f to make it clear that it's a float

1231

Same here, (although I suggest 4.0f in my comment :)

1384

I know it's obvious now, but sometime in the future it would probably help someone to have a comment here: /* Draw filled rectangle and outline for tab. */

Yevgeny Makarov (jenkm) marked 3 inline comments as done.

Code wise this looks good to me. And low risk too because it's just using existing code.

I'd like @Pablo Vazquez (pablovazquez) to offer an opinion on the visuals here though.

This revision is now accepted and ready to land.Oct 3 2020, 4:38 AM

Pablo was okay with this in chat, so I went ahead and committed this patch with some minor tweaks, mainly moving the two values we discussed to defines above the function.