summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_file_dialog.cpp5
-rw-r--r--editor/editor_node.cpp11
-rw-r--r--editor/editor_settings.cpp15
-rw-r--r--editor/editor_settings.h1
-rw-r--r--editor/inspector_dock.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp1
-rw-r--r--editor/plugins/script_text_editor.cpp1
-rw-r--r--editor/plugins/tiles/atlas_merging_dialog.cpp4
-rw-r--r--editor/project_manager.cpp14
9 files changed, 35 insertions, 19 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 3de4379c5d..50826f572a 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -1705,6 +1705,11 @@ EditorFileDialog::EditorFileDialog() {
ED_SHORTCUT("file_dialog/move_favorite_up", TTR("Move Favorite Up"), KeyModifierMask::CMD_OR_CTRL | Key::UP);
ED_SHORTCUT("file_dialog/move_favorite_down", TTR("Move Favorite Down"), KeyModifierMask::CMD_OR_CTRL | Key::DOWN);
+ if (EditorSettings::get_singleton()) {
+ ED_SHORTCUT_OVERRIDE("file_dialog/toggle_favorite", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::F);
+ ED_SHORTCUT_OVERRIDE("file_dialog/toggle_mode", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::V);
+ }
+
HBoxContainer *pathhb = memnew(HBoxContainer);
dir_prev = memnew(Button);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index b854da8e4f..3555caac8a 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -7203,6 +7203,7 @@ EditorNode::EditorNode() {
file_menu->add_separator();
file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open", TTR("Quick Open..."), KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::O), FILE_QUICK_OPEN);
+ ED_SHORTCUT_OVERRIDE("editor/quick_open", "macos", KeyModifierMask::META + KeyModifierMask::CTRL + Key::O);
file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_scene", TTR("Quick Open Scene..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::O), FILE_QUICK_OPEN_SCENE);
file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_script", TTR("Quick Open Script..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::ALT + Key::O), FILE_QUICK_OPEN_SCRIPT);
@@ -7274,7 +7275,7 @@ EditorNode::EditorNode() {
project_menu->add_separator();
project_menu->add_shortcut(ED_SHORTCUT("editor/reload_current_project", TTR("Reload Current Project")), RELOAD_CURRENT_PROJECT);
ED_SHORTCUT_AND_COMMAND("editor/quit_to_project_list", TTR("Quit to Project List"), KeyModifierMask::CTRL + KeyModifierMask::SHIFT + Key::Q);
- ED_SHORTCUT_OVERRIDE("editor/quit_to_project_list", "macos", KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::Q);
+ ED_SHORTCUT_OVERRIDE("editor/quit_to_project_list", "macos", KeyModifierMask::META + KeyModifierMask::CTRL + KeyModifierMask::ALT + Key::Q);
project_menu->add_shortcut(ED_GET_SHORTCUT("editor/quit_to_project_list"), RUN_PROJECT_MANAGER, true);
// Spacer to center 2D / 3D / Script buttons.
@@ -7996,10 +7997,10 @@ EditorNode::EditorNode() {
ED_SHORTCUT_AND_COMMAND("editor/editor_script", TTR("Open Script Editor"), KeyModifierMask::CTRL | Key::F3);
ED_SHORTCUT_AND_COMMAND("editor/editor_assetlib", TTR("Open Asset Library"), KeyModifierMask::CTRL | Key::F4);
- ED_SHORTCUT_OVERRIDE("editor/editor_2d", "macos", KeyModifierMask::ALT | Key::KEY_1);
- ED_SHORTCUT_OVERRIDE("editor/editor_3d", "macos", KeyModifierMask::ALT | Key::KEY_2);
- ED_SHORTCUT_OVERRIDE("editor/editor_script", "macos", KeyModifierMask::ALT | Key::KEY_3);
- ED_SHORTCUT_OVERRIDE("editor/editor_assetlib", "macos", KeyModifierMask::ALT | Key::KEY_4);
+ ED_SHORTCUT_OVERRIDE("editor/editor_2d", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::KEY_1);
+ ED_SHORTCUT_OVERRIDE("editor/editor_3d", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::KEY_2);
+ ED_SHORTCUT_OVERRIDE("editor/editor_script", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::KEY_3);
+ ED_SHORTCUT_OVERRIDE("editor/editor_assetlib", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::KEY_4);
ED_SHORTCUT_AND_COMMAND("editor/editor_next", TTR("Open the next Editor"));
ED_SHORTCUT_AND_COMMAND("editor/editor_prev", TTR("Open the previous Editor"));
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index c90f8e9bf0..b4f5eeda84 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1384,8 +1384,13 @@ float EditorSettings::get_auto_display_scale() const {
// Shortcuts
+void EditorSettings::_add_shortcut_default(const String &p_name, const Ref<Shortcut> &p_shortcut) {
+ shortcuts[p_name] = p_shortcut;
+}
+
void EditorSettings::add_shortcut(const String &p_name, const Ref<Shortcut> &p_shortcut) {
shortcuts[p_name] = p_shortcut;
+ shortcuts[p_name]->set_meta("customized", true);
}
bool EditorSettings::is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const {
@@ -1489,12 +1494,12 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c
}
}
- // Override the existing shortcut only if it wasn't customized by the user (i.e. still "original").
- sc->set_meta("original", events.duplicate(true));
-
- if (Shortcut::is_event_array_equal(sc->get_events(), sc->get_meta("original"))) {
+ // Override the existing shortcut only if it wasn't customized by the user.
+ if (!sc->has_meta("customized")) {
sc->set_events(events);
}
+
+ sc->set_meta("original", events.duplicate(true));
}
Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, Key p_keycode) {
@@ -1543,7 +1548,7 @@ Ref<Shortcut> ED_SHORTCUT_ARRAY(const String &p_path, const String &p_name, cons
sc->set_name(p_name);
sc->set_events(events);
sc->set_meta("original", events.duplicate(true)); //to compare against changes
- EditorSettings::get_singleton()->add_shortcut(p_path, sc);
+ EditorSettings::get_singleton()->_add_shortcut_default(p_path, sc);
return sc;
}
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index e8775636a3..e1d3e757e0 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -170,6 +170,7 @@ public:
String get_editor_layouts_config() const;
float get_auto_display_scale() const;
+ void _add_shortcut_default(const String &p_name, const Ref<Shortcut> &p_shortcut);
void add_shortcut(const String &p_name, const Ref<Shortcut> &p_shortcut);
bool is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const;
Ref<Shortcut> get_shortcut(const String &p_name) const;
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 52482ecb16..ab061c4d5c 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -186,7 +186,7 @@ void InspectorDock::_menu_option_confirm(int p_option, bool p_confirmed) {
}
}
- int history_id = EditorUndoRedoManager::get_singleton()->get_history_for_object(current).id;
+ int history_id = EditorUndoRedoManager::get_singleton()->get_history_id_for_object(current);
EditorUndoRedoManager::get_singleton()->clear_history(true, history_id);
EditorNode::get_singleton()->edit_item(current, inspector);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index ccbc7c3d74..a584d357cd 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -3814,6 +3814,7 @@ ScriptEditor::ScriptEditor() {
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save", TTR("Save"), KeyModifierMask::ALT | KeyModifierMask::CMD_OR_CTRL | Key::S), FILE_SAVE);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_as", TTR("Save As...")), FILE_SAVE_AS);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_all", TTR("Save All"), KeyModifierMask::SHIFT | KeyModifierMask::ALT | Key::S), FILE_SAVE_ALL);
+ ED_SHORTCUT_OVERRIDE("script_editor/save_all", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::S);
file_menu->get_popup()->add_separator();
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reload_script_soft", TTR("Soft Reload Tool Script"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::R), FILE_TOOL_RELOAD_SOFT);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/copy_path", TTR("Copy Script Path")), FILE_COPY_PATH);
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 9fe1d8af99..5e70a407dd 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -2270,6 +2270,7 @@ void ScriptTextEditor::register_editor() {
ED_SHORTCUT("script_text_editor/unindent", TTR("Unindent"), KeyModifierMask::SHIFT | Key::TAB);
ED_SHORTCUT("script_text_editor/toggle_comment", TTR("Toggle Comment"), KeyModifierMask::CMD_OR_CTRL | Key::K);
ED_SHORTCUT("script_text_editor/toggle_fold_line", TTR("Fold/Unfold Line"), KeyModifierMask::ALT | Key::F);
+ ED_SHORTCUT_OVERRIDE("script_text_editor/toggle_fold_line", "macos", KeyModifierMask::CTRL | KeyModifierMask::META | Key::F);
ED_SHORTCUT("script_text_editor/fold_all_lines", TTR("Fold All Lines"), Key::NONE);
ED_SHORTCUT("script_text_editor/unfold_all_lines", TTR("Unfold All Lines"), Key::NONE);
ED_SHORTCUT("script_text_editor/duplicate_selection", TTR("Duplicate Selection"), KeyModifierMask::SHIFT | KeyModifierMask::CTRL | Key::D);
diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp
index eaf72d36ba..8404ea0969 100644
--- a/editor/plugins/tiles/atlas_merging_dialog.cpp
+++ b/editor/plugins/tiles/atlas_merging_dialog.cpp
@@ -245,7 +245,9 @@ bool AtlasMergingDialog::_get(const StringName &p_name, Variant &r_ret) const {
void AtlasMergingDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
- _update_texture();
+ if (is_visible()) {
+ _update_texture();
+ }
} break;
}
}
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 1d510703b0..c00ef326d0 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -2240,11 +2240,11 @@ void ProjectManager::_open_selected_projects_ask() {
return;
}
- const Size2i popup_min_width = Size2i(600.0 * EDSCALE, 0);
+ const Size2i popup_min_size = Size2i(600.0 * EDSCALE, 400.0 * EDSCALE);
if (selected_list.size() > 1) {
multi_open_ask->set_text(vformat(TTR("You requested to open %d projects in parallel. Do you confirm?\nNote that usual checks for engine version compatibility will be bypassed."), selected_list.size()));
- multi_open_ask->popup_centered(popup_min_width);
+ multi_open_ask->popup_centered(popup_min_size);
return;
}
@@ -2266,7 +2266,7 @@ void ProjectManager::_open_selected_projects_ask() {
// Check if the config_version property was empty or 0.
if (config_version == 0) {
ask_update_settings->set_text(vformat(TTR("The selected project \"%s\" does not specify its supported Godot version in its configuration file (\"project.godot\").\n\nProject path: %s\n\nIf you proceed with opening it, it will be converted to Godot's current configuration file format.\n\nWarning: You won't be able to open the project with previous versions of the engine anymore."), project.project_name, project.path));
- ask_update_settings->popup_centered(popup_min_width);
+ ask_update_settings->popup_centered(popup_min_size);
return;
}
// Check if we need to convert project settings from an earlier engine version.
@@ -2279,14 +2279,14 @@ void ProjectManager::_open_selected_projects_ask() {
ask_update_settings->set_text(vformat(TTR("The selected project \"%s\" was generated by an older engine version, and needs to be converted for this version.\n\nProject path: %s\n\nDo you want to convert it?\n\nWarning: You won't be able to open the project with previous versions of the engine anymore."), project.project_name, project.path));
ask_update_settings->get_ok_button()->set_text(TTR("Convert project.godot"));
}
- ask_update_settings->popup_centered(popup_min_width);
+ ask_update_settings->popup_centered(popup_min_size);
ask_update_settings->get_cancel_button()->grab_focus(); // To prevent accidents.
return;
}
// Check if the file was generated by a newer, incompatible engine version.
if (config_version > ProjectSettings::CONFIG_VERSION) {
dialog_error->set_text(vformat(TTR("Can't open project \"%s\" at the following path:\n\n%s\n\nThe project settings were created by a newer engine version, whose settings are not compatible with this version."), project.project_name, project.path));
- dialog_error->popup_centered(popup_min_width);
+ dialog_error->popup_centered(popup_min_size);
return;
}
// Check if the project is using features not supported by this build of Godot.
@@ -2315,7 +2315,7 @@ void ProjectManager::_open_selected_projects_ask() {
warning_message += TTR("Open anyway? Project will be modified.");
ask_update_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
ask_update_settings->set_text(warning_message);
- ask_update_settings->popup_centered(popup_min_width);
+ ask_update_settings->popup_centered(popup_min_size);
return;
}
@@ -2325,7 +2325,7 @@ void ProjectManager::_open_selected_projects_ask() {
void ProjectManager::_full_convert_button_pressed() {
ask_update_settings->hide();
- ask_full_convert_dialog->popup_centered(Size2i(600.0 * EDSCALE, 0));
+ ask_full_convert_dialog->popup_centered(Size2i(600.0 * EDSCALE, 400.0 * EDSCALE));
ask_full_convert_dialog->get_cancel_button()->grab_focus();
}