diff options
Diffstat (limited to 'editor/script_create_dialog.cpp')
-rw-r--r-- | editor/script_create_dialog.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 2098fa2c85..eda5801905 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -378,7 +378,7 @@ void ScriptCreateDialog::_language_changed(int l) { String path = file_path->get_text(); String extension = ""; if (!path.is_empty()) { - if (path.find(".") != -1) { + if (path.contains(".")) { extension = path.get_extension(); } @@ -656,14 +656,18 @@ void ScriptCreateDialog::_update_dialog() { if (is_new_script_created) { class_name->set_editable(true); class_name->set_placeholder(TTR("Allowed: a-z, A-Z, 0-9, _ and .")); - class_name->set_placeholder_alpha(0.3); + Color placeholder_color = class_name->get_theme_color("font_placeholder_color"); + placeholder_color.a = 0.3; + class_name->add_theme_color_override("font_placeholder_color", placeholder_color); } else { class_name->set_editable(false); } } else { class_name->set_editable(false); class_name->set_placeholder(TTR("N/A")); - class_name->set_placeholder_alpha(1); + Color placeholder_color = class_name->get_theme_color("font_placeholder_color"); + placeholder_color.a = 1; + class_name->add_theme_color_override("font_placeholder_color", placeholder_color); class_name->set_text(""); } @@ -807,7 +811,7 @@ ScriptLanguage::ScriptTemplate ScriptCreateDialog::_parse_template(const ScriptL List<String> comment_delimiters; language->get_comment_delimiters(&comment_delimiters); for (const String &script_delimiter : comment_delimiters) { - if (script_delimiter.find(" ") == -1) { + if (!script_delimiter.contains(" ")) { meta_delimiter = script_delimiter; break; } |