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.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index c461bf0410..ffd5716364 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-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 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 */
@@ -30,8 +30,8 @@
#include "settings_config_dialog.h"
+#include "core/config/project_settings.h"
#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"
@@ -143,7 +143,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
if (k.is_valid() && k->is_pressed()) {
bool handled = false;
- if (ED_IS_SHORTCUT("editor/undo", p_event)) {
+ if (ED_IS_SHORTCUT("ui_undo", p_event)) {
String action = undo_redo->get_current_action_name();
if (action != "") {
EditorNode::get_log()->add_message("Undo: " + action, EditorLog::MSG_TYPE_EDITOR);
@@ -152,7 +152,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
handled = true;
}
- if (ED_IS_SHORTCUT("editor/redo", p_event)) {
+ if (ED_IS_SHORTCUT("ui_redo", p_event)) {
undo_redo->redo();
String action = undo_redo->get_current_action_name();
if (action != "") {
@@ -202,7 +202,7 @@ void EditorSettingsDialog::_update_shortcuts() {
Map<String, TreeItem *> sections;
for (List<String>::Element *E = slist.front(); E; E = E->next()) {
- Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(E->get());
+ Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(E->get());
if (!sc->has_meta("original")) {
continue;
}
@@ -268,15 +268,15 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
ERR_FAIL_COND(!ti);
String item = ti->get_metadata(0);
- Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(item);
+ Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(item);
if (p_idx == 0) {
press_a_key_label->set_text(TTR("Press a Key..."));
last_wait_for_key = Ref<InputEventKey>();
press_a_key->popup_centered(Size2(250, 80) * EDSCALE);
//press_a_key->grab_focus();
- press_a_key->get_ok()->set_focus_mode(Control::FOCUS_NONE);
- press_a_key->get_cancel()->set_focus_mode(Control::FOCUS_NONE);
+ press_a_key->get_ok_button()->set_focus_mode(Control::FOCUS_NONE);
+ press_a_key->get_cancel_button()->set_focus_mode(Control::FOCUS_NONE);
shortcut_configured = item;
} else if (p_idx == 1) { //erase
@@ -335,7 +335,7 @@ void EditorSettingsDialog::_press_a_key_confirm() {
ie->set_alt(last_wait_for_key->get_alt());
ie->set_metakey(last_wait_for_key->get_metakey());
- Ref<ShortCut> sc = EditorSettings::get_singleton()->get_shortcut(shortcut_configured);
+ Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(shortcut_configured);
undo_redo->create_action(TTR("Change Shortcut") + " '" + shortcut_configured + "'");
undo_redo->add_do_method(sc.ptr(), "set_shortcut", ie);
@@ -405,6 +405,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
tab_general->add_child(hbc);
search_box = memnew(LineEdit);
+ search_box->set_placeholder(TTR("Search"));
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(search_box);
@@ -432,7 +433,8 @@ EditorSettingsDialog::EditorSettingsDialog() {
restart_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart));
restart_hb->add_child(restart_button);
restart_button->set_text(TTR("Save & Restart"));
- restart_close_button = memnew(ToolButton);
+ restart_close_button = memnew(Button);
+ restart_close_button->set_flat(true);
restart_close_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart_close));
restart_hb->add_child(restart_close_button);
restart_container->hide();
@@ -448,6 +450,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
tab_shortcuts->add_child(hbc);
shortcut_search_box = memnew(LineEdit);
+ shortcut_search_box->set_placeholder(TTR("Search"));
shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->add_child(shortcut_search_box);
shortcut_search_box->connect("text_changed", callable_mp(this, &EditorSettingsDialog::_filter_shortcuts));
@@ -468,10 +471,10 @@ EditorSettingsDialog::EditorSettingsDialog() {
Label *l = memnew(Label);
l->set_text(TTR("Press a Key..."));
- l->set_anchors_and_margins_preset(Control::PRESET_WIDE);
+ l->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
l->set_align(Label::ALIGN_CENTER);
- l->set_margin(MARGIN_TOP, 20);
- l->set_anchor_and_margin(MARGIN_BOTTOM, Control::ANCHOR_BEGIN, 30);
+ l->set_offset(SIDE_TOP, 20);
+ l->set_anchor_and_offset(SIDE_BOTTOM, Control::ANCHOR_BEGIN, 30);
press_a_key_label = l;
press_a_key->add_child(l);
press_a_key->connect("window_input", callable_mp(this, &EditorSettingsDialog::_wait_for_key));
@@ -485,7 +488,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
timer->set_one_shot(true);
add_child(timer);
EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &EditorSettingsDialog::_settings_changed));
- get_ok()->set_text(TTR("Close"));
+ get_ok_button()->set_text(TTR("Close"));
updating = false;
}