mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
fix closing tabs not showing the right content (#46)
fixes #43 Reviewed-on: https://codeberg.org/StreamGraph/StreamGraph/pulls/46 Co-authored-by: Lera Elvoé <yagich@poto.cafe> Co-committed-by: Lera Elvoé <yagich@poto.cafe>
This commit is contained in:
parent
b143c63dcc
commit
a3ceb54c48
1 changed files with 2 additions and 2 deletions
|
@ -101,11 +101,11 @@ func is_empty() -> bool:
|
||||||
|
|
||||||
## Closes a tab at the index [param tab].
|
## Closes a tab at the index [param tab].
|
||||||
func close_tab(tab: int) -> void:
|
func close_tab(tab: int) -> void:
|
||||||
|
if !tab_bar.select_previous_available():
|
||||||
|
tab_bar.select_next_available()
|
||||||
content_container.get_child(tab).queue_free()
|
content_container.get_child(tab).queue_free()
|
||||||
_tab_metadata.remove_at(tab)
|
_tab_metadata.remove_at(tab)
|
||||||
tab_bar.remove_tab(tab)
|
tab_bar.remove_tab(tab)
|
||||||
if !tab_bar.select_previous_available():
|
|
||||||
tab_bar.select_next_available()
|
|
||||||
tab_closed.emit(tab)
|
tab_closed.emit(tab)
|
||||||
if tab_bar.tab_count == 0:
|
if tab_bar.tab_count == 0:
|
||||||
_previous_active_tab = -1
|
_previous_active_tab = -1
|
||||||
|
|
Loading…
Reference in a new issue