Commit 01d5bda 1 parent 0656497 commit 01d5bda Copy full SHA for 01d5bda
File tree 2 files changed +16
-1
lines changed
druid-shell/src/backend/windows
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ You can find its changes [documented below](#070---2021-01-01).
72
72
- ` WidgetPod::requested_layout ` ([ #2145 ] by [ @xarvic ] )
73
73
- Make ` Parse ` work better with floats and similar types ([ #2148 ] by [ @superfell ] )
74
74
- Added ` compute_max_intrinsic ` method to the ` Widget ` trait, which determines the maximum useful dimension of the widget ([ #2172 ] by [ @sjoshid ] )
75
+ - Windows: Dark mode support for the title bar ([ #2196 ] by [ @dristic ] )
75
76
76
77
### Changed
77
78
@@ -554,6 +555,7 @@ Last release without a changelog :(
554
555
[ @superfell ] : https://github.com/superfell
555
556
[ @GoldsteinE ] : https://github.com/GoldsteinE
556
557
[ @twitchyliquid64 ] : https://github.com/twitchyliquid64
558
+ [ @dristic ] : https://github.com/dristic
557
559
558
560
[ #599 ] : https://github.com/linebender/druid/pull/599
559
561
[ #611 ] : https://github.com/linebender/druid/pull/611
@@ -847,6 +849,7 @@ Last release without a changelog :(
847
849
[ #2157 ] : https://github.com/linebender/druid/pull/2157
848
850
[ #2158 ] : https://github.com/linebender/druid/pull/2158
849
851
[ #2172 ] : https://github.com/linebender/druid/pull/2172
852
+ [ #2196 ] : https://github.com/linebender/druid/pull/2196
850
853
851
854
[ Unreleased ] : https://github.com/linebender/druid/compare/v0.7.0...master
852
855
[ 0.7.0 ] : https://github.com/linebender/druid/compare/v0.6.0...v0.7.0
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ use winapi::shared::minwindef::*;
35
35
use winapi:: shared:: windef:: * ;
36
36
use winapi:: shared:: winerror:: * ;
37
37
use winapi:: um:: dcomp:: { IDCompositionDevice , IDCompositionTarget , IDCompositionVisual } ;
38
- use winapi:: um:: dwmapi:: DwmExtendFrameIntoClientArea ;
38
+ use winapi:: um:: dwmapi:: { DwmExtendFrameIntoClientArea , DwmSetWindowAttribute } ;
39
39
use winapi:: um:: errhandlingapi:: GetLastError ;
40
40
use winapi:: um:: shellscalingapi:: MDT_EFFECTIVE_DPI ;
41
41
use winapi:: um:: unknwnbase:: * ;
@@ -1516,6 +1516,18 @@ impl WindowBuilder {
1516
1516
}
1517
1517
}
1518
1518
1519
+ // Dark mode support
1520
+ // https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/apply-windows-themes
1521
+ const DWMWA_USE_IMMERSIVE_DARK_MODE : u32 = 20 ;
1522
+ let value: BOOL = 1 ;
1523
+ let value_ptr = & value as * const _ as * const c_void ;
1524
+ DwmSetWindowAttribute (
1525
+ hwnd,
1526
+ DWMWA_USE_IMMERSIVE_DARK_MODE ,
1527
+ value_ptr,
1528
+ std:: mem:: size_of :: < BOOL > ( ) as u32 ,
1529
+ ) ;
1530
+
1519
1531
self . app . add_window ( hwnd) ;
1520
1532
1521
1533
if let Some ( accels) = accels {
You can’t perform that action at this time.
0 commit comments