summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/CanvasItem.xml22
-rw-r--r--doc/classes/CanvasItemMaterial.xml12
-rw-r--r--doc/classes/CanvasLayer.xml2
-rw-r--r--doc/classes/ClassDB.xml1
-rw-r--r--doc/classes/CollisionObject.xml5
-rw-r--r--doc/classes/CollisionObject2D.xml6
-rw-r--r--doc/classes/RayCast.xml5
-rw-r--r--editor/editor_settings.cpp2
-rw-r--r--editor/editor_themes.cpp2
-rw-r--r--editor/plugins/script_text_editor.cpp6
-rw-r--r--editor/plugins/shader_editor_plugin.cpp3
-rw-r--r--scene/gui/text_edit.cpp18
-rw-r--r--scene/gui/text_edit.h1
-rw-r--r--scene/resources/default_theme/default_theme.cpp1
14 files changed, 73 insertions, 13 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index d1524074fd..4a567981e6 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -119,6 +119,7 @@
<argument index="3" name="antialiased" type="bool" default="false">
</argument>
<description>
+ Draw a polyline with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing.
</description>
</method>
<method name="draw_polyline_colors">
@@ -133,6 +134,7 @@
<argument index="3" name="antialiased" type="bool" default="false">
</argument>
<description>
+ Draw a polyline with a uniform [code]width[/code], segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
</description>
</method>
<method name="draw_primitive">
@@ -177,7 +179,7 @@
<argument index="2" name="scale" type="Vector2">
</argument>
<description>
- Set a custom transform for drawing. Anything drawn afterwards will be transformed by this.
+ Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this.
</description>
</method>
<method name="draw_set_transform_matrix">
@@ -186,6 +188,7 @@
<argument index="0" name="xform" type="Transform2D">
</argument>
<description>
+ Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this.
</description>
</method>
<method name="draw_string">
@@ -359,6 +362,7 @@
<return type="bool">
</return>
<description>
+ Returns [code]true[/code] if local transform notifications are communicated to children.
</description>
</method>
<method name="is_set_as_toplevel" qualifiers="const">
@@ -372,12 +376,14 @@
<return type="bool">
</return>
<description>
+ Returns [code]true[/code] if global transform notifications are communicated to children.
</description>
</method>
<method name="is_visible_in_tree" qualifiers="const">
<return type="bool">
</return>
<description>
+ Returns [code]true[/code] if the node is in the [SceneTree] and is visible on-screen.
</description>
</method>
<method name="make_canvas_position_local" qualifiers="const">
@@ -386,6 +392,7 @@
<argument index="0" name="screen_point" type="Vector2">
</argument>
<description>
+ Assigns [code]screen_point[/code] as this node's new local transform.
</description>
</method>
<method name="make_input_local" qualifiers="const">
@@ -394,6 +401,7 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
+ Transformations issued by [code]event[/code]'s inputs are applied in local space instead of global space.
</description>
</method>
<method name="set_as_toplevel">
@@ -402,7 +410,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Set as top level. This means that it will not inherit transform from parent canvas items.
+ Sets as top level. This means that it will not inherit transform from parent canvas items.
</description>
</method>
<method name="set_notify_local_transform">
@@ -411,6 +419,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
+ If [code]enable[/code] is [code]true[/code], children will be updated with local transform data.
</description>
</method>
<method name="set_notify_transform">
@@ -419,6 +428,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
+ If [code]enable[/code] is [code]true[/code], children will be updated with global transform data.
</description>
</method>
<method name="show">
@@ -438,20 +448,28 @@
</methods>
<members>
<member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask">
+ The rendering layers in which this [code]CanvasItem[/code] responds to [Light2D] nodes. Default value: [code]1[/code].
</member>
<member name="material" type="Material" setter="set_material" getter="get_material">
+ The material applied to textures on this [code]CanvasItem[/code]. Default value: [code]null[/code].
</member>
<member name="modulate" type="Color" setter="set_modulate" getter="get_modulate">
+ The color applied to textures on this [code]CanvasItem[/code]. Default value: [code]Color(1, 1, 1, 1)[/code] (opaque "white").
</member>
<member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate">
+ The color applied to textures on this [code]CanvasItem[/code]. This is not inherited by children [code]CanvasItem[/code]s. Default value: [code]Color(1, 1, 1, 1)[/code] (opaque "white")..
</member>
<member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled">
+ If [code]true[/code] the object draws behind its parent. Default value: [code]false[/code].
</member>
<member name="show_on_top" type="bool" setter="_set_on_top" getter="_is_on_top">
+ If [code]true[/code] the object draws on top of its parent. Default value: [code]true[/code].
</member>
<member name="use_parent_material" type="bool" setter="set_use_parent_material" getter="get_use_parent_material">
+ If [code]true[/code] the parent [code]CanvasItem[/code]'s [member material] property is used as this one's material. Default value: [code]false[/code].
</member>
<member name="visible" type="bool" setter="set_visible" getter="is_visible">
+ If [code]true[/code] this [code]CanvasItem[/code] is drawn. Default value: [code]true[/code].
</member>
</members>
<signals>
diff --git a/doc/classes/CanvasItemMaterial.xml b/doc/classes/CanvasItemMaterial.xml
index b30261d5bf..81709227ad 100644
--- a/doc/classes/CanvasItemMaterial.xml
+++ b/doc/classes/CanvasItemMaterial.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CanvasItemMaterial" inherits="Material" category="Core" version="3.0-beta">
<brief_description>
+ A material for [CanvasItem]s.
</brief_description>
<description>
+ [code]CanvasItemMaterial[/code]s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a [ShaderMaterial] to more fully customize a material's interactions with a [CanvasItem].
</description>
<tutorials>
</tutorials>
@@ -12,26 +14,36 @@
</methods>
<members>
<member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="CanvasItemMaterial.BlendMode">
+ The manner in which a material's rendering is applied to underlying textures.
</member>
<member name="light_mode" type="int" setter="set_light_mode" getter="get_light_mode" enum="CanvasItemMaterial.LightMode">
+ The manner in which material reacts to lighting.
</member>
</members>
<constants>
<constant name="BLEND_MODE_MIX" value="0" enum="BlendMode">
+ Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value.
</constant>
<constant name="BLEND_MODE_ADD" value="1" enum="BlendMode">
+ Additive blending mode.
</constant>
<constant name="BLEND_MODE_SUB" value="2" enum="BlendMode">
+ Subtractive blending mode.
</constant>
<constant name="BLEND_MODE_MUL" value="3" enum="BlendMode">
+ Multiplicative blending mode.
</constant>
<constant name="BLEND_MODE_PREMULT_ALPHA" value="4" enum="BlendMode">
+ Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value.
</constant>
<constant name="LIGHT_MODE_NORMAL" value="0" enum="LightMode">
+ Render the material using both light and non-light sensitive material properties.
</constant>
<constant name="LIGHT_MODE_UNSHADED" value="1" enum="LightMode">
+ Render the material as if there were no light.
</constant>
<constant name="LIGHT_MODE_LIGHT_ONLY" value="2" enum="LightMode">
+ Render the material as if there were only light.
</constant>
</constants>
</class>
diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml
index 86b788bb44..01c2dd6ba9 100644
--- a/doc/classes/CanvasLayer.xml
+++ b/doc/classes/CanvasLayer.xml
@@ -15,6 +15,7 @@
<return type="Node">
</return>
<description>
+ Returns the [Viewport] used by the camera if it is not using the default viewport.
</description>
</method>
<method name="get_rotation" qualifiers="const">
@@ -44,6 +45,7 @@
<argument index="0" name="viewport" type="Node">
</argument>
<description>
+ Assigns a custom [Viewport] node to the [code]CanvasLayer[/code]. If [code]viewport[/code] is not a [Viewport], it re-assigns the default viewport instead.
</description>
</method>
<method name="set_rotation">
diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml
index 37e85d033b..b4d4d0b448 100644
--- a/doc/classes/ClassDB.xml
+++ b/doc/classes/ClassDB.xml
@@ -35,6 +35,7 @@
<argument index="0" name="class" type="String">
</argument>
<description>
+ Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required.
</description>
</method>
<method name="class_get_integer_constant" qualifiers="const">
diff --git a/doc/classes/CollisionObject.xml b/doc/classes/CollisionObject.xml
index 82f65b6d11..5d0984bcdf 100644
--- a/doc/classes/CollisionObject.xml
+++ b/doc/classes/CollisionObject.xml
@@ -25,6 +25,7 @@
<argument index="4" name="shape_idx" type="int">
</argument>
<description>
+ Accepts unhandled [InputEvent]s. [code]click_position[/code] is the clicked location in world space and [code]click_normal[/code] is the normal vector extending from the clicked surface of the [Shape] at [code]shape_idx[/code]. Connect to the [code]input_event[/code] signal to easily pick up these events.
</description>
</method>
<method name="create_shape_owner">
@@ -134,6 +135,7 @@
<argument index="1" name="shape_id" type="int">
</argument>
<description>
+ Returns the child index of the [Shape] with the given id from the given shape owner.
</description>
</method>
<method name="shape_owner_get_transform" qualifiers="const">
@@ -181,8 +183,10 @@
</methods>
<members>
<member name="input_capture_on_drag" type="bool" setter="set_capture_input_on_drag" getter="get_capture_input_on_drag">
+ If [code]true[/code] the [code]CollisionObject[/code] will continue to receive input events as the mouse is dragged across its shapes. Default value: [code]false[/code].
</member>
<member name="input_ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable">
+ If [code]true[/code] the [CollisionObject]'s shapes will respond to [RayCast]s. Default value: [code]true[/code].
</member>
</members>
<signals>
@@ -198,6 +202,7 @@
<argument index="4" name="shape_idx" type="int">
</argument>
<description>
+ Emitted when [method _input_event] receives an event. See its description for details.
</description>
</signal>
<signal name="mouse_entered">
diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml
index ffc79d359d..086513cad5 100644
--- a/doc/classes/CollisionObject2D.xml
+++ b/doc/classes/CollisionObject2D.xml
@@ -21,6 +21,7 @@
<argument index="2" name="shape_idx" type="int">
</argument>
<description>
+ Accepts unhandled [InputEvent]s. [code]shape_idx[/code] is the child index of the clicked [Shape2D]. Connect to the [code]input_event[/code] signal to easily pick up these events.
</description>
</method>
<method name="create_shape_owner">
@@ -61,6 +62,7 @@
<argument index="0" name="owner_id" type="int">
</argument>
<description>
+ Returns [code]true[/code] if collisions for the shape owner originating from this [code]CollisionObject2D[/code] will not be reported to collided with [code]CollisionObject2D[/code]s.
</description>
</method>
<method name="remove_shape_owner">
@@ -138,6 +140,7 @@
<argument index="1" name="shape_id" type="int">
</argument>
<description>
+ Returns the child index of the [Shape2D] with the given id from the given shape owner.
</description>
</method>
<method name="shape_owner_get_transform" qualifiers="const">
@@ -179,6 +182,7 @@
<argument index="1" name="enable" type="bool">
</argument>
<description>
+ If [code]enable[/code] is [code]true[/code], collisions for the shape owner originating from this [code]CollisionObject2D[/code] will not be reported to collided with [code]CollisionObject2D[/code]s.
</description>
</method>
<method name="shape_owner_set_transform">
@@ -207,7 +211,7 @@
<argument index="2" name="shape_idx" type="int">
</argument>
<description>
- Emitted when an input event occurs and [code]input_pickable[/code] is [code]true[/code].
+ Emitted when an input event occurs and [code]input_pickable[/code] is [code]true[/code]. See [method _input_event] for details.
</description>
</signal>
<signal name="mouse_entered">
diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml
index e6f3c029af..20e262b664 100644
--- a/doc/classes/RayCast.xml
+++ b/doc/classes/RayCast.xml
@@ -77,6 +77,7 @@
<argument index="0" name="bit" type="int">
</argument>
<description>
+ Returns [code]true[/code] if the bit index passed is turned on. Note that bit indexes range from 0-19.
</description>
</method>
<method name="get_collision_normal" qualifiers="const">
@@ -126,6 +127,7 @@
<argument index="1" name="value" type="bool">
</argument>
<description>
+ Sets the bit index passed to the [code]value[/code] passed. Note that bit indexes range from 0-19.
</description>
</method>
</methods>
@@ -137,9 +139,10 @@
The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected.
</member>
<member name="enabled" type="bool" setter="set_enabled" getter="is_enabled">
- If [code]true[/code], collisions will be reported. Default value: [code]false[/code].
+ If [code]true[/code] collisions will be reported. Default value: [code]false[/code].
</member>
<member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body">
+ If [code]true[/code] collisions will be ignored for this RayCast's immediate parent. Default value: [code]true[/code].
</member>
</members>
<constants>
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 2f73e459ed..04e09abcea 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -543,6 +543,7 @@ void EditorSettings::_load_default_text_editor_theme() {
_initial_set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1));
_initial_set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4));
_initial_set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2));
+ _initial_set("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8));
_initial_set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15));
_initial_set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1));
_initial_set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1));
@@ -577,6 +578,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
cf->set_value(theme_section, "line_length_guideline_color", ((Color)get("text_editor/highlighting/line_length_guideline_color")).to_html());
cf->set_value(theme_section, "mark_color", ((Color)get("text_editor/highlighting/mark_color")).to_html());
cf->set_value(theme_section, "breakpoint_color", ((Color)get("text_editor/highlighting/breakpoint_color")).to_html());
+ cf->set_value(theme_section, "code_folding_color", ((Color)get("text_editor/highlighting/code_folding_color")).to_html());
cf->set_value(theme_section, "word_highlighted_color", ((Color)get("text_editor/highlighting/word_highlighted_color")).to_html());
cf->set_value(theme_section, "search_result_color", ((Color)get("text_editor/highlighting/search_result_color")).to_html());
cf->set_value(theme_section, "search_result_border_color", ((Color)get("text_editor/highlighting/search_result_border_color")).to_html());
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 23c32a5793..4661fcf668 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -1039,6 +1039,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color member_variable_color = mono_color;
const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3);
const Color breakpoint_color = error_color;
+ const Color code_folding_color = alpha4;
const Color search_result_color = alpha1;
const Color search_result_border_color = alpha4;
@@ -1069,6 +1070,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("text_editor/theme/member_variable_color", "Editor", member_variable_color);
theme->set_color("text_editor/theme/mark_color", "Editor", mark_color);
theme->set_color("text_editor/theme/breakpoint_color", "Editor", breakpoint_color);
+ theme->set_color("text_editor/theme/code_folding_color", "Editor", code_folding_color);
theme->set_color("text_editor/theme/search_result_color", "Editor", search_result_color);
theme->set_color("text_editor/theme/search_result_border_color", "Editor", search_result_border_color);
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 3c5bc7ac33..6a869aaadb 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -96,10 +96,10 @@ void ScriptTextEditor::_load_theme_settings() {
Color member_variable_color = EDITOR_DEF("text_editor/highlighting/member_variable_color", Color(0.9, 0.3, 0.3));
Color mark_color = EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4));
Color breakpoint_color = EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2));
+ Color code_folding_color = EDITOR_DEF("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8));
Color search_result_color = EDITOR_DEF("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1));
Color search_result_border_color = EDITOR_DEF("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1));
Color symbol_color = EDITOR_DEF("text_editor/highlighting/symbol_color", Color::hex(0x005291ff));
-
Color keyword_color = EDITOR_DEF("text_editor/highlighting/keyword_color", Color(0.5, 0.0, 0.2));
Color basetype_color = EDITOR_DEF("text_editor/highlighting/base_type_color", Color(0.3, 0.3, 0.0));
Color type_color = EDITOR_DEF("text_editor/highlighting/engine_type_color", Color(0.0, 0.2, 0.4));
@@ -137,6 +137,7 @@ void ScriptTextEditor::_load_theme_settings() {
member_variable_color = tm->get_color("text_editor/theme/member_variable_color", "Editor");
mark_color = tm->get_color("text_editor/theme/mark_color", "Editor");
breakpoint_color = tm->get_color("text_editor/theme/breakpoint_color", "Editor");
+ code_folding_color = tm->get_color("text_editor/theme/code_folding_color", "Editor");
search_result_color = tm->get_color("text_editor/theme/search_result_color", "Editor");
search_result_border_color = tm->get_color("text_editor/theme/search_result_border_color", "Editor");
}
@@ -160,8 +161,9 @@ void ScriptTextEditor::_load_theme_settings() {
text_edit->add_color_override("number_color", number_color);
text_edit->add_color_override("function_color", function_color);
text_edit->add_color_override("member_variable_color", member_variable_color);
- text_edit->add_color_override("mark_color", mark_color);
text_edit->add_color_override("breakpoint_color", breakpoint_color);
+ text_edit->add_color_override("mark_color", mark_color);
+ text_edit->add_color_override("code_folding_color", code_folding_color);
text_edit->add_color_override("search_result_color", search_result_color);
text_edit->add_color_override("search_result_border_color", search_result_border_color);
text_edit->add_color_override("symbol_color", symbol_color);
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 49e4642049..b390070b4a 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -81,6 +81,7 @@ void ShaderTextEditor::_load_theme_settings() {
Color member_variable_color = EDITOR_DEF("text_editor/highlighting/member_variable_color", Color(0.9, 0.3, 0.3));
Color mark_color = EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4));
Color breakpoint_color = EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2));
+ Color code_folding_color = EDITOR_DEF("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8));
Color search_result_color = EDITOR_DEF("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1));
Color search_result_border_color = EDITOR_DEF("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1));
Color symbol_color = EDITOR_DEF("text_editor/highlighting/symbol_color", Color::hex(0x005291ff));
@@ -122,6 +123,7 @@ void ShaderTextEditor::_load_theme_settings() {
member_variable_color = tm->get_color("text_editor/theme/member_variable_color", "Editor");
mark_color = tm->get_color("text_editor/theme/mark_color", "Editor");
breakpoint_color = tm->get_color("text_editor/theme/breakpoint_color", "Editor");
+ code_folding_color = tm->get_color("text_editor/theme/code_folding_color", "Editor");
search_result_color = tm->get_color("text_editor/theme/search_result_color", "Editor");
search_result_border_color = tm->get_color("text_editor/theme/search_result_border_color", "Editor");
}
@@ -147,6 +149,7 @@ void ShaderTextEditor::_load_theme_settings() {
get_text_edit()->add_color_override("member_variable_color", member_variable_color);
get_text_edit()->add_color_override("mark_color", mark_color);
get_text_edit()->add_color_override("breakpoint_color", breakpoint_color);
+ get_text_edit()->add_color_override("code_folding_color", code_folding_color);
get_text_edit()->add_color_override("search_result_color", search_result_color);
get_text_edit()->add_color_override("search_result_border_color", search_result_border_color);
get_text_edit()->add_color_override("symbol_color", symbol_color);
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5c23a08971..7ff85716a5 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -886,6 +886,11 @@ void TextEdit::_notification(int p_what) {
int char_w = cache.font->get_char_size(' ').width;
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
}
+ } else {
+ // if it has text, then draw current line marker in the margin, as line number ect will draw over it, draw the rest of line marker later.
+ if (line == cursor.line && highlight_current_line) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg, get_row_height()), cache.current_line_color);
+ }
}
if (text.is_breakpoint(line) && !draw_breakpoint_gutter) {
@@ -915,11 +920,11 @@ void TextEdit::_notification(int p_what) {
if (is_folded(line)) {
int xofs = horizontal_gap - (cache.can_fold_icon->get_width()) / 2;
int yofs = (get_row_height() - cache.folded_icon->get_height()) / 2;
- cache.folded_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), Color(0.8f, 0.8f, 0.8f, 0.8f));
+ cache.folded_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), cache.code_folding_color);
} else if (can_fold(line)) {
int xofs = -cache.can_fold_icon->get_width() / 2 - horizontal_gap + 3;
int yofs = (get_row_height() - cache.can_fold_icon->get_height()) / 2;
- cache.can_fold_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), Color(0.8f, 0.8f, 0.8f, 0.8f));
+ cache.can_fold_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), cache.code_folding_color);
}
}
@@ -1126,10 +1131,6 @@ void TextEdit::_notification(int p_what) {
bool in_selection = (selection.active && line >= selection.from_line && line <= selection.to_line && (line > selection.from_line || j >= selection.from_column) && (line < selection.to_line || j < selection.to_column));
if (line == cursor.line && highlight_current_line) {
- // if its the first char draw behind line numbers
- if (j == 0) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, (char_ofs + char_margin + ofs_x), get_row_height()), cache.current_line_color);
- }
// if its the last char draw to end of the line
if (j == str.length() - 1) {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + char_w, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
@@ -1268,7 +1269,9 @@ void TextEdit::_notification(int p_what) {
if (j == str.length() - 1 && is_folded(line)) {
int yofs = (get_row_height() - cache.folded_eol_icon->get_height()) / 2;
int xofs = cache.folded_eol_icon->get_width() / 2;
- cache.folded_eol_icon->draw(ci, Point2(char_ofs + char_margin + xofs + ofs_x, ofs_y + yofs), Color(1, 1, 1, 1));
+ Color eol_color = cache.code_folding_color;
+ eol_color.a = 1;
+ cache.folded_eol_icon->draw(ci, Point2(char_ofs + char_margin + xofs + ofs_x, ofs_y + yofs), eol_color);
}
}
@@ -3993,6 +3996,7 @@ void TextEdit::_update_caches() {
cache.current_line_color = get_color("current_line_color");
cache.line_length_guideline_color = get_color("line_length_guideline_color");
cache.breakpoint_color = get_color("breakpoint_color");
+ cache.code_folding_color = get_color("code_folding_color");
cache.brace_mismatch_color = get_color("brace_mismatch_color");
cache.word_highlighted_color = get_color("word_highlighted_color");
cache.search_result_color = get_color("search_result_color");
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index c715634c8b..e5dc2da7c7 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -96,6 +96,7 @@ class TextEdit : public Control {
Color selection_color;
Color mark_color;
Color breakpoint_color;
+ Color code_folding_color;
Color current_line_color;
Color line_length_guideline_color;
Color brace_mismatch_color;
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 651b7543c6..bb2c8750e3 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -468,6 +468,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("selection_color", "TextEdit", font_color_selection);
theme->set_color("mark_color", "TextEdit", Color(1.0, 0.4, 0.4, 0.4));
theme->set_color("breakpoint_color", "TextEdit", Color(0.8, 0.8, 0.4, 0.2));
+ theme->set_color("code_folding_color", "TextEdit", Color(0.8, 0.8, 0.8, 0.8));
theme->set_color("current_line_color", "TextEdit", Color(0.25, 0.25, 0.26, 0.8));
theme->set_color("caret_color", "TextEdit", control_font_color);
theme->set_color("caret_background_color", "TextEdit", Color::html("000000"));