You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, a plain-text label is used which does not support rich text
formatting.
Define a `Tooltip` scene; and override `Control._make_custom_tooltip()` in `Block` to
return an instance of this scene.
`Tooltip` is initially just a `RichTextLabel` with BBCode enabled and a custom
minimum size set as suggested by the `_make_custom_tooltip()` documentation:
> Note: The tooltip is shrunk to minimal size. If you want to ensure it's fully
> visible, you might want to set its `custom_minimum_size` to some non-zero
> value.
We override the theme styles on the `RichTextLabel` to match the styles used in
the built-in inspector's help tooltips. In particular, bold, italic and
bold-italic text doesn't work without overriding these styles. The [BBCode in
RichTextLabel][0] documentation claims:
> If no custom bold or italic fonts are defined, faux bold and italic fonts
> will be generated by Godot.
but empirically this is not true.
The Editor Theme Explorer plugin
<https://github.com/YuriSizov/godot-editor-theme-explorer> was useful, as was
reading the editor source code, specifically `editor_fonts.cpp` and
`editor_help.cpp`.
None of the existing `tooltip_text` properties in the codebase use the `[`
character that is used by BBCode tags, so there is no need to adjust the
existing tooltips to keep displaying as they previously did.
https://phabricator.endlessm.com/T35540
[0]: https://docs.godotengine.org/en/stable/tutorials/ui/bbcode_in_richtextlabel.html#reference
0 commit comments