diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-28 07:07:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-28 07:36:52 +0300 |
commit | c7d94a7827a5be9343eea22a9638bb059f185206 (patch) | |
tree | 8187e76d2e289e6763e3af60356642ac24f2a3be /release | |
parent | 986d60490c0694941e27c070780c55f07b7b4842 (diff) |
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.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 7bdc3ab160f..5970d6fdf2b 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -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' |