mirror of
https://github.com/reactos/reactos.git
synced 2024-11-24 20:13:31 +08:00
[COMCTL32] -Button: Implement drawing the image list with the BUTTON_IMAGELIST_ALIGN_CENTER parameter. This is enough to fix buttons with images created by Lazarus but only with themes. The non themed branch of the code is slightly more complex and will be fixed next. CORE-13170
This commit is contained in:
parent
7532c41db7
commit
dea602cd70
@ -420,16 +420,21 @@ BOOL BUTTON_DrawIml(HDC hDC, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCa
|
||||
}
|
||||
else if (pimlData->uAlign == BUTTON_IMAGELIST_ALIGN_TOP)
|
||||
{
|
||||
left = prc->left + (prc->right - prc->left - ImageSize.cy) / 2;
|
||||
left = prc->left + (prc->right - prc->left - ImageSize.cx) / 2;
|
||||
top = prc->top + pimlData->margin.top;
|
||||
prc->top = top + ImageSize.cy + pimlData->margin.bottom;
|
||||
}
|
||||
else if (pimlData->uAlign == BUTTON_IMAGELIST_ALIGN_BOTTOM)
|
||||
{
|
||||
left = prc->left + (prc->right - prc->left - ImageSize.cy) / 2;
|
||||
left = prc->left + (prc->right - prc->left - ImageSize.cx) / 2;
|
||||
top = prc->bottom - pimlData->margin.bottom - ImageSize.cy;
|
||||
prc->bottom = top - pimlData->margin.top;
|
||||
}
|
||||
else if (pimlData->uAlign == BUTTON_IMAGELIST_ALIGN_CENTER)
|
||||
{
|
||||
left = prc->left + (prc->right - prc->left - ImageSize.cx) / 2;
|
||||
top = prc->top + (prc->bottom - prc->top - ImageSize.cy) / 2;
|
||||
}
|
||||
|
||||
if (!bOnlyCalc)
|
||||
ImageList_Draw(pimlData->himl, 0, hDC, left, top, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user