@@ -425,6 +425,7 @@ pub enum Message {
425425 SelectAll ( Option < segmented_button:: Entity > ) ,
426426 ShowAdvancedFontSettings ( bool ) ,
427427 ShowHeaderBar ( bool ) ,
428+ ShowPaneBorders ( bool ) ,
428429 SyntaxTheme ( ColorSchemeKind , usize ) ,
429430 SystemThemeChange ,
430431 TabActivate ( segmented_button:: Entity ) ,
@@ -1481,10 +1482,16 @@ impl App {
14811482 font_section = font_section. add ( advanced_font_settings ( ) ) ;
14821483 }
14831484
1484- let splits_section = widget:: settings:: section ( ) . title ( fl ! ( "splits" ) ) . add (
1485- widget:: settings:: item:: builder ( fl ! ( "focus-follow-mouse" ) )
1486- . toggler ( self . config . focus_follow_mouse , Message :: FocusFollowMouse ) ,
1487- ) ;
1485+ let splits_section = widget:: settings:: section ( )
1486+ . title ( fl ! ( "splits" ) )
1487+ . add (
1488+ widget:: settings:: item:: builder ( fl ! ( "focus-follow-mouse" ) )
1489+ . toggler ( self . config . focus_follow_mouse , Message :: FocusFollowMouse ) ,
1490+ )
1491+ . add (
1492+ widget:: settings:: item:: builder ( fl ! ( "show-pane-borders" ) )
1493+ . toggler ( self . config . show_pane_borders , Message :: ShowPaneBorders ) ,
1494+ ) ;
14881495
14891496 let advanced_section = widget:: settings:: section ( ) . title ( fl ! ( "advanced" ) ) . add (
14901497 widget:: settings:: item:: builder ( fl ! ( "show-headerbar" ) )
@@ -2719,6 +2726,11 @@ impl Application for App {
27192726 return self . update_config ( ) ;
27202727 }
27212728 }
2729+ Message :: ShowPaneBorders ( show_pane_borders) => {
2730+ if show_pane_borders != self . config . show_pane_borders {
2731+ config_set ! ( show_pane_borders, show_pane_borders) ;
2732+ }
2733+ }
27222734 Message :: UseBrightBold ( use_bright_bold) => {
27232735 if use_bright_bold != self . config . use_bright_bold {
27242736 config_set ! ( use_bright_bold, use_bright_bold) ;
@@ -3350,8 +3362,22 @@ impl Application for App {
33503362
33513363 /// Creates a view after each update.
33523364 fn view ( & self ) -> Element < ' _ , Self :: Message > {
3353- let cosmic_theme:: Spacing { space_xxs, .. } = self . core ( ) . system_theme ( ) . cosmic ( ) . spacing ;
3354-
3365+ let cosmic = self . core ( ) . system_theme ( ) . cosmic ( ) ;
3366+ let cosmic_theme:: Spacing {
3367+ space_xxxs,
3368+ space_xxs,
3369+ ..
3370+ } = cosmic. spacing ;
3371+
3372+ let show_pane_borders =
3373+ self . config . show_pane_borders && self . pane_model . panes . panes . len ( ) > 1 ;
3374+ let pane_corner_radius: iced:: border:: Radius = {
3375+ let pad = f32:: from ( space_xxxs) / 2.0 ;
3376+ cosmic
3377+ . radius_s ( )
3378+ . map ( |r| if r > 0.0 { r + pad } else { 0.0 } )
3379+ . into ( )
3380+ } ;
33553381 let pane_grid = PaneGrid :: new ( & self . pane_model . panes , |pane, tab_model, _is_maximized| {
33563382 let mut tab_column = widget:: column:: with_capacity ( 1 ) ;
33573383
@@ -3403,7 +3429,8 @@ impl Application for App {
34033429 . opacity ( self . config . opacity_ratio ( ) )
34043430 . padding ( space_xxs)
34053431 . sharp_corners ( self . core . window . sharp_corners )
3406- . show_headerbar ( self . config . show_headerbar ) ;
3432+ . show_headerbar ( self . config . show_headerbar )
3433+ . pane_border_radius ( show_pane_borders. then_some ( pane_corner_radius) ) ;
34073434
34083435 if self . config . focus_follow_mouse {
34093436 terminal_box = terminal_box. on_mouse_enter ( move || Message :: MouseEnter ( pane) ) ;
@@ -3537,7 +3564,21 @@ impl Application for App {
35373564 . on_drag ( Message :: PaneDragged ) ;
35383565
35393566 //TODO: apply window border radius xs at bottom of window
3540- pane_grid. into ( )
3567+ if show_pane_borders {
3568+ let bg_divider = Color :: from ( cosmic. bg_divider ( ) ) ;
3569+ let pane_grid = pane_grid. spacing ( space_xxxs) ;
3570+ widget:: container ( pane_grid)
3571+ . width ( Length :: Fill )
3572+ . height ( Length :: Fill )
3573+ . padding ( space_xxxs)
3574+ . style ( move |_theme| widget:: container:: Style {
3575+ background : Some ( bg_divider. into ( ) ) ,
3576+ ..Default :: default ( )
3577+ } )
3578+ . into ( )
3579+ } else {
3580+ pane_grid. into ( )
3581+ }
35413582 }
35423583
35433584 fn system_theme_update (
0 commit comments