Mercurial > dwindows
comparison win/XBrowseForFolder.cpp @ 2141:709f8bfa711f
Win: Fix a problem where full dark mode was functioning as forced.
Added sysmenu and icon for the window menu when operating in full dark mode.
I can't seem to convert from a menubar to a popup menu... will keep looking but...
because of this we will need to use the titlebar menu even in light mode when
full dark mode is enabled. When dark mode is disabled or basic will use the
classic menu bar. Also prefix some of the internal dark mode functions.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 16 Jul 2020 20:47:15 +0000 |
parents | d39f4f9bed26 |
children | 2e804b4db81e |
comparison
equal
deleted
inserted
replaced
2140:b6e09fb597aa | 2141:709f8bfa711f |
---|---|
214 #ifdef AEROGLASS | 214 #ifdef AEROGLASS |
215 extern "C" { | 215 extern "C" { |
216 /* Include necessary variables and prototypes from dw.c */ | 216 /* Include necessary variables and prototypes from dw.c */ |
217 extern int _DW_DARK_MODE_SUPPORTED; | 217 extern int _DW_DARK_MODE_SUPPORTED; |
218 extern int _DW_DARK_MODE_ENABLED; | 218 extern int _DW_DARK_MODE_ENABLED; |
219 extern BOOL (WINAPI * _ShouldAppsUseDarkMode)(VOID); | 219 extern BOOL (WINAPI * _DW_ShouldAppsUseDarkMode)(VOID); |
220 | 220 |
221 BOOL IsHighContrast(VOID); | 221 BOOL _DW_IsHighContrast(VOID); |
222 BOOL IsColorSchemeChangeMessage(LPARAM lParam); | 222 BOOL _DW_IsColorSchemeChangeMessage(LPARAM lParam); |
223 void RefreshTitleBarThemeColor(HWND window); | 223 void _DW_RefreshTitleBarThemeColor(HWND window); |
224 BOOL CALLBACK _dw_set_child_window_theme(HWND window, LPARAM lParam); | 224 BOOL CALLBACK _dw_set_child_window_theme(HWND window, LPARAM lParam); |
225 } | 225 } |
226 #endif | 226 #endif |
227 | 227 |
228 /////////////////////////////////////////////////////////////////////////////// | 228 /////////////////////////////////////////////////////////////////////////////// |
237 switch (uMsg) | 237 switch (uMsg) |
238 { | 238 { |
239 #ifdef AEROGLASS | 239 #ifdef AEROGLASS |
240 case WM_SETTINGCHANGE: | 240 case WM_SETTINGCHANGE: |
241 { | 241 { |
242 if(_DW_DARK_MODE_SUPPORTED && IsColorSchemeChangeMessage(lpData)) | 242 if(_DW_DARK_MODE_SUPPORTED && _DW_IsColorSchemeChangeMessage(lpData)) |
243 { | 243 { |
244 _DW_DARK_MODE_ENABLED = _ShouldAppsUseDarkMode() && !IsHighContrast(); | 244 _DW_DARK_MODE_ENABLED = _DW_ShouldAppsUseDarkMode() && !_DW_IsHighContrast(); |
245 | 245 |
246 RefreshTitleBarThemeColor(hWnd); | 246 _DW_RefreshTitleBarThemeColor(hWnd); |
247 _dw_set_child_window_theme(hWnd, 0); | 247 _dw_set_child_window_theme(hWnd, 0); |
248 EnumChildWindows(hWnd, _dw_set_child_window_theme, 0); | 248 EnumChildWindows(hWnd, _dw_set_child_window_theme, 0); |
249 } | 249 } |
250 } | 250 } |
251 break; | 251 break; |
279 #ifdef AEROGLASS | 279 #ifdef AEROGLASS |
280 if(_DW_DARK_MODE_SUPPORTED) | 280 if(_DW_DARK_MODE_SUPPORTED) |
281 { | 281 { |
282 _dw_set_child_window_theme(hWnd, 0); | 282 _dw_set_child_window_theme(hWnd, 0); |
283 EnumChildWindows(hWnd, _dw_set_child_window_theme, 0); | 283 EnumChildWindows(hWnd, _dw_set_child_window_theme, 0); |
284 RefreshTitleBarThemeColor(hWnd); | 284 _DW_RefreshTitleBarThemeColor(hWnd); |
285 } | 285 } |
286 #endif | 286 #endif |
287 SizeBrowseDialog(hWnd, fp); | 287 SizeBrowseDialog(hWnd, fp); |
288 } | 288 } |
289 break; | 289 break; |