1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

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
parent 2121760700
commit ac034bdf7d

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);