Merge pull request #48186 from EricEzaM/PR/tooltip-improvements
Made default tooltips (non-custom ones) disappear on mouse enter.
This commit is contained in:
commit
95def293a6
|
@ -1550,6 +1550,9 @@ void Viewport::_gui_show_tooltip() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Popup window which houses the tooltip content.
|
||||||
|
TooltipPanel *panel = memnew(TooltipPanel);
|
||||||
|
|
||||||
// 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);
|
||||||
|
@ -1559,11 +1562,11 @@ void Viewport::_gui_show_tooltip() {
|
||||||
gui.tooltip_label = memnew(TooltipLabel);
|
gui.tooltip_label = memnew(TooltipLabel);
|
||||||
gui.tooltip_label->set_text(tooltip_text);
|
gui.tooltip_label->set_text(tooltip_text);
|
||||||
base_tooltip = gui.tooltip_label;
|
base_tooltip = gui.tooltip_label;
|
||||||
|
panel->connect("mouse_entered", callable_mp(this, &Viewport::_gui_cancel_tooltip));
|
||||||
}
|
}
|
||||||
|
|
||||||
base_tooltip->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
base_tooltip->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
|
||||||
|
|
||||||
TooltipPanel *panel = memnew(TooltipPanel);
|
|
||||||
panel->set_transient(false);
|
panel->set_transient(false);
|
||||||
panel->set_flag(Window::FLAG_NO_FOCUS, true);
|
panel->set_flag(Window::FLAG_NO_FOCUS, true);
|
||||||
panel->set_wrap_controls(true);
|
panel->set_wrap_controls(true);
|
||||||
|
|
Loading…
Reference in New Issue