diff --git a/flumi/Scripts/Browser/Tab.gd b/flumi/Scripts/Browser/Tab.gd index 6f7ac79..e454201 100644 --- a/flumi/Scripts/Browser/Tab.gd +++ b/flumi/Scripts/Browser/Tab.gd @@ -67,15 +67,18 @@ func _input(event): close_tween.set_ease(Tween.EASE_IN) close_tween.set_trans(Tween.TRANS_CUBIC) - close_tween.parallel().tween_property(self, "custom_minimum_size:x", 0.0, 0.15) - close_tween.parallel().tween_property(self, "size:x", 0.0, 0.15) - close_tween.parallel().tween_property(button, "custom_minimum_size:x", 0.0, 0.15) - close_tween.parallel().tween_property(button, "size:x", 0.0, 0.15) + animate_tab_close(close_tween) await close_tween.finished tab_closed.emit() queue_free() +func animate_tab_close(tween: Tween) -> void: + tween.parallel().tween_property(self, "custom_minimum_size:x", 0.0, 0.15) + tween.parallel().tween_property(self, "size:x", 0.0, 0.15) + tween.parallel().tween_property(button, "custom_minimum_size:x", 0.0, 0.15) + tween.parallel().tween_property(button, "size:x", 0.0, 0.15) + func set_title(title: String) -> void: button.text = title button.set_meta("original_text", title) @@ -247,10 +250,7 @@ func _on_close_button_pressed() -> void: close_tween.set_ease(Tween.EASE_IN) close_tween.set_trans(Tween.TRANS_CUBIC) - close_tween.parallel().tween_property(self, "custom_minimum_size:x", 0.0, 0.15) - close_tween.parallel().tween_property(self, "size:x", 0.0, 0.15) - close_tween.parallel().tween_property(button, "custom_minimum_size:x", 0.0, 0.15) - close_tween.parallel().tween_property(button, "size:x", 0.0, 0.15) + animate_tab_close(close_tween) await close_tween.finished tab_closed.emit()