-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defer tab_changed
signal when removing children from TabContainer
nodes
#63176
Conversation
tab_changed
signal when removing children from TabContainer
nodestab_changed
signal when removing children from TabContainer
nodes
bb4892e
to
9eaa7fd
Compare
When you remove multiple tabs, the signal is queued for each removal and then fired all at once. But idk if it has undesired effect 🤔 |
9eaa7fd
to
e35f2e7
Compare
Really can't think of a better solution. The only thing that would truly take care of all corner cases is if there was a callback for just after the child was removed. |
@KoBeWi One thing that could be done is go back to the current solution, but use an array instead of a single-node variable. Feels hacky, but I think that would solve the previous problem without firing the signals all at once. |
Or you can add |
That would still make the signal always fire at the last moment of the frame, and this may be undesirable when doing further modifications to the tabs all at once. |
I prefer #67928, there are multiple signals emitted during the |
Superseded by #67928. |
Reverts #63145 by resolving the problem with a different approach.
While it still removes the tab immediately, the signal emission itself is deferred. This means functions that do operations which modify the tab bar still work correctly when called right after
remove_child(child)
, while stuff that relies on the signal also works as well.This implementation also avoids a bug from the older version when doing a operation that affect the tab bar right when the
tab_changed
signal is called.I tested it with the bugs closed by the previous PR and they seemed to remain fixed, but I remember also not being able to reproduce the bug even before the old fix, so more testing is required.