mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Merge pull request #31338 from Calinou/reorganize-menus
Reorganize various menus for consistency and conciseness
This commit is contained in:
commit
f8574da2c2
8 changed files with 83 additions and 68 deletions
|
@ -490,9 +490,6 @@ void ScriptEditor::_update_recent_scripts() {
|
|||
Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scripts", Array());
|
||||
recent_scripts->clear();
|
||||
|
||||
recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent")));
|
||||
recent_scripts->add_separator();
|
||||
|
||||
String path;
|
||||
for (int i = 0; i < rc.size(); i++) {
|
||||
|
||||
|
@ -515,11 +512,6 @@ void ScriptEditor::_open_recent_script(int p_idx) {
|
|||
return;
|
||||
}
|
||||
|
||||
// take two for the open recent button
|
||||
if (p_idx > 0) {
|
||||
p_idx -= 2;
|
||||
}
|
||||
|
||||
Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scripts", Array());
|
||||
ERR_FAIL_INDEX(p_idx, rc.size());
|
||||
|
||||
|
@ -1000,7 +992,7 @@ void ScriptEditor::_menu_option(int p_option) {
|
|||
|
||||
file_dialog->clear_filters();
|
||||
file_dialog->popup_centered_ratio();
|
||||
file_dialog->set_title(TTR("New TextFile..."));
|
||||
file_dialog->set_title(TTR("New Text File..."));
|
||||
} break;
|
||||
case FILE_OPEN: {
|
||||
file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE);
|
||||
|
@ -3241,7 +3233,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
|||
file_menu->set_switch_on_hover(true);
|
||||
file_menu->get_popup()->set_hide_on_window_lose_focus(true);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New Script...")), FILE_NEW);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New TextFile...")), FILE_NEW_TEXTFILE);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New Text File...")), FILE_NEW_TEXTFILE);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open...")), FILE_OPEN);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reopen_closed_script", TTR("Reopen Closed Script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T), FILE_REOPEN_CLOSED);
|
||||
file_menu->get_popup()->add_submenu_item(TTR("Open Recent"), "RecentScripts", FILE_OPEN_RECENT);
|
||||
|
@ -3274,17 +3266,20 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
|||
theme_submenu->connect("id_pressed", this, "_theme_option");
|
||||
theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme...")), THEME_IMPORT);
|
||||
theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/reload_theme", TTR("Reload Theme")), THEME_RELOAD);
|
||||
|
||||
theme_submenu->add_separator();
|
||||
theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/save_theme", TTR("Save Theme")), THEME_SAVE);
|
||||
theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/save_theme_as", TTR("Save Theme As...")), THEME_SAVE_AS);
|
||||
|
||||
file_menu->get_popup()->add_separator();
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_other_tabs", TTR("Close Other Tabs")), CLOSE_OTHER_TABS);
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
|
||||
|
||||
file_menu->get_popup()->add_separator();
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/run_file", TTR("Run"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_X), FILE_RUN);
|
||||
|
||||
file_menu->get_popup()->add_separator();
|
||||
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL);
|
||||
file_menu->get_popup()->connect("id_pressed", this, "_menu_option");
|
||||
|
@ -3573,8 +3568,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
|
|||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_flags", PROPERTY_HINT_PLACEHOLDER_TEXT, "Call flags with placeholders: {project}, {file}, {col}, {line}."));
|
||||
|
||||
ED_SHORTCUT("script_editor/reopen_closed_script", TTR("Reopen Closed Script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T);
|
||||
ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent"));
|
||||
ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files"));
|
||||
ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Scripts"));
|
||||
}
|
||||
|
||||
ScriptEditorPlugin::~ScriptEditorPlugin() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue