summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-07-19 07:39:32 +0200
committerGitHub <noreply@github.com>2016-07-19 07:39:32 +0200
commit919e9dd358161a4eb65697aaad1e2b03cf08a164 (patch)
tree42df8e2574b293f704bb6a7643cced089f97e968
parent17f86eee33c06b45457eeb2c154592e56fe31959 (diff)
parenteeb8987276a10121cfd0d7762f6d9dca0e9c2d2f (diff)
Merge pull request #5793 from TheHX/issue-5722
Fix Editor Settings dialog range editing by dragging and using the slider
-rw-r--r--tools/editor/settings_config_dialog.cpp15
-rw-r--r--tools/editor/settings_config_dialog.h1
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp
index f436e369af..50989ea5cb 100644
--- a/tools/editor/settings_config_dialog.cpp
+++ b/tools/editor/settings_config_dialog.cpp
@@ -46,9 +46,18 @@ void EditorSettingsDialog::ok_pressed() {
void EditorSettingsDialog::_settings_changed() {
-
timer->start();
- property_editor->get_property_editor()->update_tree(); // else color's won't update when theme is selected.
+}
+
+void EditorSettingsDialog::_settings_property_edited(const String& p_name) {
+
+ String full_name = property_editor->get_full_item_path(p_name);
+
+ // Small usability workaround to update the text color settings when the
+ // color theme is changed
+ if (full_name == "text_editor/color_theme") {
+ property_editor->get_property_editor()->update_tree();
+ }
}
void EditorSettingsDialog::_settings_save() {
@@ -281,6 +290,7 @@ void EditorSettingsDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_settings_save"),&EditorSettingsDialog::_settings_save);
ObjectTypeDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed);
+ ObjectTypeDB::bind_method(_MD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited);
ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box);
ObjectTypeDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box);
ObjectTypeDB::bind_method(_MD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed);
@@ -325,6 +335,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
property_editor->get_property_editor()->register_text_enter(search_box);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbc->add_child(property_editor);
+ property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited");
vbc = memnew( VBoxContainer );
tabs->add_child(vbc);
diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h
index 68a2b008f0..3b91c7f019 100644
--- a/tools/editor/settings_config_dialog.h
+++ b/tools/editor/settings_config_dialog.h
@@ -64,6 +64,7 @@ class EditorSettingsDialog : public AcceptDialog {
virtual void ok_pressed();
void _settings_changed();
+ void _settings_property_edited(const String& p_name);
void _settings_save();
void _notification(int p_what);