From 7c0f9ea2b9711c20ce5f16b4a6b26efc46d48a69 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 5 Aug 2019 18:31:13 +0200 Subject: [PATCH] GComboBox: Constrain the list popup window height to the desktop rect This looks much better than allowing it to extend past the bottom of the screen. :^) --- Libraries/LibGUI/GComboBox.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/LibGUI/GComboBox.cpp b/Libraries/LibGUI/GComboBox.cpp index 5bbb07de3fb..6cbe5212832 100644 --- a/Libraries/LibGUI/GComboBox.cpp +++ b/Libraries/LibGUI/GComboBox.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -90,7 +91,10 @@ void GComboBox::open() model()->row_count() * m_list_view->item_height() + m_list_view->frame_thickness() * 2 }; - m_list_window->set_rect({ my_screen_rect.bottom_left(), size }); + Rect list_window_rect { my_screen_rect.bottom_left(), size }; + list_window_rect.intersect(GDesktop::the().rect().shrunken(0, 128)); + + m_list_window->set_rect(list_window_rect); m_list_window->show(); }