How to signal that the minimum size of your custom Container has changed?

Godot Version

v4.4.stable.official [4c311cbee]

Question

I’m writing a custom Container class and I need a way to notify Godot that the minimum container size has changed. When the user changes the drag_bar_width or content_width properties, the layout should update to reflect this change. Right now I’m overriding _get_minimum_size() to indicate the minimum size.

Is there a way to signal that this size has changed?

func _get_minimum_size() -> Vector2:
	var min_size = Vector2(drag_bar_width + content_width, 0)
	print("min_size ", min_size)
	return min_size

All control nodes have a minimum_size_changed signal. But you might need to actually set the the minimum size (custom_minimum_size = ...) in order to emit that signal.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.