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

LibGUI: Prefer to pop-up Tray Button menus from the top right

Fixes menus obscuring SegmentWidgets in status bars.
This commit is contained in:
thankyouverycool 2022-02-22 15:03:50 -05:00 committed by Andreas Kling
parent b9f81b91a6
commit 988c6fea19

View file

@ -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;
}