Page MenuHome

Fix padding when multi-editing aligned widgets
ClosedPublic

Authored by RedMser (RedMser) on Jul 31 2020, 8:22 PM.

Details

Summary

Similar to T58668, labels are not aligned when multi-editing widgets that are not center-aligned.

Before:

After:

Diff Detail

Repository
rB Blender

Event Timeline

RedMser (RedMser) requested review of this revision.Jul 31 2020, 8:22 PM
RedMser (RedMser) created this revision.
RedMser (RedMser) edited the summary of this revision. (Show Details)Jul 31 2020, 8:26 PM

Apply clang-format

Thanks for the patch!

I think it makes more sense to just remove the text_is_edited check completely. The results are the same for me anyway, for buttons with and without labels.

Thanks for the patch!

I think it makes more sense to just remove the text_is_edited check completely. The results are the same for me anyway, for buttons with and without labels.

I had the same thought at first, but it turns out that without the check, multi-editing center-aligned widgets adds an unwanted offset:

I had the same thought at first, but it turns out that without the check, multi-editing center-aligned widgets adds an unwanted offset:

Aha! I figured you had some reason, just wanted to make sure. In that case I think this is good to go. It would be good for you or whoever commits this to add a comment explaining this.

This revision is now accepted and ready to land.Aug 3 2020, 8:33 PM

Good catch, thanks!
I did a slight correction to keep the code semantically correct. text_is_edited should only be true if the text is actually being edited. Extra conditions should be checked separately by the if-statement.
Logically this was perfectly fine though.