1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Fix Editor Settings dialog range editing by dragging and using the slider

This commit is contained in:
Franklin Sobrinho
2016-07-18 18:46:16 -03:00
parent c328693e83
commit eeb8987276
2 changed files with 14 additions and 2 deletions

View File

@@ -46,9 +46,18 @@ void EditorSettingsDialog::ok_pressed() {
void EditorSettingsDialog::_settings_changed() { void EditorSettingsDialog::_settings_changed() {
timer->start(); 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() { 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_save"),&EditorSettingsDialog::_settings_save);
ObjectTypeDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed); 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_search_box"),&EditorSettingsDialog::_clear_search_box);
ObjectTypeDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_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); 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->get_property_editor()->register_text_enter(search_box);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbc->add_child(property_editor); vbc->add_child(property_editor);
property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited");
vbc = memnew( VBoxContainer ); vbc = memnew( VBoxContainer );
tabs->add_child(vbc); tabs->add_child(vbc);

View File

@@ -64,6 +64,7 @@ class EditorSettingsDialog : public AcceptDialog {
virtual void ok_pressed(); virtual void ok_pressed();
void _settings_changed(); void _settings_changed();
void _settings_property_edited(const String& p_name);
void _settings_save(); void _settings_save();
void _notification(int p_what); void _notification(int p_what);