@@ -429,6 +429,7 @@ pub enum Message {
429429 SelectAll ( Option < segmented_button:: Entity > ) ,
430430 ShowAdvancedFontSettings ( bool ) ,
431431 ShowHeaderBar ( bool ) ,
432+ ShowPaneBorders ( bool ) ,
432433 SyntaxTheme ( ColorSchemeKind , usize ) ,
433434 SystemThemeChange ,
434435 TabActivate ( segmented_button:: Entity ) ,
@@ -1478,10 +1479,16 @@ impl App {
14781479 font_section = font_section. add ( advanced_font_settings ( ) ) ;
14791480 }
14801481
1481- let splits_section = widget:: settings:: section ( ) . title ( fl ! ( "splits" ) ) . add (
1482- widget:: settings:: item:: builder ( fl ! ( "focus-follow-mouse" ) )
1483- . toggler ( self . config . focus_follow_mouse , Message :: FocusFollowMouse ) ,
1484- ) ;
1482+ let splits_section = widget:: settings:: section ( )
1483+ . title ( fl ! ( "splits" ) )
1484+ . add (
1485+ widget:: settings:: item:: builder ( fl ! ( "focus-follow-mouse" ) )
1486+ . toggler ( self . config . focus_follow_mouse , Message :: FocusFollowMouse ) ,
1487+ )
1488+ . add (
1489+ widget:: settings:: item:: builder ( fl ! ( "show-pane-borders" ) )
1490+ . toggler ( self . config . show_pane_borders , Message :: ShowPaneBorders ) ,
1491+ ) ;
14851492
14861493 let advanced_section = widget:: settings:: section ( ) . title ( fl ! ( "advanced" ) ) . add (
14871494 widget:: settings:: item:: builder ( fl ! ( "show-headerbar" ) )
@@ -2720,6 +2727,11 @@ impl Application for App {
27202727 return self . update_config ( ) ;
27212728 }
27222729 }
2730+ Message :: ShowPaneBorders ( show_pane_borders) => {
2731+ if show_pane_borders != self . config . show_pane_borders {
2732+ config_set ! ( show_pane_borders, show_pane_borders) ;
2733+ }
2734+ }
27232735 Message :: UseBrightBold ( use_bright_bold) => {
27242736 if use_bright_bold != self . config . use_bright_bold {
27252737 config_set ! ( use_bright_bold, use_bright_bold) ;
@@ -3248,8 +3260,22 @@ impl Application for App {
32483260
32493261 /// Creates a view after each update.
32503262 fn view ( & self ) -> Element < ' _ , Self :: Message > {
3251- let cosmic_theme:: Spacing { space_xxs, .. } = self . core ( ) . system_theme ( ) . cosmic ( ) . spacing ;
3252-
3263+ let cosmic = self . core ( ) . system_theme ( ) . cosmic ( ) ;
3264+ let cosmic_theme:: Spacing {
3265+ space_xxxs,
3266+ space_xxs,
3267+ ..
3268+ } = cosmic. spacing ;
3269+
3270+ let show_pane_borders =
3271+ self . config . show_pane_borders && self . pane_model . panes . panes . len ( ) > 1 ;
3272+ let pane_corner_radius: iced:: border:: Radius = {
3273+ let pad = f32:: from ( space_xxxs) / 2.0 ;
3274+ cosmic
3275+ . radius_s ( )
3276+ . map ( |r| if r > 0.0 { r + pad } else { 0.0 } )
3277+ . into ( )
3278+ } ;
32533279 let pane_grid = PaneGrid :: new ( & self . pane_model . panes , |pane, tab_model, _is_maximized| {
32543280 let mut tab_column = widget:: column:: with_capacity ( 1 ) ;
32553281
@@ -3301,7 +3327,8 @@ impl Application for App {
33013327 . opacity ( self . config . opacity_ratio ( ) )
33023328 . padding ( space_xxs)
33033329 . sharp_corners ( self . core . window . sharp_corners )
3304- . show_headerbar ( self . config . show_headerbar ) ;
3330+ . show_headerbar ( self . config . show_headerbar )
3331+ . pane_border_radius ( show_pane_borders. then_some ( pane_corner_radius) ) ;
33053332
33063333 if self . config . focus_follow_mouse {
33073334 terminal_box = terminal_box. on_mouse_enter ( move || Message :: MouseEnter ( pane) ) ;
@@ -3412,7 +3439,21 @@ impl Application for App {
34123439 . on_drag ( Message :: PaneDragged ) ;
34133440
34143441 //TODO: apply window border radius xs at bottom of window
3415- pane_grid. into ( )
3442+ if show_pane_borders {
3443+ let bg_divider = Color :: from ( cosmic. bg_divider ( ) ) ;
3444+ let pane_grid = pane_grid. spacing ( space_xxxs) ;
3445+ widget:: container ( pane_grid)
3446+ . width ( Length :: Fill )
3447+ . height ( Length :: Fill )
3448+ . padding ( space_xxxs)
3449+ . style ( move |_theme| widget:: container:: Style {
3450+ background : Some ( bg_divider. into ( ) ) ,
3451+ ..Default :: default ( )
3452+ } )
3453+ . into ( )
3454+ } else {
3455+ pane_grid. into ( )
3456+ }
34163457 }
34173458
34183459 fn system_theme_update (
0 commit comments