You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Small readability fixes for the in-game class reference - fixes #2515 and #2393 (text spacing and top/left padding for the text area, respectively).
This commit is contained in:
@@ -547,6 +547,7 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
class_desc->pop();
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
|
||||
}
|
||||
|
||||
@@ -563,6 +564,7 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
_add_text(cd.brief_description);
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
}
|
||||
|
||||
bool method_descr=false;
|
||||
@@ -637,7 +639,6 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
|
||||
if (cd.properties.size()) {
|
||||
|
||||
|
||||
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
|
||||
class_desc->push_font(doc_title_font);
|
||||
class_desc->add_text("Members:");
|
||||
@@ -715,9 +716,10 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
class_desc->add_newline();
|
||||
}
|
||||
|
||||
class_desc->add_newline();
|
||||
class_desc->pop();
|
||||
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
|
||||
}
|
||||
if (cd.signals.size()) {
|
||||
@@ -779,6 +781,7 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
|
||||
class_desc->pop();
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
|
||||
}
|
||||
|
||||
@@ -823,6 +826,7 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
|
||||
class_desc->pop();
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
|
||||
|
||||
}
|
||||
@@ -830,17 +834,18 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
if (cd.description!="") {
|
||||
|
||||
description_line=class_desc->get_line_count()-2;
|
||||
|
||||
class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color"));
|
||||
class_desc->push_font(doc_title_font);
|
||||
class_desc->add_text("Description:");
|
||||
class_desc->pop();
|
||||
class_desc->pop();
|
||||
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
_add_text(cd.description);
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
}
|
||||
|
||||
if (method_descr) {
|
||||
@@ -853,12 +858,16 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
class_desc->push_indent(1);
|
||||
|
||||
|
||||
for(int i=0;i<cd.methods.size();i++) {
|
||||
|
||||
method_line[cd.methods[i].name]=class_desc->get_line_count()-2;
|
||||
|
||||
if( cd.methods[i].description != "") {
|
||||
class_desc->add_newline();
|
||||
}
|
||||
class_desc->push_font(doc_code_font);
|
||||
_add_type(cd.methods[i].return_type);
|
||||
|
||||
@@ -899,9 +908,12 @@ Error EditorHelp::_goto_desc(const String& p_class,bool p_update_history,int p_v
|
||||
|
||||
class_desc->pop();
|
||||
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
_add_text(cd.methods[i].description);
|
||||
if( cd.methods[i].description != "") {
|
||||
class_desc->add_text(" ");
|
||||
_add_text(cd.methods[i].description);
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
}
|
||||
class_desc->add_newline();
|
||||
class_desc->add_newline();
|
||||
|
||||
@@ -1392,6 +1404,8 @@ EditorHelp::EditorHelp(EditorNode *p_editor) {
|
||||
PanelContainer *pc = memnew( PanelContainer );
|
||||
Ref<StyleBoxFlat> style( memnew( StyleBoxFlat ) );
|
||||
style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/background_color") );
|
||||
style->set_default_margin(MARGIN_LEFT,20);
|
||||
style->set_default_margin(MARGIN_TOP,20);
|
||||
pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit"));
|
||||
h_split->add_child(pc);
|
||||
class_desc = memnew( RichTextLabel );
|
||||
|
||||
Reference in New Issue
Block a user