Skip to content

Commit

Permalink
Set dynamics dialog to correct size after something is made visible … (
Browse files Browse the repository at this point in the history
#1104)

* Set dynamics dialog to correct size after something is made visible or hidden

* use a separate function instead of lambdha
  • Loading branch information
Variable-ind authored Sep 20, 2024
1 parent 9824aef commit 10e457b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/UI/GlobalToolOptions/DynamicsPanel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ func _ready() -> void:
size_velocity_button.toggled.connect(
_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:
Expand Down

0 comments on commit 10e457b

Please sign in to comment.