[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 */
@ -451,34 +452,59 @@ LRESULT APIENTRY OSK_ThemeHandler(HWND hDlg, NMCUSTOMDRAW *pNmDraw)
*/
if (hTheme)
{
/*
The button could be either in normal state or pushed.
Retrieve its state and save to a variable.
*/
if (pNmDraw->uItemState & CDIS_DEFAULT)
/* Obtain CDDS drawing stages */
switch (pNmDraw->dwDrawStage)
{
iState = PBS_DEFAULTED;
}
else if (pNmDraw->uItemState & CDIS_SELECTED)
{
iState = PBS_PRESSED;
}
else if (pNmDraw->uItemState & CDIS_HOT)
{
iState = PBS_HOT;
}
case CDDS_PREPAINT:
{
/*
The button could be either in normal state or pushed.
Retrieve its state and save to a variable.
*/
if (pNmDraw->uItemState & CDIS_DEFAULT)
{
iState = PBS_DEFAULTED;
}
else if (pNmDraw->uItemState & CDIS_SELECTED)
{
iState = PBS_PRESSED;
}
else if (pNmDraw->uItemState & CDIS_HOT)
{
iState = PBS_HOT;
}
if (IsThemeBackgroundPartiallyTransparent(hTheme, BP_PUSHBUTTON, iState))
{
/* Draw the application if the theme is transparent */
DrawThemeParentBackground(hDlg, pNmDraw->hdc, &pNmDraw->rc);
}
if (IsThemeBackgroundPartiallyTransparent(hTheme, BP_PUSHBUTTON, iState))
{
/* Draw the application if the theme is transparent */
DrawThemeParentBackground(hDlgButtonCtrl, pNmDraw->hdc, &pNmDraw->rc);
}
/* Draw it */
DrawThemeBackground(hTheme, pNmDraw->hdc, BP_PUSHBUTTON, iState, &pNmDraw->rc, NULL);
/* Draw it */
DrawThemeBackground(hTheme, pNmDraw->hdc, BP_PUSHBUTTON, iState, &pNmDraw->rc, NULL);
Ret = CDRF_SKIPDEFAULT;
break;
}
case CDDS_PREERASE:
{
Ret = CDRF_DODEFAULT;
break;
}
default:
Ret = CDRF_SKIPDEFAULT;
break;
}
}
else
{
/* hTheme is NULL so bail right away */
Ret = CDRF_DODEFAULT;
}
return CDRF_SKIPDEFAULT;
return Ret;
}
/***********************************************************************