godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix `TabContainer` regressions related to switching tabs in certain cases

Open YeldhamDev opened this issue 10 months ago • 4 comments

Fixes #91135.

  • Fix regression caused by #83893, where setting the current tab right after entering the tree would make the value be reset to 0.

  • The other one is bit more complicated (caused by #87194). It happens because the tab visibility change is also triggered if it becomes visible in the tree (even if it was already set to visible), ~and I'm not sure how to fix this without some ugly hackiness.~ Alright, did the cleanest attempt I could, suggestions are welcomed.

Thanks to @jsjtxietian for pointing me in the right direction and saving me time.

YeldhamDev avatar Apr 25 '24 22:04 YeldhamDev

partially fixes https://github.com/godotengine/godot/issues/91135

You should unlink the issue then. I tested and the visibility problem is not fixed.

KoBeWi avatar May 01 '24 12:05 KoBeWi

We could make the tab visibility callback only apply in the editor when it is part of the edited scene, since that is where it is most intended for.

Also, the reason it used NOTIFICATION_POST_ENTER_TREE is to let the TabContainer's children be set up first, but I guess it isn't needed.

kitbdev avatar May 01 '24 16:05 kitbdev

You should unlink the issue then. I tested and the visibility problem is not fixed.

Wait, I just forgot to update the PR's description, because both issues are fixed on my end. What happens in the visibility test scene on your end?

YeldhamDev avatar May 01 '24 16:05 YeldhamDev

Nevermind, I didn't test properly.

KoBeWi avatar May 01 '24 23:05 KoBeWi

Thanks!

akien-mga avatar May 02 '24 10:05 akien-mga