The current implementation doesn't work when we set the button with a size that is greater than the size of bitmap.
Likely it isn't easy to test this automatically, attached is the testcase I wrote for it.
And this is the comparison: ![comctl32_toolbar_button_bitmap](/uploads/427448b2aaaac1f03feca1eed2fe4bb9/comctl32_toolbar_button_bitmap.png) [toolbar_button_bitmap_testcase.tar.gz](/uploads/51b3018645f7aa46d444cd8d696716e1/toolbar_button_bitmap_testcase.tar.gz)
From: Jactry Zeng jzeng@codeweavers.com
The current implementation doesn't work when we set the button with a size that is greater than the size of bitmap. --- dlls/comctl32/toolbar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 02538eeb649..433df5d209b 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -967,7 +967,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, else rcBitmap.left += ((rc.right - rc.left) - infoPtr->nBitmapWidth) / 2;
- rcBitmap.top += infoPtr->szPadding.cy / 2; + rcBitmap.top += ((rc.bottom - rc.top) - infoPtr->nBitmapHeight) / 2;
TRACE("iBitmap=%d, start=(%ld,%ld) w=%d, h=%d\n", btnPtr->iBitmap, rcBitmap.left, rcBitmap.top, infoPtr->nBitmapWidth, infoPtr->nBitmapHeight); @@ -988,6 +988,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, rcText.top += infoPtr->szPadding.cy/2 + infoPtr->nBitmapHeight + 1; else rcText.top += infoPtr->szPadding.cy/2 + 2; + rcText.top += rcBitmap.top; } }
This looks still doesn't fit all the cases, as the pictures I have in #MR 2849 showed, the text of the buttons in the place bar is missing. Will try it again.