Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Fix EditorHelpBit title height is wrong on initialization #93040

Merged

Conversation

dalexeev
Copy link
Member

@dalexeev dalexeev commented Jun 11, 2024

The bug is caused by the fact that the title label uses fit_content = true, unlike the content label. At initialization, the width is still 0, which is why the calculated title height is too large.

Although this is not entirely true for non-tooltip EditorHelpBits, 512 * EDSCALE is already used below, so I think it's ok.

godot/editor/editor_help.cpp

Lines 3736 to 3738 in 292e50e

title = memnew(RichTextLabel);
title->set_theme_type_variation("EditorHelpBitTitle");
title->set_fit_content(true);

godot/editor/editor_help.cpp

Lines 3748 to 3750 in 292e50e

content = memnew(RichTextLabel);
content->set_theme_type_variation("EditorHelpBitContent");
content->set_custom_minimum_size(Size2(512 * EDSCALE, content_min_height));

editor/editor_help.cpp Outdated Show resolved Hide resolved
@dalexeev dalexeev force-pushed the editor-help-bit-fix-title-height branch from 4e8fa8f to 7940992 Compare June 12, 2024 08:08
@akien-mga akien-mga merged commit d7302a2 into godotengine:master Jun 12, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@dalexeev dalexeev deleted the editor-help-bit-fix-title-height branch June 12, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor settings tooltips have a huge bottom margin with compact spacing preset
2 participants