UI: Fix text padding in some list widgets

Normally, pure text buttons have no padding at their edges so they
align with edges of buttons, see D9058. However, in several cases
there are labels aligned to the right side of a list widget row,
so they're missing padding against the right edge.

The fix is to use emboss = 'NONE' for such labels, which changes
the drawing style, adding padding on the right edge. (Normally so
labels aligned with the text from non-embossed buttons). This is
not necessarily intended, but it works properly.

For more information, see the revision.

Differential Revision: https://developer.blender.org/D9874
This commit is contained in:
Yevgeny Makarov 2020-12-20 11:27:02 -06:00 committed by Hans Goudey
parent 16527ebaba
commit 478ba53270
3 changed files with 5 additions and 2 deletions

View File

@ -86,8 +86,9 @@ class HAIR_UL_attributes(UIList):
domain = attribute.bl_rna.properties['domain'].enum_items[attribute.domain]
split = layout.split(factor=0.5)
split.emboss = 'NONE'
row = split.row()
row.prop(attribute, "name", text="", emboss=False)
row.prop(attribute, "name", text="")
sub = split.split()
sub.alignment = 'RIGHT'
sub.active = False

View File

@ -87,7 +87,8 @@ class POINTCLOUD_UL_attributes(UIList):
data_type = attribute.bl_rna.properties['data_type'].enum_items[attribute.data_type]
split = layout.split(factor=0.75)
split.prop(attribute, "name", text="", emboss=False)
split.emboss = 'NONE'
split.prop(attribute, "name", text="")
sub = split.row()
sub.alignment = 'RIGHT'
sub.active = False

View File

@ -88,6 +88,7 @@ class VOLUME_UL_grids(UIList):
name = grid.name
data_type = grid.bl_rna.properties['data_type'].enum_items[grid.data_type]
layout.emboss = 'NONE'
layout.label(text=name)
row = layout.row()
row.alignment = 'RIGHT'