@@ -75,7 +75,14 @@ pub(crate) fn iced_settings<App: Application>(
7575 window_settings. resize_border = border_size as u32 ;
7676 window_settings. resizable = true ;
7777 }
78- window_settings. decorations = !settings. client_decorations ;
78+
79+ core. window . client_decorations = if cfg ! ( any( target_os = "windows" , target_os = "macos" ) ) {
80+ settings. client_decorations || crate :: config:: client_decorations ( )
81+ } else {
82+ settings. client_decorations && crate :: config:: client_decorations ( )
83+ } ;
84+ window_settings. decorations = !core. window . client_decorations ;
85+
7986 window_settings. size = settings. size ;
8087 let min_size = settings. size_limits . min ( ) ;
8188 if min_size != iced:: Size :: ZERO {
@@ -551,7 +558,7 @@ impl<App: Application> ApplicationExt for App {
551558 let is_condensed = core. is_condensed ( ) ;
552559 // TODO: More granularity might be needed for different window border
553560 // handling of maximized and tiled windows
554- let sharp_corners = core. window . sharp_corners ;
561+ let sharp_corners = core. window . sharp_corners || !core . window . client_decorations ;
555562 let content_container = core. window . content_container ;
556563 let show_context = core. window . show_context ;
557564 let nav_bar_active = core. nav_bar_active ( ) ;
@@ -709,7 +716,6 @@ impl<App: Application> ApplicationExt for App {
709716 let mut header = crate :: widget:: header_bar ( )
710717 . focused ( focused)
711718 . maximized ( sharp_corners)
712- . title ( & core. window . header_title )
713719 . on_drag ( crate :: Action :: Cosmic ( Action :: Drag ) )
714720 . on_right_click ( crate :: Action :: Cosmic ( Action :: ShowWindowMenu ) )
715721 . on_double_click ( crate :: Action :: Cosmic ( Action :: Maximize ) )
@@ -727,19 +733,23 @@ impl<App: Application> ApplicationExt for App {
727733
728734 header = header. start ( toggle) ;
729735 }
736+ if core. window . client_decorations {
737+ header = header. title ( & core. window . header_title ) ;
738+
739+ if core. window . show_close {
740+ header = header. on_close ( crate :: Action :: Cosmic ( Action :: Close ) ) ;
741+ }
730742
731- if core. window . show_close {
732- header = header. on_close ( crate :: Action :: Cosmic ( Action :: Close ) ) ;
733- }
743+ if core. window . show_maximize && crate :: config :: show_maximize ( ) {
744+ header = header. on_maximize ( crate :: Action :: Cosmic ( Action :: Maximize ) ) ;
745+ }
734746
735- if core. window . show_maximize && crate :: config:: show_maximize ( ) {
736- header = header. on_maximize ( crate :: Action :: Cosmic ( Action :: Maximize ) ) ;
737- }
747+ if core. window . show_minimize && crate :: config:: show_minimize ( ) {
748+ header = header. on_minimize ( crate :: Action :: Cosmic ( Action :: Minimize ) ) ;
749+ }
738750
739- if core. window . show_minimize && crate :: config:: show_minimize ( ) {
740- header = header. on_minimize ( crate :: Action :: Cosmic ( Action :: Minimize ) ) ;
741751 }
742-
752+
743753 for element in self . header_start ( ) {
744754 header = header. start ( element. map ( crate :: Action :: App ) ) ;
745755 }
0 commit comments