Skip to content

Commit 63e2bbd

Browse files
authored
Prevent button's icons from expanding the inspector button (#179)
1 parent 0fcafa5 commit 63e2bbd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

addons/pandora/ui/editor/inspector/entity_instance_browser_property.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ func _init(class_data: Dictionary) -> void:
1414

1515
var id_counter = 0
1616
var all_entities = _find_all_entities(class_data["path"])
17+
var editor_plugin: EditorPlugin = Engine.get_meta("PandoraEditorPlugin", null)
18+
# Prevent button from expanding to selected icon size.
19+
property_control.set_expand_icon(true)
1720

1821
for entity in all_entities:
1922
property_control.get_popup().add_icon_item(
2023
load(entity.get_icon_path()), entity.get_entity_name(), id_counter
2124
)
25+
if editor_plugin:
26+
property_control.get_popup().set_item_icon_max_width(id_counter, editor_plugin.get_editor_interface().get_editor_scale() * 16)
2227
# Godot 4.1+
2328
if property_control.get_popup().has_method("set_item_icon_modulate"):
2429
property_control.get_popup().set_item_icon_modulate(id_counter, entity.get_icon_color())

0 commit comments

Comments
 (0)