Mercurial > dwindows
comparison win/dw.c @ 1979:290e661abb63
Win: Fix groupbox label background color in dark mode by subclassing the frame.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 13 Aug 2019 00:20:52 +0000 |
parents | a2a0a18678cd |
children | 38a455d2096c |
comparison
equal
deleted
inserted
replaced
1978:a2a0a18678cd | 1979:290e661abb63 |
---|---|
3027 case WM_CTLCOLORSCROLLBAR: | 3027 case WM_CTLCOLORSCROLLBAR: |
3028 case WM_CTLCOLORDLG: | 3028 case WM_CTLCOLORDLG: |
3029 { | 3029 { |
3030 ColorInfo *thiscinfo = (ColorInfo *)GetWindowLongPtr((HWND)mp2, GWLP_USERDATA); | 3030 ColorInfo *thiscinfo = (ColorInfo *)GetWindowLongPtr((HWND)mp2, GWLP_USERDATA); |
3031 | 3031 |
3032 if(msg == WM_CTLCOLORBTN) | |
3033 { | |
3034 /* Groupbox color info is on the frame window it is attached to */ | |
3035 if(GetWindowLongPtr((HWND)mp2, GWL_STYLE) & BS_GROUPBOX) | |
3036 { | |
3037 Box *framebox = (Box *)GetWindowLongPtr(hWnd, GWLP_USERDATA); | |
3038 if(framebox) | |
3039 thiscinfo = &framebox->cinfo; | |
3040 } | |
3041 } | |
3042 | |
3032 if(thiscinfo && thiscinfo->fore != -1 && thiscinfo->back != -1) | 3043 if(thiscinfo && thiscinfo->fore != -1 && thiscinfo->back != -1) |
3033 { | 3044 { |
3034 int thisback = thiscinfo->back; | 3045 int thisback = thiscinfo->back; |
3035 | 3046 |
3036 /* Handle foreground */ | 3047 /* Handle foreground */ |
3037 if(thiscinfo->fore != DW_CLR_DEFAULT) | 3048 if(thiscinfo->fore != DW_CLR_DEFAULT) |
3038 { | 3049 { |
3039 int fore = _internal_color(thiscinfo->fore); | 3050 int fore = _internal_color(thiscinfo->fore); |
3040 | 3051 |
3041 SetTextColor((HDC)mp1, RGB(DW_RED_VALUE(fore), | 3052 SetTextColor((HDC)mp1, RGB(DW_RED_VALUE(fore), |
3042 DW_GREEN_VALUE(fore), | 3053 DW_GREEN_VALUE(fore), |
3043 DW_BLUE_VALUE(fore))); | 3054 DW_BLUE_VALUE(fore))); |
3044 } | 3055 } |
3045 #ifdef AEROGLASS | 3056 #ifdef AEROGLASS |
5610 NULL, | 5621 NULL, |
5611 DWInstance, | 5622 DWInstance, |
5612 NULL); | 5623 NULL); |
5613 | 5624 |
5614 SetWindowLongPtr(hwndframe, GWLP_USERDATA, (LONG_PTR)newbox); | 5625 SetWindowLongPtr(hwndframe, GWLP_USERDATA, (LONG_PTR)newbox); |
5626 newbox->cinfo.pOldProc = SubclassWindow(hwndframe, _colorwndproc); | |
5615 dw_window_set_font(hwndframe, DefaultFont); | 5627 dw_window_set_font(hwndframe, DefaultFont); |
5616 return hwndframe; | 5628 return hwndframe; |
5617 } | 5629 } |
5618 | 5630 |
5619 /* | 5631 /* |