diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-07 14:53:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-07 14:53:29 +0200 |
commit | 309c0cb01b51c106aff2a322f4bfe0ae6eb3317a (patch) | |
tree | 8792bb779b08c0f7ba6537f745d1fe8330cfe00c /scene/gui/tabs.cpp | |
parent | 9244ea6d5495cced4005388566915d35eb3a1412 (diff) | |
parent | 63ddad98f5594f445a8998730c19890707e7cea9 (diff) |
Merge pull request #10113 from kubecz3k/tab-signal
'tab_changed' signal after using 'set_current_tab'
Diffstat (limited to 'scene/gui/tabs.cpp')
-rw-r--r-- | scene/gui/tabs.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 24eb19fbc2..a2deef4eea 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -226,7 +226,6 @@ void Tabs::_gui_input(const Ref<InputEvent> &p_event) { if (found != -1) { set_current_tab(found); - emit_signal("tab_changed", found); } } } @@ -419,6 +418,7 @@ int Tabs::get_tab_count() const { void Tabs::set_current_tab(int p_current) { + if (current == p_current) return; ERR_FAIL_INDEX(p_current, get_tab_count()); current = p_current; @@ -426,6 +426,8 @@ void Tabs::set_current_tab(int p_current) { _change_notify("current_tab"); _update_cache(); update(); + + emit_signal("tab_changed", p_current); } int Tabs::get_current_tab() const { |