From 7db582b4f31d92c7071e07c7e82cca65c5f942ae Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 5 Mar 2024 15:46:30 -0600 Subject: [PATCH] border: add bottom border Signed-off-by: Tim Culverhouse --- src/widgets/border.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/widgets/border.zig b/src/widgets/border.zig index 8614cd7..f7e3de3 100644 --- a/src/widgets/border.zig +++ b/src/widgets/border.zig @@ -40,3 +40,13 @@ pub fn right(win: Window, style: Style) Window { } return win.initChild(0, 0, .{ .limit = w - 1 }, .expand); } + +pub fn bottom(win: Window, style: Style) Window { + const h = win.height; + const w = win.width; + var i: usize = 0; + while (i < w) : (i += 1) { + win.writeCell(i, h - 1, .{ .char = horizontal, .style = style }); + } + return win.initChild(0, 0, .expand, .{ .limit = h - 1 }); +}