@@ -11,7 +11,8 @@ namespace {
1111///
1212/// Redefined in case the developer's machine has a Windows SDK older than
1313/// version 10.0.22000.0.
14- /// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute
14+ /// See:
15+ /// https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute
1516#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
1617#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
1718#endif
@@ -111,17 +112,14 @@ void WindowClassRegistrar::UnregisterWindowClass() {
111112 class_registered_ = false;
112113}
113114
114- Win32Window::Win32Window() {
115- ++g_active_window_count;
116- }
115+ Win32Window::Win32Window() { ++g_active_window_count; }
117116
118117Win32Window::~Win32Window() {
119118 --g_active_window_count;
120119 Destroy();
121120}
122121
123- bool Win32Window::Create(const std::wstring& title,
124- const Point& origin,
122+ bool Win32Window::Create(const std::wstring& title, const Point& origin,
125123 const Size& size) {
126124 Destroy();
127125
@@ -149,13 +147,10 @@ bool Win32Window::Create(const std::wstring& title,
149147 return OnCreate();
150148}
151149
152- bool Win32Window::Show() {
153- return ShowWindow(window_handle_, SW_SHOWNORMAL);
154- }
150+ bool Win32Window::Show() { return ShowWindow(window_handle_, SW_SHOWNORMAL); }
155151
156152// static
157- LRESULT CALLBACK Win32Window::WndProc(HWND const window,
158- UINT const message,
153+ LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message,
159154 WPARAM const wparam,
160155 LPARAM const lparam) noexcept {
161156 if (message == WM_NCCREATE) {
@@ -174,9 +169,7 @@ LRESULT CALLBACK Win32Window::WndProc(HWND const window,
174169}
175170
176171LRESULT
177- Win32Window::MessageHandler(HWND hwnd,
178- UINT const message,
179- WPARAM const wparam,
172+ Win32Window::MessageHandler(HWND hwnd, UINT const message, WPARAM const wparam,
180173 LPARAM const lparam) noexcept {
181174 switch (message) {
182175 case WM_DESTROY:
@@ -255,9 +248,7 @@ RECT Win32Window::GetClientArea() {
255248 return frame;
256249}
257250
258- HWND Win32Window::GetHandle() {
259- return window_handle_;
260- }
251+ HWND Win32Window::GetHandle() { return window_handle_; }
261252
262253void Win32Window::SetQuitOnClose(bool quit_on_close) {
263254 quit_on_close_ = quit_on_close;
@@ -275,10 +266,10 @@ void Win32Window::OnDestroy() {
275266void Win32Window::UpdateTheme(HWND const window) {
276267 DWORD light_mode;
277268 DWORD light_mode_size = sizeof(light_mode);
278- LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey,
279- kGetPreferredBrightnessRegValue ,
280- RRF_RT_REG_DWORD, nullptr, &light_mode ,
281- &light_mode_size);
269+ LSTATUS result =
270+ RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey ,
271+ kGetPreferredBrightnessRegValue, RRF_RT_REG_DWORD, nullptr,
272+ &light_mode, &light_mode_size);
282273
283274 if (result == ERROR_SUCCESS) {
284275 BOOL enable_dark_mode = light_mode == 0;
0 commit comments