Merge pull request #367 from Arnklit/alignment-fixes

Alignment fixes for enum, text and file fields
This commit is contained in:
Rodz Labs 2021-10-24 14:17:07 +02:00 committed by GitHub
commit c07c8f7cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -195,6 +195,7 @@ static func create_parameter_control(p : Dictionary, accept_float_expressions :
var value = p.values[i]
control.add_item(value.name)
control.selected = 0 if !p.has("default") else p.default
control.rect_min_size.x = 80
elif p.type == "boolean":
control = CheckBox.new()
elif p.type == "color":
@ -212,10 +213,12 @@ static func create_parameter_control(p : Dictionary, accept_float_expressions :
control.set_closed(false)
elif p.type == "string":
control = LineEdit.new()
control.rect_min_size.x = 80
elif p.type == "image_path":
control = preload("res://material_maker/widgets/image_picker_button/image_picker_button.tscn").instance()
elif p.type == "file":
control = preload("res://material_maker/widgets/file_picker_button/file_picker_button.tscn").instance()
control.rect_min_size.x = 80
if p.has("filters"):
for f in p.filters:
control.add_filter(f)