Always use the dark window borders (#6624)

This commit is contained in:
greg904 2020-06-22 17:38:07 +02:00 committed by GitHub
parent 951f389210
commit 26d6a37800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 31 deletions

View file

@ -788,39 +788,15 @@ void NonClientIslandWindow::_UpdateFrameMargins() const noexcept
return ret;
}
// Set the frame's theme before it is rendered (WM_NCPAINT) so that it is
// rendered with the correct theme.
_UpdateFrameTheme();
// This is a hack to make the window borders dark instead of light.
// It must be done before WM_NCPAINT so that the borders are rendered with
// the correct theme.
// For more information, see GH#6620.
LOG_IF_FAILED(TerminalTrySetDarkTheme(_window.get(), true));
return TRUE;
}
// Method Description:
// - Updates the window frame's theme depending on the application theme (light
// or dark). This doesn't invalidate the old frame so it will not be
// rerendered until the user resizes or focuses/unfocuses the window.
// Return Value:
// - <none>
void NonClientIslandWindow::_UpdateFrameTheme() const
{
bool isDarkMode;
switch (_theme)
{
case ElementTheme::Light:
isDarkMode = false;
break;
case ElementTheme::Dark:
isDarkMode = true;
break;
default:
isDarkMode = Application::Current().RequestedTheme() == ApplicationTheme::Dark;
break;
}
LOG_IF_FAILED(TerminalTrySetDarkTheme(_window.get(), isDarkMode));
}
// Method Description:
// - Called when the app wants to change its theme. We'll update the frame
// theme to match the new theme.
@ -833,7 +809,6 @@ void NonClientIslandWindow::OnApplicationThemeChanged(const ElementTheme& reques
IslandWindow::OnApplicationThemeChanged(requestedTheme);
_theme = requestedTheme;
_UpdateFrameTheme();
}
// Method Description:

View file

@ -85,7 +85,6 @@ private:
void _UpdateFrameMargins() const noexcept;
void _UpdateMaximizedState();
void _UpdateIslandPosition(const UINT windowWidth, const UINT windowHeight);
void _UpdateFrameTheme() const;
void _OpenSystemMenu(const int mouseX, const int mouseY) const noexcept;
};