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

Disable irrelevant scene tab context menu items #79382

Merged

Conversation

MewPurPur
Copy link
Contributor

@MewPurPur MewPurPur commented Jul 12, 2023

Like it's done in the script list.

image

@KoBeWi
Copy link
Member

KoBeWi commented Aug 1, 2023

Bug:
godot windows editor dev x86_64_CqvQlw9JEv

@MewPurPur
Copy link
Contributor Author

Oh, so this makes an existing bug surface where the popup doesn't realize in time that by doing RMB, you changed the active scene. I have a mild memory of noticing this bug already being present for Undo Close Tab somehow. Either way, I should probably look into fixing this before the PR is acceptable

@KoBeWi
Copy link
Member

KoBeWi commented Aug 1, 2023

I think you should use the clicked tab id instead of the current scene.

@MewPurPur MewPurPur force-pushed the better-prepare-scene-context-menu branch from 9d4a13a to 4b0ee49 Compare August 4, 2023 16:05
@MewPurPur
Copy link
Contributor Author

MewPurPur commented Aug 4, 2023

True, doned and works

@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Aug 4, 2023
@akien-mga akien-mga merged commit 678c89a into godotengine:master Aug 17, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@MewPurPur MewPurPur deleted the better-prepare-scene-context-menu branch August 17, 2023 09:39
Comment on lines +5623 to +5629
if (editor_data.get_edited_scene_count() <= 1) {
scene_tabs_context_menu->set_item_disabled(file_menu->get_item_index(FILE_CLOSE_OTHERS), true);
}
scene_tabs_context_menu->add_item(TTR("Close Tabs to the Right"), FILE_CLOSE_RIGHT);
if (editor_data.get_edited_scene_count() == tab_id + 1) {
scene_tabs_context_menu->set_item_disabled(file_menu->get_item_index(FILE_CLOSE_RIGHT), true);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a typo here, right? It shouldn't be file_menu, it should be scene_tabs_context_menu.

Copy link
Contributor

Choose a reason for hiding this comment

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

I fixed it in #80490.

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.

4 participants