# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1337063859 0 # Node ID aa2bd0d8bf275506df41c914ea8c472a3a312aa0 # Parent 38a0e75bc59caa02efaf373f4da7c4a757927fd3 Set the minimum button size to 24x24 instead of 20x20 when toolbar buttons are not set to flat (DW_BS_NOBORDER). diff -r 38a0e75bc59c -r aa2bd0d8bf27 win/dw.c --- a/win/dw.c Tue May 15 06:13:35 2012 +0000 +++ b/win/dw.c Tue May 15 06:37:39 2012 +0000 @@ -1509,15 +1509,19 @@ else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) { HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0); - int thiswidth = 20, thisheight = 20; - + int thiswidth = 20, thisheight = 20, minsize = 24; + + /* If we are flat the size can be smaller */ + if(GetWindowLong(handle, GWL_STYLE) & TBSTYLE_FLAT) + minsize = 20; + if(imlist) ImageList_GetIconSize(imlist, &thiswidth, &thisheight); - if(thiswidth < 20) - thiswidth = 20; - if(thisheight < 20) - thisheight = 20; + if(thiswidth < minsize) + thiswidth = minsize; + if(thisheight < minsize) + thisheight = minsize; MoveWindow(handle, thiswidth < width ? currentx + pad + ((width-thiswidth)/2) : currentx + pad, thisheight < height ? currenty + pad + ((height-thisheight)/2) : currenty + pad, @@ -4656,14 +4660,19 @@ else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) { HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0); + int minsize = 24; + /* If we are flat the size can be smaller */ + if(GetWindowLong(handle, GWL_STYLE) & TBSTYLE_FLAT) + minsize = 20; + if(imlist) ImageList_GetIconSize(imlist, &thiswidth, &thisheight); - if(thiswidth < 20) - thiswidth = 20; - if(thisheight < 20) - thisheight = 20; + if(thiswidth < minsize) + thiswidth = minsize; + if(thisheight < minsize) + thisheight = minsize; } #endif /* Listbox */