@@ -75,7 +75,13 @@ pub(crate) fn iced_settings<App: Application>(
75
75
window_settings. resize_border = border_size as u32 ;
76
76
window_settings. resizable = true ;
77
77
}
78
- window_settings. decorations = !settings. client_decorations ;
78
+
79
+ #[ cfg( any( target_os = "windows" , target_os = "macos" ) ) ]
80
+ core. window . client_decorations = settings. client_decorations || crate :: config:: client_decorations ( ) ;
81
+ #[ cfg( target_os = "linux" ) ]
82
+ core. window . client_decorations = settings. client_decorations && crate :: config:: client_decorations ( ) ;
83
+ window_settings. decorations = !core. window . client_decorations ;
84
+
79
85
window_settings. size = settings. size ;
80
86
let min_size = settings. size_limits . min ( ) ;
81
87
if min_size != iced:: Size :: ZERO {
@@ -551,7 +557,7 @@ impl<App: Application> ApplicationExt for App {
551
557
let is_condensed = core. is_condensed ( ) ;
552
558
// TODO: More granularity might be needed for different window border
553
559
// handling of maximized and tiled windows
554
- let sharp_corners = core. window . sharp_corners ;
560
+ let sharp_corners = core. window . sharp_corners || !core . window . client_decorations ;
555
561
let content_container = core. window . content_container ;
556
562
let show_context = core. window . show_context ;
557
563
let nav_bar_active = core. nav_bar_active ( ) ;
@@ -709,7 +715,6 @@ impl<App: Application> ApplicationExt for App {
709
715
let mut header = crate :: widget:: header_bar ( )
710
716
. focused ( focused)
711
717
. maximized ( sharp_corners)
712
- . title ( & core. window . header_title )
713
718
. on_drag ( crate :: Action :: Cosmic ( Action :: Drag ) )
714
719
. on_right_click ( crate :: Action :: Cosmic ( Action :: ShowWindowMenu ) )
715
720
. on_double_click ( crate :: Action :: Cosmic ( Action :: Maximize ) )
@@ -727,19 +732,23 @@ impl<App: Application> ApplicationExt for App {
727
732
728
733
header = header. start ( toggle) ;
729
734
}
735
+ if core. window . client_decorations {
736
+ header = header. title ( & core. window . header_title ) ;
737
+
738
+ if core. window . show_close {
739
+ header = header. on_close ( crate :: Action :: Cosmic ( Action :: Close ) ) ;
740
+ }
730
741
731
- if core. window . show_close {
732
- header = header. on_close ( crate :: Action :: Cosmic ( Action :: Close ) ) ;
733
- }
742
+ if core. window . show_maximize && crate :: config :: show_maximize ( ) {
743
+ header = header. on_maximize ( crate :: Action :: Cosmic ( Action :: Maximize ) ) ;
744
+ }
734
745
735
- if core. window . show_maximize && crate :: config:: show_maximize ( ) {
736
- header = header. on_maximize ( crate :: Action :: Cosmic ( Action :: Maximize ) ) ;
737
- }
746
+ if core. window . show_minimize && crate :: config:: show_minimize ( ) {
747
+ header = header. on_minimize ( crate :: Action :: Cosmic ( Action :: Minimize ) ) ;
748
+ }
738
749
739
- if core. window . show_minimize && crate :: config:: show_minimize ( ) {
740
- header = header. on_minimize ( crate :: Action :: Cosmic ( Action :: Minimize ) ) ;
741
750
}
742
-
751
+
743
752
for element in self . header_start ( ) {
744
753
header = header. start ( element. map ( crate :: Action :: App ) ) ;
745
754
}
0 commit comments