From 176badf36e68659cde4f781b61cdf7d34043ed60 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett (MSFT)" Date: Tue, 24 Mar 2020 12:47:01 -0700 Subject: [PATCH] Make the window border actually follow the user's theme (#5105) ## Summary of the Pull Request One of our great contributors already hooked up all the logic for this, we just needed a theme library that could handle the request. ## PR Checklist * [x] Fixes #4980 * [x] CLA signed * [x] Tests added/passed * [ ] Requires documentation to be updated --- src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp | 6 +----- src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj | 4 ++-- src/cascadia/WindowsTerminal/packages.config | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp b/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp index 264efcd51..d1130a9a1 100644 --- a/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp +++ b/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp @@ -5,7 +5,6 @@ ********************************************************/ #include "pch.h" #include "NonClientIslandWindow.h" -#include "../types/inc/ThemeUtils.h" #include "../types/inc/utils.hpp" #include "TerminalThemeHelpers.h" @@ -568,9 +567,6 @@ void NonClientIslandWindow::_UpdateFrameMargins() const noexcept return _OnNcHitTest({ GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }); case WM_PAINT: return _OnPaint(); - case WM_ACTIVATE: - // If we do this every time we're activated, it should be close enough to correct. - TerminalTrySetDarkTheme(_window.get()); } return IslandWindow::MessageHandler(message, wParam, lParam); @@ -688,7 +684,7 @@ void NonClientIslandWindow::_UpdateFrameTheme() const break; } - LOG_IF_FAILED(ThemeUtils::SetWindowFrameDarkMode(_window.get(), isDarkMode)); + LOG_IF_FAILED(TerminalTrySetDarkTheme(_window.get(), isDarkMode)); } // Method Description: diff --git a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj index c25ecefa2..475e19cab 100644 --- a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj +++ b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj @@ -112,7 +112,7 @@ - +