# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1337034386 0 # Node ID 2e0f87ec24fe1b967c09667e2b8ddad523013e2b # Parent 48983a2f839fc82ab553350be214223567321616 Create a separate disabled image list with washed out and grayscale bitmaps on Windows. This allows bitmap buttons to change looks when visibly disabled... this also helps on XP because the default way icons are made to look disabled is terrible. diff -r 48983a2f839f -r 2e0f87ec24fe win/dw.c --- a/win/dw.c Mon May 14 21:36:28 2012 +0000 +++ b/win/dw.c Mon May 14 22:26:26 2012 +0000 @@ -757,11 +757,15 @@ else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) { HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0); + HIMAGELIST dimlist = (HIMAGELIST)SendMessage(handle, TB_GETDISABLEDIMAGELIST, 0, 0); SendMessage(handle, TB_SETIMAGELIST, 0, 0); + SendMessage(handle, TB_SETDISABLEDIMAGELIST, 0, 0); if(imlist) ImageList_Destroy(imlist); + if(dimlist) + ImageList_Destroy(dimlist); } #endif else if(_tcsnicmp(tmpbuf, FRAMECLASSNAME, _tcslen(FRAMECLASSNAME)+1)==0) @@ -6166,11 +6170,36 @@ return tmp; } +/* Internal function to create a grayscale bitmap from a color one */ +void _to_grayscale(HBITMAP hbm, int width, int height) +{ + HDC hdc = CreateCompatibleDC(NULL); + if (hdc) + { + HBITMAP hbmPrev = SelectBitmap(hdc, hbm); + int x, y; + + for(y=0;y