Merge pull request #32225 from Calinou/improve-editor-help-display

Improve the editor help display
This commit is contained in:
Rémi Verschelde 2019-09-24 09:52:21 +02:00 committed by GitHub
commit db47221b8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -258,16 +258,17 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
} }
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);
class_desc->add_text(p_method.arguments.size() || is_vararg ? "( " : "("); class_desc->add_text("(");
class_desc->pop(); class_desc->pop();
for (int j = 0; j < p_method.arguments.size(); j++) { for (int j = 0; j < p_method.arguments.size(); j++) {
class_desc->push_color(text_color); class_desc->push_color(text_color);
if (j > 0) if (j > 0)
class_desc->add_text(", "); class_desc->add_text(", ");
_add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration);
class_desc->add_text(" ");
_add_text(p_method.arguments[j].name); _add_text(p_method.arguments[j].name);
class_desc->add_text(": ");
_add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration);
if (p_method.arguments[j].default_value != "") { if (p_method.arguments[j].default_value != "") {
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);
@ -292,7 +293,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
} }
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);
class_desc->add_text(p_method.arguments.size() || is_vararg ? " )" : ")"); class_desc->add_text(")");
class_desc->pop(); class_desc->pop();
if (p_method.qualifiers != "") { if (p_method.qualifiers != "") {
@ -425,7 +426,7 @@ void EditorHelp::_update_doc() {
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Brief Description:")); class_desc->add_text(TTR("Brief Description"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
@ -452,7 +453,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Properties"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Properties"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Properties:")); class_desc->add_text(TTR("Properties"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
@ -548,7 +549,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Methods"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Methods"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Methods:")); class_desc->add_text(TTR("Methods"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
@ -619,7 +620,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Theme Properties"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Theme Properties"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Theme Properties:")); class_desc->add_text(TTR("Theme Properties"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
@ -686,7 +687,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Signals"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Signals"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Signals:")); class_desc->add_text(TTR("Signals"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
@ -703,15 +704,16 @@ void EditorHelp::_update_doc() {
_add_text(cd.signals[i].name); _add_text(cd.signals[i].name);
class_desc->pop(); class_desc->pop();
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);
class_desc->add_text(cd.signals[i].arguments.size() ? "( " : "("); class_desc->add_text("(");
class_desc->pop(); class_desc->pop();
for (int j = 0; j < cd.signals[i].arguments.size(); j++) { for (int j = 0; j < cd.signals[i].arguments.size(); j++) {
class_desc->push_color(text_color); class_desc->push_color(text_color);
if (j > 0) if (j > 0)
class_desc->add_text(", "); class_desc->add_text(", ");
_add_type(cd.signals[i].arguments[j].type);
class_desc->add_text(" ");
_add_text(cd.signals[i].arguments[j].name); _add_text(cd.signals[i].arguments[j].name);
class_desc->add_text(": ");
_add_type(cd.signals[i].arguments[j].type);
if (cd.signals[i].arguments[j].default_value != "") { if (cd.signals[i].arguments[j].default_value != "") {
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);
@ -724,7 +726,7 @@ void EditorHelp::_update_doc() {
} }
class_desc->push_color(symbol_color); class_desc->push_color(symbol_color);
class_desc->add_text(cd.signals[i].arguments.size() ? " )" : ")"); class_desc->add_text(")");
class_desc->pop(); class_desc->pop();
class_desc->pop(); // end monofont class_desc->pop(); // end monofont
if (cd.signals[i].description != "") { if (cd.signals[i].description != "") {
@ -771,7 +773,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Enumerations"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Enumerations"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Enumerations:")); class_desc->add_text(TTR("Enumerations"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
class_desc->push_indent(1); class_desc->push_indent(1);
@ -857,7 +859,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Constants"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Constants"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Constants:")); class_desc->add_text(TTR("Constants"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
class_desc->push_indent(1); class_desc->push_indent(1);
@ -917,7 +919,7 @@ void EditorHelp::_update_doc() {
description_line = class_desc->get_line_count() - 2; description_line = class_desc->get_line_count() - 2;
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Class Description:")); class_desc->add_text(TTR("Class Description"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
@ -939,7 +941,7 @@ void EditorHelp::_update_doc() {
{ {
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Online Tutorials:")); class_desc->add_text(TTR("Online Tutorials"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
class_desc->push_indent(1); class_desc->push_indent(1);
@ -981,7 +983,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Property Descriptions"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Property Descriptions"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Property Descriptions:")); class_desc->add_text(TTR("Property Descriptions"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();
@ -1091,7 +1093,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Method Descriptions"), class_desc->get_line_count() - 2)); section_line.push_back(Pair<String, int>(TTR("Method Descriptions"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color); class_desc->push_color(title_color);
class_desc->push_font(doc_title_font); class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Method Descriptions:")); class_desc->add_text(TTR("Method Descriptions"));
class_desc->pop(); class_desc->pop();
class_desc->pop(); class_desc->pop();