Always use the dark window borders (#6624)
This commit is contained in:
parent
951f389210
commit
26d6a37800
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue