From 8c6cc4dc2d6a55bb3a681756f819689c4bc2d4d6 Mon Sep 17 00:00:00 2001 From: Bernhard Liebl Date: Sat, 4 Nov 2017 14:09:45 +0100 Subject: Docs cosmetics: add more space to Signals, Enumerations, Constants; aligned table layout for setters and getters --- editor/editor_help.cpp | 75 +++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 2c4d3035a4..03cd2c9b6b 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1045,12 +1045,17 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { class_desc->pop(); // end monofont if (cd.signals[i].description != "") { + class_desc->push_font(doc_font); class_desc->push_color(comment_color); - class_desc->add_text(" "); + class_desc->push_indent(1); + // class_desc->add_text(" "); _add_text(cd.signals[i].description); + class_desc->pop(); // indent class_desc->pop(); + class_desc->pop(); // font } class_desc->add_newline(); + class_desc->add_newline(); } class_desc->pop(); @@ -1129,11 +1134,14 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { class_desc->pop(); if (enum_list[i].description != "") { class_desc->push_font(doc_font); - class_desc->add_text(" "); + //class_desc->add_text(" "); + class_desc->push_indent(1); class_desc->push_color(comment_color); _add_text(enum_list[i].description); class_desc->pop(); class_desc->pop(); + class_desc->pop(); // indent + class_desc->add_newline(); } class_desc->add_newline(); @@ -1177,11 +1185,14 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { class_desc->pop(); if (constants[i].description != "") { class_desc->push_font(doc_font); - class_desc->add_text(" "); + class_desc->push_indent(1); + //class_desc->add_text(" "); class_desc->push_color(comment_color); _add_text(constants[i].description); class_desc->pop(); class_desc->pop(); + class_desc->pop(); // indent + class_desc->add_newline(); } class_desc->add_newline(); @@ -1231,54 +1242,62 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { method_line[cd.properties[i].name] = class_desc->get_line_count() - 2; + class_desc->push_table(2); + class_desc->set_table_column_expand(1, 1); + + class_desc->push_cell(); class_desc->push_font(doc_code_font); _add_type(cd.properties[i].type, cd.properties[i].enumeration); - class_desc->add_text(" "); + class_desc->pop(); // font + class_desc->pop(); // cell + + class_desc->push_cell(); + class_desc->push_font(doc_code_font); class_desc->push_color(headline_color); _add_text(cd.properties[i].name); - class_desc->pop(); //color - - class_desc->add_text(" "); + class_desc->pop(); // color + class_desc->pop(); // font + class_desc->pop(); // cell - class_desc->pop(); //font + //class_desc->add_text(" "); if (cd.properties[i].setter != "") { - class_desc->push_font(doc_font); - - class_desc->push_indent(2); - class_desc->push_color(comment_color); - class_desc->add_text("Setter: "); - class_desc->pop(); + class_desc->push_cell(); + class_desc->pop(); // cell + class_desc->push_cell(); + class_desc->push_font(doc_code_font); class_desc->push_color(text_color); class_desc->add_text(cd.properties[i].setter + "(value)"); - class_desc->pop(); //color - - class_desc->pop(); //indent - - class_desc->pop(); //font + class_desc->pop(); // color + class_desc->push_color(comment_color); + class_desc->add_text(" setter"); + class_desc->pop(); // color + class_desc->pop(); // font + class_desc->pop(); // cell } if (cd.properties[i].getter != "") { - class_desc->push_font(doc_font); - - class_desc->push_indent(2); - class_desc->push_color(comment_color); - class_desc->add_text("Getter: "); - class_desc->pop(); + class_desc->push_cell(); + class_desc->pop(); // cell + class_desc->push_cell(); + class_desc->push_font(doc_code_font); class_desc->push_color(text_color); class_desc->add_text(cd.properties[i].getter + "()"); class_desc->pop(); //color - - class_desc->pop(); //indent - + class_desc->push_color(comment_color); + class_desc->add_text(" getter"); + class_desc->pop(); //color class_desc->pop(); //font + class_desc->pop(); //cell } + class_desc->pop(); // table + class_desc->add_newline(); class_desc->push_color(text_color); -- cgit v1.2.3