Add combobox theme support
@@ -869,6 +869,37 @@ BOOLEAN PhThemeWindowDrawItem(
return TRUE;
}
+ case ODT_COMBOBOX:
+ {
+ WCHAR comboText[MAX_PATH];
+
+ switch (PhpThemeColorMode)
+ {
+ case 0: // New colors
+ SetTextColor(DrawInfo->hDC, GetSysColor(COLOR_WINDOWTEXT));
+ SetDCBrushColor(DrawInfo->hDC, RGB(0xff, 0xff, 0xff));
+ break;
+ case 1: // Old colors
+ SetTextColor(DrawInfo->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
+ SetDCBrushColor(DrawInfo->hDC, RGB(28, 28, 28));
+ break;
+ }
+
+ FillRect(DrawInfo->hDC, &DrawInfo->rcItem, GetStockObject(DC_BRUSH));
+
+ if (ComboBox_GetLBText(DrawInfo->hwndItem, DrawInfo->itemID, (LPARAM)comboText) != CB_ERR)
+ {
+ DrawText(
+ DrawInfo->hDC,
+ comboText,
+ (UINT)PhCountStringZ(comboText),
+ &DrawInfo->rcItem,
+ DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE
+ );
+ }
+ return TRUE;
+ }
+ break;
}
return FALSE;
@@ -1066,11 +1097,12 @@ LRESULT CALLBACK PhpThemeWindowDrawButton(
}
else if ((buttonStyle & BS_CHECKBOX) == BS_CHECKBOX)
{
- HFONT newFont = PhDuplicateFontWithNewHeight(PhApplicationFont, 22);
- oldFont = SelectFont(DrawInfo->hdc, newFont);
if (Button_GetCheck(DrawInfo->hdr.hwndFrom) == BST_CHECKED)
{
+ HFONT newFont = PhDuplicateFontWithNewHeight(PhApplicationFont, 16);
+
+ oldFont = SelectFont(DrawInfo->hdc, newFont);
DrawText(
DrawInfo->hdc,
L"\u2611",
@@ -1078,9 +1110,14 @@ LRESULT CALLBACK PhpThemeWindowDrawButton(
&DrawInfo->rc,
DT_LEFT | DT_SINGLELINE | DT_VCENTER
);
+ SelectFont(DrawInfo->hdc, oldFont);
+ DeleteFont(newFont);
}
else
{
+ HFONT newFont = PhDuplicateFontWithNewHeight(PhApplicationFont, 22);
+
+ oldFont = SelectFont(DrawInfo->hdc, newFont);
DrawText(
DrawInfo->hdc,
L"\u2610",
@@ -1088,10 +1125,9 @@ LRESULT CALLBACK PhpThemeWindowDrawButton(
&DrawInfo->rc,
DT_LEFT | DT_SINGLELINE | DT_VCENTER
);
- }
-
SelectFont(DrawInfo->hdc, oldFont);
DeleteFont(newFont);
+ }
DrawInfo->rc.left += 10;
DrawText(
@@ -1540,6 +1576,7 @@ LRESULT CALLBACK PhpThemeWindowSubclassProc(
case WM_CTLCOLORBTN:
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
+ case WM_CTLCOLORLISTBOX:
{
SetBkMode((HDC)wParam, TRANSPARENT);
