Fix T97100: Fix ordering in color attribute list items

The new tab in the properties panel for "Color Attributes" shows the
data type and domain, just like the Attributes tab.
The issue is that the UI does not scale well and can only display the
full names when dragged to an extreme width.
This is due to the inclusion of the render icon in between the
attribute name and attribute type description.

This patch changes the order that items are displayed in the Color
Attributes Panel. Moving the render icon to the very right.
The result is consistent with other parts of the Blender UI and does
not take as much space to display the full text.

Reviewed By: @jbakker
Differential Revision: https://developer.blender.org/D14567
Ref D14567
This commit is contained in:
2022-04-11 23:08:23 -07:00
parent d683ea4862
commit 4a3bcfa102
4 changed files with 14 additions and 13 deletions

View File

@@ -599,21 +599,22 @@ class MESH_UL_color_attributes(UIList, ColorAttributesListBase):
split.emboss = 'NONE'
split.prop(attribute, "name", text="")
active_render = _index == data.color_attributes.render_color_index
props = split.operator(
"geometry.color_attribute_render_set",
text="",
icon='RESTRICT_RENDER_OFF' if active_render else 'RESTRICT_RENDER_ON',
)
props.name = attribute.name
sub = split.row()
sub.alignment = 'RIGHT'
sub.active = False
sub.label(text="%s%s" % (domain_name, data_type.name))
active_render = _index == data.color_attributes.render_color_index
row = layout.row()
row.emboss = 'NONE'
prop = row.operator(
"geometry.color_attribute_render_set",
text="",
icon='RESTRICT_RENDER_OFF' if active_render else 'RESTRICT_RENDER_ON',
)
prop.name = attribute.name
class MESH_UL_color_attributes_selector(UIList, ColorAttributesListBase):
def draw_item(self, _context, layout, data, attribute, _icon, _active_data, _active_propname, _index):