From a3ceb54c485a79ea4d316c5a288f8686bc3b1526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Sat, 20 Jan 2024 04:01:26 +0000 Subject: [PATCH] fix closing tabs not showing the right content (#46) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #43 Reviewed-on: https://codeberg.org/StreamGraph/StreamGraph/pulls/46 Co-authored-by: Lera ElvoƩ Co-committed-by: Lera ElvoƩ --- graph_node_renderer/tab_container_custom.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graph_node_renderer/tab_container_custom.gd b/graph_node_renderer/tab_container_custom.gd index 1fbfcf0..2dedab2 100644 --- a/graph_node_renderer/tab_container_custom.gd +++ b/graph_node_renderer/tab_container_custom.gd @@ -101,11 +101,11 @@ func is_empty() -> bool: ## Closes a tab at the index [param tab]. func close_tab(tab: int) -> void: + if !tab_bar.select_previous_available(): + tab_bar.select_next_available() content_container.get_child(tab).queue_free() _tab_metadata.remove_at(tab) tab_bar.remove_tab(tab) - if !tab_bar.select_previous_available(): - tab_bar.select_next_available() tab_closed.emit(tab) if tab_bar.tab_count == 0: _previous_active_tab = -1