# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1337027548 0 # Node ID d55227360864b51348523165262b86cb6c56015a # Parent d9849833e5358c5b85240db71256685066398390 Center toolbar-based bitmap buttons on Windows during layout since they don't automatically center in the packed area. diff -r d9849833e535 -r d55227360864 win/dw.c --- a/win/dw.c Mon May 14 19:24:27 2012 +0000 +++ b/win/dw.c Mon May 14 20:32:28 2012 +0000 @@ -1499,6 +1499,21 @@ MoveWindow(handle, currentx + pad, currenty + pad, width, height + 400, FALSE); } +#ifdef TOOLBAR + /* Bitmap Buttons */ + else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) + { + HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0); + int thiswidth = 16, thisheight = 16; + + if(imlist) + ImageList_GetIconSize(imlist, &thiswidth, &thisheight); + + 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); + } +#endif else if(_tcsnicmp(tmpbuf, UPDOWN_CLASS, _tcslen(UPDOWN_CLASS)+1)==0) { /* Handle special case Spinbutton */