Page MenuHome

UI: Labels with icons create additional padding after label text (in contrast to labels without icons)
Confirmed, NormalPublicBUG

Description

System Information
Operating system: Darwin-20.2.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 570 OpenGL Engine ATI Technologies Inc. 4.1 ATI-4.2.13

Blender Version
Broken: version: 2.92.0 Beta, branch: master, commit date: 2021-02-01 15:40, hash: rBd5d8655ca15c
Worked: -

Short description of error
UI: Labels with icons create additional padding after label text (in contrast to labels without icons)

Exact steps for others to reproduce the error
Based on the following layout:

# Text only:
row = layout.row(align=True)
row.alignment = 'RIGHT'
row.label(text='Hello World')

# Text with icon:
row = layout.row(align=True)
row.alignment = 'RIGHT'
row.label(text='Hello World', icon='WORLD')

# Text only again:
row = layout.row(align=True)
row.alignment = 'RIGHT'
row.label(text='Hello World')

# Icon only:
row = layout.row(align=True)
row.alignment = 'RIGHT'
row.label(icon='WORLD')

Above code drawn in a Panel looks like this in Blender 2.83.12, 2.91.2, 2.92 and 2.93:


(Differences in padding marked red)

In the newer releases, text-only labels are right-aligned with icon-only labels.

But in the case of text and icon set in a label, there still is additional padding.

Event Timeline

Thanks for the report. This may be related to T84869.

@Hans Goudey (HooglyBoogly) This related to D9058 changes, it removes the text padding only for labels without an icon. I guess there's no easy way to fix this and not ruin something else.

Falk David (filedescriptor) changed the task status from Needs Triage to Confirmed.Feb 3 2021, 10:18 AM
Julian Eisel (Severin) changed the subtype of this task from "Report" to "Bug".Feb 3 2021, 2:47 PM

Seems like this is only an issue with right aligned text? Maybe we could also just remove the padding for that too (even with icon)? @Yevgeny Makarov (jenkm) are you looking into this?

A regression, so classifying this as bug.

Maybe we could also just remove the padding for that too (even with icon)?

This is a text padding, the icon will remain in place, and you will get a large gap between the icon and the text.
I'm afraid you also need to adjust the size of the label/button to make it work correctly.