mirror of
https://github.com/valinet/ExplorerPatcher.git
synced 2025-02-17 11:08:41 +01:00
Weather: Support for high contrast themes
This commit is contained in:
parent
087c3a674a
commit
668c234207
@ -4207,7 +4207,7 @@ __int64 __fastcall PeopleBand_DrawTextWithGlowHook(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rgbColor = GetSysColor(COLOR_WINDOWTEXT);
|
rgbColor = GetSysColor(COLOR_BTNTEXT);
|
||||||
}
|
}
|
||||||
HFONT hOldFont = SelectFont(hDC, hFont);
|
HFONT hOldFont = SelectFont(hDC, hFont);
|
||||||
if (bEmptyData)
|
if (bEmptyData)
|
||||||
|
@ -789,6 +789,24 @@ LRESULT CALLBACK epw_Weather_WindowProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPA
|
|||||||
{
|
{
|
||||||
if (IsColorSchemeChangeMessage(lParam))
|
if (IsColorSchemeChangeMessage(lParam))
|
||||||
{
|
{
|
||||||
|
MARGINS marGlassInset;
|
||||||
|
if (!IsHighContrast())
|
||||||
|
{
|
||||||
|
marGlassInset.cxLeftWidth = -1; // -1 means the whole window
|
||||||
|
marGlassInset.cxRightWidth = -1;
|
||||||
|
marGlassInset.cyBottomHeight = -1;
|
||||||
|
marGlassInset.cyTopHeight = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
marGlassInset.cxLeftWidth = 0;
|
||||||
|
marGlassInset.cxRightWidth = 0;
|
||||||
|
marGlassInset.cyBottomHeight = 0;
|
||||||
|
marGlassInset.cyTopHeight = 0;
|
||||||
|
}
|
||||||
|
DwmExtendFrameIntoClientArea(_this->hWnd, &marGlassInset);
|
||||||
|
BOOL value = (IsThemeActive() && !IsHighContrast()) ? 1 : 0;
|
||||||
|
DwmSetWindowAttribute(hWnd, 1029, &value, sizeof(BOOL));
|
||||||
LONG64 dwDarkMode = InterlockedAdd64(&_this->g_darkModeEnabled, 0);
|
LONG64 dwDarkMode = InterlockedAdd64(&_this->g_darkModeEnabled, 0);
|
||||||
if (!dwDarkMode)
|
if (!dwDarkMode)
|
||||||
{
|
{
|
||||||
@ -990,10 +1008,13 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
MARGINS marGlassInset = { -1, -1, -1, -1 }; // -1 means the whole window
|
if (!IsHighContrast())
|
||||||
DwmExtendFrameIntoClientArea(_this->hWnd, &marGlassInset);
|
{
|
||||||
BOOL value = 1;
|
MARGINS marGlassInset = { -1, -1, -1, -1 }; // -1 means the whole window
|
||||||
DwmSetWindowAttribute(_this->hWnd, 1029, &value, sizeof(BOOL));
|
DwmExtendFrameIntoClientArea(_this->hWnd, &marGlassInset);
|
||||||
|
BOOL value = 1;
|
||||||
|
DwmSetWindowAttribute(_this->hWnd, 1029, &value, sizeof(BOOL));
|
||||||
|
}
|
||||||
LONG64 dwDarkMode = InterlockedAdd64(&_this->g_darkModeEnabled, 0);
|
LONG64 dwDarkMode = InterlockedAdd64(&_this->g_darkModeEnabled, 0);
|
||||||
epw_Weather_SetDarkMode(_this, dwDarkMode, FALSE);
|
epw_Weather_SetDarkMode(_this, dwDarkMode, FALSE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user