LibGUI: Avoid too large tooltip when switching to shorter text

The tooltip window didn't resize when setting a shorter text, or moving
to a widget with shorter text, so it had extra space on the sides.

Fix by allowing the window to resize without obeying the minimum size
of the (previous) tooltip.
This commit is contained in:
David Smith 2022-08-09 21:42:40 +02:00 committed by Sam Atkins
commit ac034bdf7d
Notes: sideshowbarker 2024-07-17 17:40:13 +09:00

View file

@ -43,6 +43,7 @@ private:
TooltipWindow()
{
set_window_type(WindowType::Tooltip);
set_obey_widget_min_size(false);
m_label = set_main_widget<Label>();
m_label->set_background_role(Gfx::ColorRole::Tooltip);
m_label->set_foreground_role(Gfx::ColorRole::TooltipText);