Make dialog theme texture setting non-global (ie a per-window
setting).
This commit is contained in:
parent
41718267be
commit
5bb8f968f6
|
@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
|
|||
* Defines and global variables
|
||||
*/
|
||||
|
||||
DWORD dwDialogTextureFlags;
|
||||
extern ATOM atDialogThemeEnabled;
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
|
@ -50,8 +50,19 @@ DWORD dwDialogTextureFlags;
|
|||
*/
|
||||
HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
|
||||
{
|
||||
static const WCHAR szTab[] = { 'T','a','b',0 };
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,0x%08lx\n", hwnd, dwFlags);
|
||||
dwDialogTextureFlags = dwFlags;
|
||||
hr = SetPropW (hwnd, MAKEINTATOMW (atDialogThemeEnabled),
|
||||
(HANDLE)(dwFlags|0x80000000));
|
||||
/* 0x80000000 serves as a "flags set" flag */
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
if (dwFlags & ETDT_USETABTEXTURE)
|
||||
return SetWindowTheme (hwnd, NULL, szTab);
|
||||
else
|
||||
return SetWindowTheme (hwnd, NULL, NULL);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -60,7 +71,15 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
|
|||
*/
|
||||
BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
|
||||
{
|
||||
DWORD dwDialogTextureFlags;
|
||||
TRACE("(%p)\n", hwnd);
|
||||
|
||||
dwDialogTextureFlags = (DWORD)GetPropW (hwnd,
|
||||
MAKEINTATOMW (atDialogThemeEnabled));
|
||||
if (dwDialogTextureFlags == 0)
|
||||
/* Means EnableThemeDialogTexture wasn't called for this dialog */
|
||||
return TRUE;
|
||||
|
||||
return (dwDialogTextureFlags & ETDT_ENABLE) && !(dwDialogTextureFlags & ETDT_DISABLE);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ DWORD dwThemeAppProperties = STAP_ALLOW_NONCLIENT | STAP_ALLOW_CONTROLS;
|
|||
ATOM atWindowTheme;
|
||||
ATOM atSubAppName;
|
||||
ATOM atSubIdList;
|
||||
ATOM atDialogThemeEnabled;
|
||||
|
||||
BOOL bThemeActive = FALSE;
|
||||
WCHAR szCurrentTheme[MAX_PATH];
|
||||
|
@ -224,12 +225,16 @@ void UXTHEME_InitSystem(HINSTANCE hInst)
|
|||
static const WCHAR szSubIdList[] = {
|
||||
'u','x','_','s','u','b','i','d','l','s','t','\0'
|
||||
};
|
||||
static const WCHAR szDialogThemeEnabled[] = {
|
||||
'u','x','_','d','i','a','l','o','g','t','h','e','m','e','\0'
|
||||
};
|
||||
|
||||
hDllInst = hInst;
|
||||
|
||||
atWindowTheme = GlobalAddAtomW(szWindowTheme);
|
||||
atSubAppName = GlobalAddAtomW(szSubAppName);
|
||||
atSubIdList = GlobalAddAtomW(szSubIdList);
|
||||
atWindowTheme = GlobalAddAtomW(szWindowTheme);
|
||||
atSubAppName = GlobalAddAtomW(szSubAppName);
|
||||
atSubIdList = GlobalAddAtomW(szSubIdList);
|
||||
atDialogThemeEnabled = GlobalAddAtomW(szDialogThemeEnabled);
|
||||
|
||||
UXTHEME_LoadTheme();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue