mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
LibGUI: Fix Widget::screen_relative_rect() for WindowType::MenuApplet
This was using window()->position(), which is unset for windows with WindowType::MenuApplet. Now it checks the window type and then uses rect_in_menubar() for MenuApplet windows and rect() for everything else. This makes tooltips show up for MenuApplet windows, previously they were positioned off-screen :^)
This commit is contained in:
parent
e58d3b8481
commit
e77991e63a
Notes:
sideshowbarker
2024-07-19 03:39:50 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/e77991e63a9 Pull-request: https://github.com/SerenityOS/serenity/pull/3127
@ -464,7 +464,10 @@ Gfx::IntRect Widget::window_relative_rect() const
|
||||
|
||||
Gfx::IntRect Widget::screen_relative_rect() const
|
||||
{
|
||||
return window_relative_rect().translated(window()->position());
|
||||
auto window_position = window()->window_type() == WindowType::MenuApplet
|
||||
? window()->rect_in_menubar().location()
|
||||
: window()->rect().location();
|
||||
return window_relative_rect().translated(window_position);
|
||||
}
|
||||
|
||||
Widget* Widget::child_at(const Gfx::IntPoint& point) const
|
||||
|
Loading…
Reference in New Issue
Block a user