@@ -75,7 +75,14 @@ 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
+ 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
+
79
86
window_settings. size = settings. size ;
80
87
let min_size = settings. size_limits . min ( ) ;
81
88
if min_size != iced:: Size :: ZERO {
@@ -551,7 +558,7 @@ impl<App: Application> ApplicationExt for App {
551
558
let is_condensed = core. is_condensed ( ) ;
552
559
// TODO: More granularity might be needed for different window border
553
560
// 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 ;
555
562
let content_container = core. window . content_container ;
556
563
let show_context = core. window . show_context ;
557
564
let nav_bar_active = core. nav_bar_active ( ) ;
@@ -709,7 +716,6 @@ impl<App: Application> ApplicationExt for App {
709
716
let mut header = crate :: widget:: header_bar ( )
710
717
. focused ( focused)
711
718
. maximized ( sharp_corners)
712
- . title ( & core. window . header_title )
713
719
. on_drag ( crate :: Action :: Cosmic ( Action :: Drag ) )
714
720
. on_right_click ( crate :: Action :: Cosmic ( Action :: ShowWindowMenu ) )
715
721
. on_double_click ( crate :: Action :: Cosmic ( Action :: Maximize ) )
@@ -727,19 +733,23 @@ impl<App: Application> ApplicationExt for App {
727
733
728
734
header = header. start ( toggle) ;
729
735
}
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
+ }
730
742
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
+ }
734
746
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
+ }
738
750
739
- if core. window . show_minimize && crate :: config:: show_minimize ( ) {
740
- header = header. on_minimize ( crate :: Action :: Cosmic ( Action :: Minimize ) ) ;
741
751
}
742
-
752
+
743
753
for element in self . header_start ( ) {
744
754
header = header. start ( element. map ( crate :: Action :: App ) ) ;
745
755
}
0 commit comments