mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
WindowServer: Constrain popup menu Y position within screen rect
This fixes an issue where large popup menus would open upwards despite there not being enough space for that.
This commit is contained in:
parent
4c6e3d0c59
commit
c53e937014
1 changed files with 1 additions and 1 deletions
|
@ -590,7 +590,7 @@ void Menu::do_popup(const Gfx::IntPoint& position, bool make_input, bool as_subm
|
|||
adjusted_pos = adjusted_pos.translated(-window.width(), 0);
|
||||
}
|
||||
if (adjusted_pos.y() + window.height() >= Screen::the().height() - margin) {
|
||||
adjusted_pos = adjusted_pos.translated(0, -window.height());
|
||||
adjusted_pos = adjusted_pos.translated(0, -min(window.height(), adjusted_pos.y()));
|
||||
if (as_submenu)
|
||||
adjusted_pos = adjusted_pos.translated(0, item_height());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue