File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
druid-shell/src/backend/windows Expand file tree Collapse file tree 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).
7272- ` WidgetPod::requested_layout ` ([ #2145 ] by [ @xarvic ] )
7373- Make ` Parse ` work better with floats and similar types ([ #2148 ] by [ @superfell ] )
7474- 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 ] )
7576
7677### Changed
7778
@@ -554,6 +555,7 @@ Last release without a changelog :(
554555[ @superfell ] : https://github.com/superfell
555556[ @GoldsteinE ] : https://github.com/GoldsteinE
556557[ @twitchyliquid64 ] : https://github.com/twitchyliquid64
558+ [ @dristic ] : https://github.com/dristic
557559
558560[ #599 ] : https://github.com/linebender/druid/pull/599
559561[ #611 ] : https://github.com/linebender/druid/pull/611
@@ -847,6 +849,7 @@ Last release without a changelog :(
847849[ #2157 ] : https://github.com/linebender/druid/pull/2157
848850[ #2158 ] : https://github.com/linebender/druid/pull/2158
849851[ #2172 ] : https://github.com/linebender/druid/pull/2172
852+ [ #2196 ] : https://github.com/linebender/druid/pull/2196
850853
851854[ Unreleased ] : https://github.com/linebender/druid/compare/v0.7.0...master
852855[ 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::*;
3535use winapi:: shared:: windef:: * ;
3636use winapi:: shared:: winerror:: * ;
3737use winapi:: um:: dcomp:: { IDCompositionDevice , IDCompositionTarget , IDCompositionVisual } ;
38- use winapi:: um:: dwmapi:: DwmExtendFrameIntoClientArea ;
38+ use winapi:: um:: dwmapi:: { DwmExtendFrameIntoClientArea , DwmSetWindowAttribute } ;
3939use winapi:: um:: errhandlingapi:: GetLastError ;
4040use winapi:: um:: shellscalingapi:: MDT_EFFECTIVE_DPI ;
4141use winapi:: um:: unknwnbase:: * ;
@@ -1516,6 +1516,18 @@ impl WindowBuilder {
15161516 }
15171517 }
15181518
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+
15191531 self . app . add_window ( hwnd) ;
15201532
15211533 if let Some ( accels) = accels {
You can’t perform that action at this time.
0 commit comments