From 988c6fea196536fafaec2b34741a8535db3acc3f Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:03:50 -0500 Subject: LibGUI: Prefer to pop-up Tray Button menus from the top right Fixes menus obscuring SegmentWidgets in status bars. --- Userland/Libraries/LibGUI/Button.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibGUI/Button.cpp b/Userland/Libraries/LibGUI/Button.cpp index 3255d4cf4c..ecbd3e8fc3 100644 --- a/Userland/Libraries/LibGUI/Button.cpp +++ b/Userland/Libraries/LibGUI/Button.cpp @@ -189,7 +189,10 @@ void Button::set_menu(RefPtr menu) void Button::mousedown_event(MouseEvent& event) { if (m_menu) { - m_menu->popup(screen_relative_rect().top_left()); + if (button_style() == Gfx::ButtonStyle::Tray) + m_menu->popup(screen_relative_rect().top_right()); + else + m_menu->popup(screen_relative_rect().top_left()); update(); return; } -- cgit v1.2.3