UI: avoid excessive padding for labels in headers
Labels in headers reserved space for an icon even when no icon was used. This is caused by the shared function ui_text_icon_width adding 1.5x a buttons X-units width the the width of the string. Menu buttons detected this and subtracted the extra padding. Instead of adding the same workaround for labels, add ui_text_icon_width_ex that takes a padding argument. Add presets for 'default', 'compact' and 'none' to avoid duplicating padding values. This allows removal of hard-coded label scaling for the add-object tool.
This commit is contained in:
@@ -497,18 +497,14 @@ class _defs_view3d_add:
|
||||
props = tool.operator_properties("view3d.interactive_add")
|
||||
if not extra:
|
||||
row = layout.row()
|
||||
row.scale_x = 0.8
|
||||
row.label(text="Depth:")
|
||||
row = layout.row()
|
||||
row.scale_x = 0.9
|
||||
row.prop(props, "plane_depth", text="")
|
||||
row = layout.row()
|
||||
row.scale_x = 0.8
|
||||
row.label(text="Orientation:")
|
||||
row = layout.row()
|
||||
row.prop(props, "plane_orientation", text="")
|
||||
row = layout.row()
|
||||
row.scale_x = 0.8
|
||||
row.prop(props, "snap_target")
|
||||
|
||||
region_is_header = bpy.context.region.type == 'TOOL_HEADER'
|
||||
|
||||
Reference in New Issue
Block a user