# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1337031388 0 # Node ID 48983a2f839fc82ab553350be214223567321616 # Parent d55227360864b51348523165262b86cb6c56015a Toolbar bitmap buttons don't seem to draw properly smaller than 20x20 on Windows... So clamp the minimum size for them at 20 pixels. diff -r d55227360864 -r 48983a2f839f win/dw.c --- a/win/dw.c Mon May 14 20:32:28 2012 +0000 +++ b/win/dw.c Mon May 14 21:36:28 2012 +0000 @@ -1504,11 +1504,16 @@ else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) { HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0); - int thiswidth = 16, thisheight = 16; + int thiswidth = 20, thisheight = 20; if(imlist) ImageList_GetIconSize(imlist, &thiswidth, &thisheight); + if(thiswidth < 20) + thiswidth = 20; + if(thisheight < 20) + thisheight = 20; + MoveWindow(handle, thiswidth < width ? currentx + pad + ((width-thiswidth)/2) : currentx + pad, thisheight < height ? currenty + pad + ((height-thisheight)/2) : currenty + pad, thiswidth < width ? thiswidth : width, thisheight < height ? thisheight : height, FALSE); @@ -4648,6 +4653,11 @@ if(imlist) ImageList_GetIconSize(imlist, &thiswidth, &thisheight); + + if(thiswidth < 20) + thiswidth = 20; + if(thisheight < 20) + thisheight = 20; } #endif /* Listbox */ @@ -6191,6 +6201,7 @@ /* Insert the single bitmap and button into the toolbar */ SendMessage(tmp, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); + SendMessage(tmp, TB_SETBUTTONSIZE, 0, MAKELPARAM(bmi.bmWidth, bmi.bmHeight)); SendMessage(tmp, TB_SETPADDING, 0, 0); SendMessage(tmp, TB_SETIMAGELIST, 0, (LPARAM)imlist); SendMessage(tmp, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)imlist);