comparison win/dw.c @ 1728:aa2bd0d8bf27

Set the minimum button size to 24x24 instead of 20x20 when toolbar buttons are not set to flat (DW_BS_NOBORDER).
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 15 May 2012 06:37:39 +0000
parents 38a0e75bc59c
children 570a03dabdc2
comparison
equal deleted inserted replaced
1727:38a0e75bc59c 1728:aa2bd0d8bf27
1507 #ifdef TOOLBAR 1507 #ifdef TOOLBAR
1508 /* Bitmap Buttons */ 1508 /* Bitmap Buttons */
1509 else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) 1509 else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0)
1510 { 1510 {
1511 HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0); 1511 HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0);
1512 int thiswidth = 20, thisheight = 20; 1512 int thiswidth = 20, thisheight = 20, minsize = 24;
1513 1513
1514 /* If we are flat the size can be smaller */
1515 if(GetWindowLong(handle, GWL_STYLE) & TBSTYLE_FLAT)
1516 minsize = 20;
1517
1514 if(imlist) 1518 if(imlist)
1515 ImageList_GetIconSize(imlist, &thiswidth, &thisheight); 1519 ImageList_GetIconSize(imlist, &thiswidth, &thisheight);
1516 1520
1517 if(thiswidth < 20) 1521 if(thiswidth < minsize)
1518 thiswidth = 20; 1522 thiswidth = minsize;
1519 if(thisheight < 20) 1523 if(thisheight < minsize)
1520 thisheight = 20; 1524 thisheight = minsize;
1521 1525
1522 MoveWindow(handle, thiswidth < width ? currentx + pad + ((width-thiswidth)/2) : currentx + pad, 1526 MoveWindow(handle, thiswidth < width ? currentx + pad + ((width-thiswidth)/2) : currentx + pad,
1523 thisheight < height ? currenty + pad + ((height-thisheight)/2) : currenty + pad, 1527 thisheight < height ? currenty + pad + ((height-thisheight)/2) : currenty + pad,
1524 thiswidth < width ? thiswidth : width, thisheight < height ? thisheight : height, FALSE); 1528 thiswidth < width ? thiswidth : width, thisheight < height ? thisheight : height, FALSE);
1525 } 1529 }
4654 #ifdef TOOLBAR 4658 #ifdef TOOLBAR
4655 /* Bitmap Buttons */ 4659 /* Bitmap Buttons */
4656 else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) 4660 else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0)
4657 { 4661 {
4658 HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0); 4662 HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0);
4663 int minsize = 24;
4659 4664
4665 /* If we are flat the size can be smaller */
4666 if(GetWindowLong(handle, GWL_STYLE) & TBSTYLE_FLAT)
4667 minsize = 20;
4668
4660 if(imlist) 4669 if(imlist)
4661 ImageList_GetIconSize(imlist, &thiswidth, &thisheight); 4670 ImageList_GetIconSize(imlist, &thiswidth, &thisheight);
4662 4671
4663 if(thiswidth < 20) 4672 if(thiswidth < minsize)
4664 thiswidth = 20; 4673 thiswidth = minsize;
4665 if(thisheight < 20) 4674 if(thisheight < minsize)
4666 thisheight = 20; 4675 thisheight = minsize;
4667 } 4676 }
4668 #endif 4677 #endif
4669 /* Listbox */ 4678 /* Listbox */
4670 else if(_tcsnicmp(tmpbuf, LISTBOXCLASSNAME, _tcslen(LISTBOXCLASSNAME)+1) == 0) 4679 else if(_tcsnicmp(tmpbuf, LISTBOXCLASSNAME, _tcslen(LISTBOXCLASSNAME)+1) == 0)
4671 { 4680 {