Radish alpha
r
Radicle terminal user interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
lib: Support bottom block without top border in imUI
Erik Kundt committed 1 year ago
commit eb87e6fb058613c89335335cc49aab67f6c8803d
parent c0e1d0316776990049c9ea1d2536bce6e56fe531
1 file changed +19 -1
modified src/im.rs
@@ -187,6 +187,7 @@ pub enum Borders {
    Top,
    Sides,
    Bottom,
+
    BottomSides,
}

#[derive(Default, Clone, Debug)]
@@ -1073,11 +1074,28 @@ pub mod widget {

                    let footer_block = FooterBlock::default()
                        .border_style(style)
-
                        .block_type(FooterBlockType::Single);
+
                        .block_type(FooterBlockType::Single { top: true });
                    frame.render_widget(footer_block, area);

                    areas[0]
                }
+
                Borders::BottomSides => {
+
                    let areas = Layout::default()
+
                        .direction(Direction::Vertical)
+
                        .constraints(vec![Constraint::Min(1)])
+
                        .horizontal_margin(1)
+
                        .split(area);
+

+
                    let footer_block = FooterBlock::default()
+
                        .border_style(style)
+
                        .block_type(FooterBlockType::Single { top: false });
+
                    frame.render_widget(footer_block, area);
+

+
                    Rect {
+
                        height: areas[0].height.saturating_sub(1),
+
                        ..areas[0]
+
                    }
+
                }
            }
        } else {
            area