Skip to content

Commit

Permalink
Use find_child(control) instead of find_name(control.name)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilzoide committed Feb 18, 2024
1 parent a7e87a4 commit 375e7ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions addons/dockable_container/dockable_panel.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@tool
extends TabContainer

signal tab_layout_changed(tab)
signal tab_layout_changed(tab: int)

var leaf: DockableLayoutPanel:
get:
Expand Down Expand Up @@ -80,7 +80,6 @@ func _on_tab_changed(tab: int) -> void:
var control := get_tab_control(tab)
if not control:
return
var tab_name := control.name
var name_index_in_leaf := _leaf.find_name(tab_name)
var name_index_in_leaf := _leaf.find_child(control)
if name_index_in_leaf != tab: # NOTE: this handles added tabs (index == -1)
tab_layout_changed.emit(tab)

0 comments on commit 375e7ea

Please sign in to comment.