Enable transparent background for GUI tooltips

(cherry picked from commit c66dfd2cfe)
This commit is contained in:
kleonc 2023-09-14 23:37:28 +02:00 committed by Yuri Sizov
parent 3920b2db05
commit bf15d20e56
1 changed files with 3 additions and 0 deletions

View File

@ -1448,6 +1448,9 @@ void Viewport::_gui_show_tooltip() {
PopupPanel *panel = memnew(PopupPanel); PopupPanel *panel = memnew(PopupPanel);
panel->set_theme_type_variation(SNAME("TooltipPanel")); panel->set_theme_type_variation(SNAME("TooltipPanel"));
// Ensure no opaque background behind the panel as its StyleBox can be partially transparent (e.g. corners).
panel->set_transparent_background(true);
// Controls can implement `make_custom_tooltip` to provide their own tooltip. // Controls can implement `make_custom_tooltip` to provide their own tooltip.
// This should be a Control node which will be added as child to a TooltipPanel. // This should be a Control node which will be added as child to a TooltipPanel.
Control *base_tooltip = tooltip_owner->make_custom_tooltip(tooltip_text); Control *base_tooltip = tooltip_owner->make_custom_tooltip(tooltip_text);