Skip to content
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

Only update EditorSceneTabs tabs when necessary #83957

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Oct 25, 2023

Fixes resizing rebuilds all tabs
Fixes updating scene unsaved state (basically every action) rebuilds all tabs
Fixes #81513
Fixes this TODO in editor_scene_tabs

// TODO: This REALLY should be done in a better way than replacing all tabs after almost EVERY action.

update_scene_tabs now resizes its tabs only if it needs to, instead of always clearing and adding one by one.
added _update_tab_titles - updates the titles and icons of tabs. If the tab already has those values, it will not redraw.
added _scene_tabs_resized - repositions the add button. Used when resizing.

This could be optimized further by updating only the affected tab.

Needs testing on Mac to make sure the global menu works as expected. Particularly that it updates its name based on saved/unsaved state and that reordering tabs doesn't break it.

@YuriSizov YuriSizov modified the milestones: 4.x, 4.3 Oct 26, 2023
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some quick testing and seems to work correctly

@kitbdev
Copy link
Contributor Author

kitbdev commented Oct 26, 2023

updated to use set_block_signals and moved an if statement out of a for loop.

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty great! Some lines related to global menus could probably be spread across multiple lines for readability, but that's not important right now.

@YuriSizov YuriSizov merged commit 19f4dfb into godotengine:master Dec 14, 2023
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switching scene tabs with many tabs may hide tabs
4 participants