Assets: UI: Reduce default text-box height for asset metadata text button properties

This reduces vertical offset in the asset browser metadata editor.
See discussion in  #158145

Pull Request: https://projects.blender.org/blender/blender/pulls/162151
This commit is contained in:
Guillermo Venegas 2026-08-02 00:42:54 +02:00 • committed by Guillermo Venegas
parent 0ebf8cbf13
commit c2acd5638e

View file

@ -781,7 +781,7 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel):
bl_options = {'HIDE_HEADER'}
@staticmethod
def metadata_prop(layout, asset_metadata, propname):
def metadata_prop(layout, asset_metadata, propname, initial_visible_lines: int = 1):
"""
Only display properties that are either set or can be modified (i.e. the
asset is in the current file). Empty, non-editable fields are not really useful.
@ -796,7 +796,8 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel):
split.label_multiline(
text=getattr(asset_metadata, propname))
else:
split.textbox(asset_metadata, propname, placeholder=ui_name)
split.textbox(asset_metadata, propname, placeholder=ui_name,
initial_visible_lines=initial_visible_lines)
def draw(self, context):
layout = self.layout
@ -839,7 +840,7 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel):
row.operator("asset.open_containing_blend_file", text="", icon='FILE_BLEND')
metadata = asset.metadata
self.metadata_prop(layout, metadata, "description")
self.metadata_prop(layout, metadata, "description", initial_visible_lines=3)
self.metadata_prop(layout, metadata, "license")
self.metadata_prop(layout, metadata, "copyright")
self.metadata_prop(layout, metadata, "author")