[OSK] Hotfix for PR #1536 (#1549)

CORE-15965
This commit is contained in:
Bișoc George 2019-05-01 10:33:13 +02:00 committed by Hermès Bélusca-Maïto
parent 575ab6c760
commit f8b90805ff
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -439,6 +439,7 @@ LRESULT APIENTRY OSK_ThemeHandler(HWND hDlg, NMCUSTOMDRAW *pNmDraw)
{
HTHEME hTheme;
HWND hDlgButtonCtrl;
LRESULT Ret;
INT iState = PBS_NORMAL;
/* Retrieve the theme handle for the button controls */
@ -450,6 +451,11 @@ LRESULT APIENTRY OSK_ThemeHandler(HWND hDlg, NMCUSTOMDRAW *pNmDraw)
the theme for control buttons of the dialog.
*/
if (hTheme)
{
/* Obtain CDDS drawing stages */
switch (pNmDraw->dwDrawStage)
{
case CDDS_PREPAINT:
{
/*
The button could be either in normal state or pushed.
@ -471,14 +477,34 @@ LRESULT APIENTRY OSK_ThemeHandler(HWND hDlg, NMCUSTOMDRAW *pNmDraw)
if (IsThemeBackgroundPartiallyTransparent(hTheme, BP_PUSHBUTTON, iState))
{
/* Draw the application if the theme is transparent */
DrawThemeParentBackground(hDlg, pNmDraw->hdc, &pNmDraw->rc);
DrawThemeParentBackground(hDlgButtonCtrl, pNmDraw->hdc, &pNmDraw->rc);
}
/* Draw it */
DrawThemeBackground(hTheme, pNmDraw->hdc, BP_PUSHBUTTON, iState, &pNmDraw->rc, NULL);
Ret = CDRF_SKIPDEFAULT;
break;
}
return CDRF_SKIPDEFAULT;
case CDDS_PREERASE:
{
Ret = CDRF_DODEFAULT;
break;
}
default:
Ret = CDRF_SKIPDEFAULT;
break;
}
}
else
{
/* hTheme is NULL so bail right away */
Ret = CDRF_DODEFAULT;
}
return Ret;
}
/***********************************************************************