Browse Source

Merge pull request #81669 from kleonc/gui-tooltip-transparent-background

Enable transparent background for GUI tooltips
Yuri Sizov 2 năm trước cách đây
mục cha
commit
dd3638d425
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      scene/main/viewport.cpp

+ 3 - 0
scene/main/viewport.cpp

@@ -1489,6 +1489,9 @@ void Viewport::_gui_show_tooltip() {
 	PopupPanel *panel = memnew(PopupPanel);
 	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.
 	// 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);