diff options
-rw-r--r-- | editor/project_manager.cpp | 9 | ||||
-rw-r--r-- | editor/project_manager.h | 8 | ||||
-rw-r--r-- | main/main.cpp | 5 | ||||
-rw-r--r-- | modules/visual_script/editor/visual_script_editor.cpp | 10 | ||||
-rw-r--r-- | modules/visual_script/editor/visual_script_editor.h | 1 | ||||
-rw-r--r-- | platform/osx/godot_content_view.mm | 4 | ||||
-rw-r--r-- | scene/gui/control.cpp | 23 |
7 files changed, 48 insertions, 12 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 1cd13e10c8..3ca25bb4e3 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1863,6 +1863,8 @@ void ProjectList::_bind_methods() { ADD_SIGNAL(MethodInfo(SIGNAL_PROJECT_ASK_OPEN)); } +ProjectManager *ProjectManager::singleton = nullptr; + void ProjectManager::_notification(int p_what) { switch (p_what) { case NOTIFICATION_TRANSLATION_CHANGED: @@ -1908,10 +1910,8 @@ void ProjectManager::_notification(int p_what) { } } -Map<String, Ref<Texture2D>> ProjectManager::icon_type_cache; - Ref<Texture2D> ProjectManager::_file_dialog_get_icon(const String &p_path) { - return icon_type_cache["ObjectHR"]; + return singleton->icon_type_cache["ObjectHR"]; } void ProjectManager::_build_icon_type_cache(Ref<Theme> p_theme) { @@ -2481,6 +2481,8 @@ void ProjectManager::_version_button_pressed() { } ProjectManager::ProjectManager() { + singleton = this; + // load settings if (!EditorSettings::get_singleton()) { EditorSettings::create(); @@ -2870,6 +2872,7 @@ ProjectManager::ProjectManager() { } ProjectManager::~ProjectManager() { + singleton = nullptr; if (EditorSettings::get_singleton()) { EditorSettings::destroy(); } diff --git a/editor/project_manager.h b/editor/project_manager.h index d3cd929eb7..2965dc7d2e 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -50,8 +50,10 @@ enum FilterOption { class ProjectManager : public Control { GDCLASS(ProjectManager, Control); - static Map<String, Ref<Texture2D>> icon_type_cache; - static void _build_icon_type_cache(Ref<Theme> p_theme); + Map<String, Ref<Texture2D>> icon_type_cache; + void _build_icon_type_cache(Ref<Theme> p_theme); + + static ProjectManager *singleton; TabContainer *tabs; @@ -139,6 +141,8 @@ protected: static void _bind_methods(); public: + static ProjectManager *get_singleton() { return singleton; } + ProjectManager(); ~ProjectManager(); }; diff --git a/main/main.cpp b/main/main.cpp index bfe560fa31..7cbafe37a3 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1212,6 +1212,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // If we didn't find a project, we fall back to the project manager. project_manager = !found_project && !cmdline_tool; } + + if (project_manager) { + Engine::get_singleton()->set_project_manager_hint(true); + } #endif GLOBAL_DEF("debug/file_logging/enable_file_logging", false); @@ -2540,7 +2544,6 @@ bool Main::start() { #ifdef TOOLS_ENABLED if (project_manager) { Engine::get_singleton()->set_editor_hint(true); - Engine::get_singleton()->set_project_manager_hint(true); ProjectManager *pmanager = memnew(ProjectManager); ProgressDialog *progress_dialog = memnew(ProgressDialog); pmanager->add_child(progress_dialog); diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp index 5ea8eaff00..9433f3dba2 100644 --- a/modules/visual_script/editor/visual_script_editor.cpp +++ b/modules/visual_script/editor/visual_script_editor.cpp @@ -1510,6 +1510,7 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt function_name_edit->popup(); function_name_box->set_text(selected); function_name_box->select_all(); + function_name_box->grab_focus(); } } @@ -2098,11 +2099,15 @@ void VisualScriptEditor::_fn_name_box_input(const Ref<InputEvent> &p_event) { Ref<InputEventKey> key = p_event; if (key.is_valid() && key->is_pressed() && key->get_keycode() == Key::ENTER) { function_name_edit->hide(); - _rename_function(selected, function_name_box->get_text()); + _on_fn_name_box_confirmed(); function_name_box->clear(); } } +void VisualScriptEditor::_on_fn_name_box_confirmed() { + _rename_function(selected, function_name_box->get_text()); +} + Variant VisualScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { if (p_from == members) { TreeItem *it = members->get_item_at_position(p_point); @@ -4415,6 +4420,7 @@ void VisualScriptEditor::_member_option(int p_option) { function_name_edit->popup(); function_name_box->set_text(selected); function_name_box->select_all(); + function_name_box->grab_focus(); } } break; case MEMBER_VARIABLE: { @@ -4545,9 +4551,11 @@ VisualScriptEditor::VisualScriptEditor() { member_popup->connect("id_pressed", callable_mp(this, &VisualScriptEditor::_member_option)); function_name_edit = memnew(AcceptDialog); + function_name_edit->set_title(TTR("Rename Function")); function_name_box = memnew(LineEdit); function_name_edit->add_child(function_name_box); function_name_box->connect("gui_input", callable_mp(this, &VisualScriptEditor::_fn_name_box_input)); + function_name_edit->get_ok_button()->connect("pressed", callable_mp(this, &VisualScriptEditor::_on_fn_name_box_confirmed)); function_name_box->set_expand_to_text_length_enabled(true); add_child(function_name_edit); diff --git a/modules/visual_script/editor/visual_script_editor.h b/modules/visual_script/editor/visual_script_editor.h index b01732b2fd..e178f5cf72 100644 --- a/modules/visual_script/editor/visual_script_editor.h +++ b/modules/visual_script/editor/visual_script_editor.h @@ -247,6 +247,7 @@ class VisualScriptEditor : public ScriptEditorBase { void _graph_gui_input(const Ref<InputEvent> &p_event); void _members_gui_input(const Ref<InputEvent> &p_event); void _fn_name_box_input(const Ref<InputEvent> &p_event); + void _on_fn_name_box_confirmed(); void _rename_function(const String &p_name, const String &p_new_name); void _create_function_dialog(); diff --git a/platform/osx/godot_content_view.mm b/platform/osx/godot_content_view.mm index 4e831e1ccc..76d9cfb081 100644 --- a/platform/osx/godot_content_view.mm +++ b/platform/osx/godot_content_view.mm @@ -117,6 +117,10 @@ } } +- (void)doCommandBySelector:(SEL)aSelector { + [self tryToPerform:aSelector with:self]; +} + - (void)unmarkText { ime_input_event_in_progress = false; [[marked_text mutableString] setString:@""]; diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index aa59df6337..943ba8dfb1 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1585,14 +1585,25 @@ void Control::set_anchor_and_offset(Side p_side, real_t p_anchor, real_t p_pos, } void Control::_set_anchors_layout_preset(int p_preset) { - set_meta("_edit_layout_mode", (int)LayoutMode::LAYOUT_MODE_ANCHORS); + bool list_changed = false; + + if (has_meta("_edit_layout_mode") && (int)get_meta("_edit_layout_mode") != (int)LayoutMode::LAYOUT_MODE_ANCHORS) { + list_changed = true; + set_meta("_edit_layout_mode", (int)LayoutMode::LAYOUT_MODE_ANCHORS); + } if (p_preset == -1) { - set_meta("_edit_use_custom_anchors", true); - notify_property_list_changed(); + if (!has_meta("_edit_use_custom_anchors") || !(bool)get_meta("_edit_use_custom_anchors")) { + set_meta("_edit_use_custom_anchors", true); + notify_property_list_changed(); + } return; // Keep settings as is. } - set_meta("_edit_use_custom_anchors", false); + + if (!has_meta("_edit_use_custom_anchors") || (bool)get_meta("_edit_use_custom_anchors")) { + list_changed = true; + set_meta("_edit_use_custom_anchors", false); + } LayoutPreset preset = (LayoutPreset)p_preset; // Set correct anchors. @@ -1625,7 +1636,9 @@ void Control::_set_anchors_layout_preset(int p_preset) { // Select correct grow directions. set_grow_direction_preset(preset); - notify_property_list_changed(); + if (list_changed) { + notify_property_list_changed(); + } } int Control::_get_anchors_layout_preset() const { |