mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibGUI: Fix ComboBox desktop intersection rect
Subtracting 128 from the desktop rect's height was far to much and and leading to weird rendering issues - now it's calculated exactly from taskbar and menubar heights as well as a little additional offset to make it fit perfectly. Fixes #3115.
This commit is contained in:
committed by
Andreas Kling
parent
852770687a
commit
728d4649e4
@@ -186,8 +186,13 @@ void ComboBox::open()
|
||||
model()->row_count() * m_list_view->item_height() + m_list_view->frame_thickness() * 2
|
||||
};
|
||||
|
||||
auto taskbar_height = GUI::Desktop::the().taskbar_height();
|
||||
auto menubar_height = GUI::Desktop::the().menubar_height();
|
||||
// NOTE: This is so the combobox bottom edge exactly fits the taskbar's
|
||||
// top edge - the value was found through trial and error though.
|
||||
auto offset = 8;
|
||||
Gfx::IntRect list_window_rect { my_screen_rect.bottom_left(), size };
|
||||
list_window_rect.intersect(Desktop::the().rect().shrunken(0, 128));
|
||||
list_window_rect.intersect(Desktop::the().rect().shrunken(0, taskbar_height + menubar_height + offset));
|
||||
|
||||
if (m_list_view->hover_highlighting())
|
||||
m_list_view->set_last_valid_hovered_index({});
|
||||
|
||||
Reference in New Issue
Block a user