1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

EditorHelpBit: Fix content height fit and RTL theme propagation

This reverts #51619 and fixes the issue properly, as well as enabling
`fit_content_height` which is necessary following #57304.

Fixes #57174.

Also adds a placeholder for property and signal tooltips with no description,
factoring the code while at it.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
This commit is contained in:
Rémi Verschelde
2022-02-02 14:10:15 +01:00
parent bf12719cca
commit 9f0a693b50
3 changed files with 54 additions and 44 deletions

View File

@@ -1910,6 +1910,8 @@ DocTools *EditorHelp::get_doc_data() {
return doc;
}
//// EditorHelpBit ///
void EditorHelpBit::_go_to_help(String p_what) {
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
ScriptEditor::get_singleton()->goto_help(p_what);
@@ -1950,12 +1952,9 @@ void EditorHelpBit::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: {
rich_text->add_theme_color_override("selection_color", get_theme_color(SNAME("selection_color"), SNAME("EditorHelp")));
} break;
case NOTIFICATION_READY: {
rich_text->clear();
_add_text_to_rt(text, rich_text);
rich_text->reset_size(); // Force recalculating size after parsing bbcode.
} break;
}
}
@@ -1971,9 +1970,12 @@ EditorHelpBit::EditorHelpBit() {
add_child(rich_text);
rich_text->connect("meta_clicked", callable_mp(this, &EditorHelpBit::_meta_clicked));
rich_text->set_override_selected_font_color(false);
set_custom_minimum_size(Size2(0, 70 * EDSCALE));
rich_text->set_fit_content_height(true);
set_custom_minimum_size(Size2(0, 50 * EDSCALE));
}
//// FindBar ///
FindBar::FindBar() {
search_text = memnew(LineEdit);
add_child(search_text);