Page MenuHome

UI: Fix aligning labels with other buttons
ClosedPublic

Authored by Yevgeny Makarov (jenkm) on Sep 30 2020, 9:58 PM.
Tokens
"Burninate" token, awarded by Blender_Defender."Like" token, awarded by hitrpr."Love" token, awarded by DotBow."Love" token, awarded by HooglyBoogly.

Details

Summary

UI: Fix aligning labels with other buttons.

This patch revert D6925, it was aligning the label with the checkboxes,
but after changing the checkboxes it doesn't help anymore.

In the following (old) image, the second label has an unnecessary offset.

Now the UI_BUT_NO_TEXT_PADDING flag is used to remove the extra padding.


There is still pixelsize offset (thickness of the outline) so that the text does not stick out visually,
if the outline of the button does not contrast with the background.

This also adds (intentionally) pixelsize padding for checkboxes text.
The text looks too close to the checkbox at 2x scale,
it looks less than the space between words, which is not good.


Some examples before and after:

Diff Detail

Repository
rB Blender

Event Timeline

I'm not sure I agree with the change to the node label offset

BeforeAfter

I like the way it aligns to the buttons without the patch a bit more. Since there doesn't seem to be a pressing reason to change this I'd suggest just leaving this part out of the patch.

Other than that the changes look good.

These changes seem pretty fine (with exception of the nod related one, Hans will comment on that). But with these are a few related changes mixed together, which makes it hard to reason about what does what. So please give a little description of what each change does, if things seem reasonable then, I'm ready to accept it.

If this is merged in bcon1 there's plenty of time to fix issues should there be some (hard to tell with such layout changes).

Oops, it looks like I actually got the "Before" and "After" screenshots backwards, I take back my previous comment then.

Since it removes the padding before/after the label, changes to rna_prop_ui.py, interface_layout.c, node_intern.h simply restore some indent so that it looks like before.

In interface_widgets.c I remove the old 'hack' D6925, and set UI_BUT_NO_TEXT_PADDING flag for labels.
Additional pixelsize offset is explained in the comment and in the description.

There's nothing else here.

What looks bad is the popup's headlines.

And labels inside box, such as add-on or keymap.
I think the left/right margins of blocks can be increased.

But in any case, this is not a problem with labels, the labels are properly aligned at the edge of the buttons.

I didn't investigate the individual changes yet, they all have the potential to break things visually, and I'm a bit skeptical about the padding changes to the split layouts.

But that said, I'm fine with trying this in master. Like said we're in bcon1, so it's fine to experiment a bit.

This revision is now accepted and ready to land.Oct 28 2020, 4:31 PM