summaryrefslogtreecommitdiff
path: root/editor/editor_help.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-23 00:29:00 +0100
committerGitHub <noreply@github.com>2022-01-23 00:29:00 +0100
commitf63457814f457d9ca9aee29153b7a3f51ac30faf (patch)
treee1b0f00fa29e71e382b3748d6844b745d5e29dc4 /editor/editor_help.cpp
parentee253163abb04e20cf64891e1a75c1d3834b26d7 (diff)
parent8cc9ff4f5b41dfc3e6f53076af36d368391de08a (diff)
Merge pull request #35508 from Calinou/editor-help-references-use-code-font
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r--editor/editor_help.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 28cf2ee75f..311767d301 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -1599,24 +1599,28 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) {
pos = brk_pos + 1;
} else if (tag.begins_with("method ") || tag.begins_with("member ") || tag.begins_with("signal ") || tag.begins_with("enum ") || tag.begins_with("constant ") || tag.begins_with("theme_item ")) {
- int tag_end = tag.find(" ");
-
- String link_tag = tag.substr(0, tag_end);
- String link_target = tag.substr(tag_end + 1, tag.length()).lstrip(" ");
+ const int tag_end = tag.find(" ");
+ const String link_tag = tag.substr(0, tag_end);
+ const String link_target = tag.substr(tag_end + 1, tag.length()).lstrip(" ");
+ p_rt->push_font(doc_code_font);
p_rt->push_color(link_color);
p_rt->push_meta("@" + link_tag + " " + link_target);
p_rt->add_text(link_target + (tag.begins_with("method ") ? "()" : ""));
p_rt->pop();
p_rt->pop();
+ p_rt->pop();
pos = brk_end + 1;
} else if (doc->class_list.has(tag)) {
+ // Class reference tag such as [Node2D] or [SceneTree].
+ p_rt->push_font(doc_code_font);
p_rt->push_color(link_color);
p_rt->push_meta("#" + tag);
p_rt->add_text(tag);
p_rt->pop();
p_rt->pop();
+ p_rt->pop();
pos = brk_end + 1;
} else if (tag == "b") {