mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Position combobox dropdown to fit within config overlay window
This commit is contained in:
parent
18360643f5
commit
32f9e7296d
@ -22,8 +22,15 @@ namespace Overlay
|
||||
RECT ComboBoxDropDown::calculateRect(ComboBoxControl& parent, DWORD itemCount)
|
||||
{
|
||||
const RECT parentRect = parent.getRect();
|
||||
return { parentRect.left, parentRect.bottom, parentRect.right,
|
||||
RECT rect = { parentRect.left, parentRect.bottom, parentRect.right,
|
||||
parentRect.bottom + static_cast<int>(itemCount) * ARROW_SIZE + 4 };
|
||||
|
||||
const RECT rootWindowRect = static_cast<const Window&>(parent.getRoot()).getRect();
|
||||
if (rect.bottom > rootWindowRect.bottom - rootWindowRect.top)
|
||||
{
|
||||
OffsetRect(&rect, 0, parentRect.top - rect.bottom);
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
|
||||
RECT ComboBoxDropDown::calculateRect(const RECT& /*monitorRect*/) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user