summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-02-22 15:03:50 -0500
committerAndreas Kling <kling@serenityos.org>2022-02-24 19:09:41 +0100
commit988c6fea196536fafaec2b34741a8535db3acc3f (patch)
tree66ac7c24e16bb292c7025295dce86012074a94d6 /Userland/Libraries/LibGUI
parentb9f81b91a638583fb4dd11b2d67b385a15609a59 (diff)
downloadserenity-988c6fea196536fafaec2b34741a8535db3acc3f.zip
LibGUI: Prefer to pop-up Tray Button menus from the top right
Fixes menus obscuring SegmentWidgets in status bars.
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/Button.cpp5
1 files changed, 4 insertions, 1 deletions
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<GUI::Menu> 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;
}