summaryrefslogtreecommitdiff
path: root/editor/settings_config_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/settings_config_dialog.cpp')
-rw-r--r--editor/settings_config_dialog.cpp46
1 files changed, 28 insertions, 18 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index a38c6b98cc..9f8a531762 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -32,11 +32,13 @@
#include "core/os/keyboard.h"
#include "core/project_settings.h"
+#include "editor/debugger/editor_debugger_node.h"
#include "editor_file_system.h"
+#include "editor_log.h"
#include "editor_node.h"
+#include "editor_scale.h"
#include "editor_settings.h"
#include "scene/gui/margin_container.h"
-#include "script_editor_debugger.h"
void EditorSettingsDialog::ok_pressed() {
@@ -117,9 +119,8 @@ void EditorSettingsDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
- ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- undo_redo->set_method_notify_callback(sed->_method_changeds, sed);
- undo_redo->set_property_notify_callback(sed->_property_changeds, sed);
+ undo_redo->set_method_notify_callback(EditorDebuggerNode::_method_changeds, NULL);
+ undo_redo->set_property_notify_callback(EditorDebuggerNode::_property_changeds, NULL);
undo_redo->set_commit_notify_callback(_undo_redo_callback, this);
} break;
case NOTIFICATION_ENTER_TREE: {
@@ -233,14 +234,23 @@ void EditorSettingsDialog::_update_shortcuts() {
section->set_custom_bg_color(1, get_color("prop_subsection", "Editor"));
}
- if (shortcut_filter.is_subsequence_ofi(sc->get_name()) || shortcut_filter.is_subsequence_ofi(sc->get_as_text())) {
+ // Don't match unassigned shortcuts when searching for assigned keys in search results.
+ // This prevents all unassigned shortcuts from appearing when searching a string like "no".
+ if (shortcut_filter.is_subsequence_ofi(sc->get_name()) || (sc->get_as_text() != "None" && shortcut_filter.is_subsequence_ofi(sc->get_as_text()))) {
TreeItem *item = shortcuts->create_item(section);
item->set_text(0, sc->get_name());
item->set_text(1, sc->get_as_text());
+
if (!sc->is_shortcut(original) && !(sc->get_shortcut().is_null() && original.is_null())) {
item->add_button(1, get_icon("Reload", "EditorIcons"), 2);
}
+
+ if (sc->get_as_text() == "None") {
+ // Fade out unassigned shortcut labels for easier visual grepping.
+ item->set_custom_color(1, get_color("font_color", "Label") * Color(1, 1, 1, 0.5));
+ }
+
item->add_button(1, get_icon("Edit", "EditorIcons"), 0);
item->add_button(1, get_icon("Close", "EditorIcons"), 1);
item->set_tooltip(0, E->get());
@@ -401,7 +411,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
tabs = memnew(TabContainer);
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
- tabs->connect("tab_changed", this, "_tabs_tab_changed");
+ tabs->connect_compat("tab_changed", this, "_tabs_tab_changed");
add_child(tabs);
// General Tab
@@ -424,8 +434,8 @@ EditorSettingsDialog::EditorSettingsDialog() {
inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL);
inspector->get_inspector()->set_undo_redo(undo_redo);
tab_general->add_child(inspector);
- inspector->get_inspector()->connect("property_edited", this, "_settings_property_edited");
- inspector->get_inspector()->connect("restart_requested", this, "_editor_restart_request");
+ inspector->get_inspector()->connect_compat("property_edited", this, "_settings_property_edited");
+ inspector->get_inspector()->connect_compat("restart_requested", this, "_editor_restart_request");
restart_container = memnew(PanelContainer);
tab_general->add_child(restart_container);
@@ -439,11 +449,11 @@ EditorSettingsDialog::EditorSettingsDialog() {
restart_hb->add_child(restart_label);
restart_hb->add_spacer();
Button *restart_button = memnew(Button);
- restart_button->connect("pressed", this, "_editor_restart");
+ restart_button->connect_compat("pressed", this, "_editor_restart");
restart_hb->add_child(restart_button);
restart_button->set_text(TTR("Save & Restart"));
restart_close_button = memnew(ToolButton);
- restart_close_button->connect("pressed", this, "_editor_restart_close");
+ restart_close_button->connect_compat("pressed", this, "_editor_restart_close");
restart_hb->add_child(restart_close_button);
restart_container->hide();
@@ -460,7 +470,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
shortcut_search_box = memnew(LineEdit);
shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(shortcut_search_box);
- shortcut_search_box->connect("text_changed", this, "_filter_shortcuts");
+ shortcut_search_box->connect_compat("text_changed", this, "_filter_shortcuts");
shortcuts = memnew(Tree);
tab_shortcuts->add_child(shortcuts, true);
@@ -470,7 +480,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
shortcuts->set_column_titles_visible(true);
shortcuts->set_column_title(0, TTR("Name"));
shortcuts->set_column_title(1, TTR("Binding"));
- shortcuts->connect("button_pressed", this, "_shortcut_button_pressed");
+ shortcuts->connect_compat("button_pressed", this, "_shortcut_button_pressed");
press_a_key = memnew(ConfirmationDialog);
press_a_key->set_focus_mode(FOCUS_ALL);
@@ -484,17 +494,17 @@ EditorSettingsDialog::EditorSettingsDialog() {
l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30);
press_a_key_label = l;
press_a_key->add_child(l);
- press_a_key->connect("gui_input", this, "_wait_for_key");
- press_a_key->connect("confirmed", this, "_press_a_key_confirm");
+ press_a_key->connect_compat("gui_input", this, "_wait_for_key");
+ press_a_key->connect_compat("confirmed", this, "_press_a_key_confirm");
set_hide_on_ok(true);
timer = memnew(Timer);
timer->set_wait_time(1.5);
- timer->connect("timeout", this, "_settings_save");
+ timer->connect_compat("timeout", this, "_settings_save");
timer->set_one_shot(true);
add_child(timer);
- EditorSettings::get_singleton()->connect("settings_changed", this, "_settings_changed");
+ EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_settings_changed");
get_ok()->set_text(TTR("Close"));
updating = false;