https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dea602cd7073d44d90d84…
commit dea602cd7073d44d90d84fe6674eba6369f80d19
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Fri Nov 10 20:59:25 2017 +0200
[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
---
dll/win32/comctl32/button.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dll/win32/comctl32/button.c b/dll/win32/comctl32/button.c
index ea250e8406..a62ef6e789 100644
--- a/dll/win32/comctl32/button.c
+++ b/dll/win32/comctl32/button.c
@@ -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);