mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Set dynamics dialog to correct size after something is made visible … (#1104)
* Set dynamics dialog to correct size after something is made visible or hidden * use a separate function instead of lambdha
This commit is contained in:
parent
9824aef893
commit
10e457bf26
|
@ -29,6 +29,15 @@ func _ready() -> void:
|
||||||
size_velocity_button.toggled.connect(
|
size_velocity_button.toggled.connect(
|
||||||
_on_dynamics_toggled.bind(size_velocity_button, SIZE, Tools.Dynamics.VELOCITY)
|
_on_dynamics_toggled.bind(size_velocity_button, SIZE, Tools.Dynamics.VELOCITY)
|
||||||
)
|
)
|
||||||
|
for child: Control in $VBoxContainer.get_children():
|
||||||
|
## Resets the y-size to an appropriate value
|
||||||
|
child.visibility_changed.connect(_recalculate_size)
|
||||||
|
|
||||||
|
|
||||||
|
func _recalculate_size():
|
||||||
|
await get_tree().process_frame
|
||||||
|
set_size(Vector2i(size.x, 0))
|
||||||
|
set_size(Vector2i(size.x, size.y + 10))
|
||||||
|
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
|
|
Loading…
Reference in a new issue