From 8e5c40b3641352699497b8b4407144ed4f09c817 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 14:11:34 +0100 Subject: Added completion scroll color --- tools/editor/editor_settings.cpp | 2 ++ tools/editor/plugins/script_editor_plugin.cpp | 1 + tools/editor/plugins/shader_editor_plugin.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 2ce9502293..5b356b438f 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -683,6 +683,7 @@ void EditorSettings::_load_default_text_editor_theme() { set("text_editor/completion_background_color", Color::html("2C2A32")); set("text_editor/completion_selected_color", Color::html("434244")); set("text_editor/completion_existing_color", Color::html("21dfdfdf")); + set("text_editor/completion_scroll_color", Color::html("ffffff")); set("text_editor/caret_color",Color::html("aaaaaa")); set("text_editor/line_number_color",Color::html("66aaaaaa")); set("text_editor/text_color",Color::html("aaaaaa")); @@ -918,6 +919,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) { cf->set_value(theme_section, "completion_background_color", ((Color)get("text_editor/completion_background_color")).to_html()); cf->set_value(theme_section, "completion_selected_color", ((Color)get("text_editor/completion_selected_color")).to_html()); cf->set_value(theme_section, "completion_existing_color", ((Color)get("text_editor/completion_existing_color")).to_html()); + cf->set_value(theme_section, "completion_scroll_color", ((Color)get("text_editor/completion_scroll_color")).to_html()); cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/caret_color")).to_html()); cf->set_value(theme_section, "line_number_color", ((Color)get("text_editor/line_number_color")).to_html()); cf->set_value(theme_section, "text_color", ((Color)get("text_editor/text_color")).to_html()); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 3b095d15f9..602f5ee8e9 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -312,6 +312,7 @@ void ScriptTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0))); get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf"))); + get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff"))); get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0))); get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0))); get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0))); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 864df42b6e..b784bace28 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -81,6 +81,7 @@ void ShaderTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0))); get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf"))); + get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff"))); get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0))); get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0))); get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0))); -- cgit v1.2.3 From a9956be63de69ece580ce819307833b22c3d5993 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 14:25:56 +0100 Subject: Added completion font colors --- scene/gui/text_edit.cpp | 3 ++- scene/gui/text_edit.h | 1 + tools/editor/editor_settings.cpp | 2 ++ tools/editor/plugins/script_editor_plugin.cpp | 1 + tools/editor/plugins/shader_editor_plugin.cpp | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 1315b67ea1..a010fff2bc 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1111,7 +1111,7 @@ void TextEdit::_notification(int p_what) { int l = line_from + i; ERR_CONTINUE( l < 0 || l>= completion_options.size()); - Color text_color = cache.font_color; + Color text_color = cache.completion_font_color; for(int j=0;jset_value(theme_section, "completion_selected_color", ((Color)get("text_editor/completion_selected_color")).to_html()); cf->set_value(theme_section, "completion_existing_color", ((Color)get("text_editor/completion_existing_color")).to_html()); cf->set_value(theme_section, "completion_scroll_color", ((Color)get("text_editor/completion_scroll_color")).to_html()); + cf->set_value(theme_section, "completion_font_color", ((Color)get("text_editor/completion_font_color")).to_html()); cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/caret_color")).to_html()); cf->set_value(theme_section, "line_number_color", ((Color)get("text_editor/line_number_color")).to_html()); cf->set_value(theme_section, "text_color", ((Color)get("text_editor/text_color")).to_html()); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 602f5ee8e9..fc5f552723 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -313,6 +313,7 @@ void ScriptTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf"))); get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff"))); + get_text_edit()->add_color_override("completion_font_color", EDITOR_DEF("text_editor/completion_font_color", Color::html("aaaaaa"))); get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0))); get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0))); get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0))); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index b784bace28..9ef84af260 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -82,6 +82,7 @@ void ShaderTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf"))); get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff"))); + get_text_edit()->add_color_override("completion_font_color", EDITOR_DEF("text_editor/completion_font_color", Color::html("aaaaaa"))); get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0))); get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0))); get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0))); -- cgit v1.2.3 From cc133c9289123e71789e9410f9ed07e2546fa459 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 14:57:32 +0100 Subject: Expose colors to theme --- scene/resources/default_theme/default_theme.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 7ed83f50f8..16a0de1f65 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -473,6 +473,8 @@ void fill_default_theme(Ref& t,const Ref & default_font,const Refset_color("completion_selected_color", "TextEdit",Color::html("434244")); t->set_color("completion_existing_color", "TextEdit",Color::html("21dfdfdf")); t->set_color("completion_scroll_color","TextEdit", control_font_color_pressed ); + t->set_color("completion_scroll_color","TextEdit", Color::html("ffffff")); + t->set_color("completion_font_color","TextEdit", Color::html("aaaaaa")); t->set_color("font_color","TextEdit", control_font_color ); t->set_color("font_color_selected","TextEdit", Color(0,0,0) ); t->set_color("selection_color","TextEdit", font_color_selection ); @@ -482,6 +484,11 @@ void fill_default_theme(Ref& t,const Ref & default_font,const Refset_color("caret_color","TextEdit", control_font_color ); t->set_color("symbol_color","TextEdit", control_font_color_hover ); t->set_color("brace_mismatch_color","TextEdit", Color(1,0.2,0.2) ); + t->set_color("line_number_color","TextEdit",Color::html("66aaaaaa")); + t->set_color("function_color","TextEdit",Color::html("66a2ce")); + t->set_color("member_variable_color","TextEdit",Color::html("e64e59")); + t->set_color("number_color","TextEdit",Color::html("EB9532")); + t->set_color("word_highlighted_color","TextEdit",Color(0.8,0.9,0.9,0.15)); t->set_constant("completion_lines","TextEdit", 7 ); t->set_constant("completion_max_width","TextEdit", 50 ); -- cgit v1.2.3 From 21385d9ecbc74425a599f8a5953bd2ec7fdd1b68 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 15:11:35 +0100 Subject: Expose show line numbers --- scene/gui/text_edit.cpp | 11 ++++++++++- scene/gui/text_edit.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a010fff2bc..ebf11b7684 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4319,6 +4319,10 @@ void TextEdit::set_show_line_numbers(bool p_show) { update(); } +bool TextEdit::is_show_line_numbers_enabled() const { + return line_numbers; +} + void TextEdit::set_draw_breakpoint_gutter(bool p_draw) { draw_breakpoint_gutter = p_draw; update(); @@ -4433,6 +4437,9 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("redo"),&TextEdit::redo); ObjectTypeDB::bind_method(_MD("clear_undo_history"),&TextEdit::clear_undo_history); + ObjectTypeDB::bind_method(_MD("set_show_line_numbers", "enable"), &TextEdit::set_show_line_numbers); + ObjectTypeDB::bind_method(_MD("is_show_line_numbers_enabled"), &TextEdit::is_show_line_numbers_enabled); + ObjectTypeDB::bind_method(_MD("set_syntax_coloring","enable"),&TextEdit::set_syntax_coloring); ObjectTypeDB::bind_method(_MD("is_syntax_coloring_enabled"),&TextEdit::is_syntax_coloring_enabled); @@ -4445,7 +4452,9 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("menu_option"),&TextEdit::menu_option); ObjectTypeDB::bind_method(_MD("get_menu:PopupMenu"),&TextEdit::get_menu); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled"));; + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), _SCS("set_show_line_numbers"), _SCS("is_show_line_numbers_enabled")); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled")); ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); ADD_SIGNAL(MethodInfo("cursor_changed")); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index fe977eba60..55612a5e27 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -469,6 +469,7 @@ public: void menu_option(int p_option); void set_show_line_numbers(bool p_show); + bool is_show_line_numbers_enabled() const; void set_draw_breakpoint_gutter(bool p_draw); bool is_drawing_breakpoint_gutter() const; -- cgit v1.2.3 From 28356a7d63b324bbd4b202434e1a2b8ac40aeb3f Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 15:20:01 +0100 Subject: Expose highlight all occurrences --- scene/gui/text_edit.cpp | 8 ++++++++ scene/gui/text_edit.h | 1 + 2 files changed, 9 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ebf11b7684..a680d5d873 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3610,6 +3610,10 @@ void TextEdit::set_highlight_all_occurrences(const bool p_enabled) { update(); } +bool TextEdit::is_highlight_all_occurrences_enabled() const { + return highlight_all_occurrences; +} + int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_search, uint32_t p_search_flags, int p_from_column) { int col = -1; @@ -4440,6 +4444,9 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_show_line_numbers", "enable"), &TextEdit::set_show_line_numbers); ObjectTypeDB::bind_method(_MD("is_show_line_numbers_enabled"), &TextEdit::is_show_line_numbers_enabled); + ObjectTypeDB::bind_method(_MD("set_highlight_all_occurrences", "enable"), &TextEdit::set_highlight_all_occurrences); + ObjectTypeDB::bind_method(_MD("is_highlight_all_occurrences_enabled"), &TextEdit::is_highlight_all_occurrences_enabled); + ObjectTypeDB::bind_method(_MD("set_syntax_coloring","enable"),&TextEdit::set_syntax_coloring); ObjectTypeDB::bind_method(_MD("is_syntax_coloring_enabled"),&TextEdit::is_syntax_coloring_enabled); @@ -4453,6 +4460,7 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_menu:PopupMenu"),&TextEdit::get_menu); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), _SCS("set_show_line_numbers"), _SCS("is_show_line_numbers_enabled")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_all_occurrences"), _SCS("set_highlight_all_occurrences"), _SCS("is_highlight_all_occurrences_enabled")); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled")); ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 55612a5e27..270a1723b1 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -428,6 +428,7 @@ public: void set_current_search_result(int line, int col); void set_highlight_all_occurrences(const bool p_enabled); + bool is_highlight_all_occurrences_enabled() const; bool is_selection_active() const; int get_selection_from_line() const; int get_selection_from_column() const; -- cgit v1.2.3 From a57c1da183c22ec6fb71fe550a6049296d63be3e Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 15:39:46 +0100 Subject: Update textedit docs with colors, show line number and highlight all occurences --- doc/base/classes.xml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 91c768ef42..ae5438c430 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -39408,6 +39408,34 @@ Set the color for symbols. + + + + + Set to enable showing line numbers. + + + + + + + Returns true if line numbers are enabled. + + + + + + + Set to enable highlighting all occurrences of the current selection. + + + + + + + Returns true if highlight all occurrences is enabled. + + @@ -39489,6 +39517,8 @@ + + @@ -39509,18 +39539,28 @@ + + + + + + + + + + -- cgit v1.2.3 From 12e3bb1f0147c17c4269977949386fca19532300 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 15:40:04 +0100 Subject: Removed duplicate color --- scene/resources/default_theme/default_theme.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 16a0de1f65..182bc5dabc 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -473,7 +473,6 @@ void fill_default_theme(Ref& t,const Ref & default_font,const Refset_color("completion_selected_color", "TextEdit",Color::html("434244")); t->set_color("completion_existing_color", "TextEdit",Color::html("21dfdfdf")); t->set_color("completion_scroll_color","TextEdit", control_font_color_pressed ); - t->set_color("completion_scroll_color","TextEdit", Color::html("ffffff")); t->set_color("completion_font_color","TextEdit", Color::html("aaaaaa")); t->set_color("font_color","TextEdit", control_font_color ); t->set_color("font_color_selected","TextEdit", Color(0,0,0) ); -- cgit v1.2.3