From 9dae25696001ac37b3a83a44d2c82ba7b3a05d02 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 1 Mar 2024 12:27:49 -0600 Subject: [PATCH] border: add right 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 e8a710b..8614cd7 100644 --- a/src/widgets/border.zig +++ b/src/widgets/border.zig @@ -30,3 +30,13 @@ pub fn all(win: Window, style: Style) Window { } return win.initChild(1, 1, .{ .limit = w - 2 }, .{ .limit = h - 2 }); } + +pub fn right(win: Window, style: Style) Window { + const h = win.height; + const w = win.width; + var i: usize = 0; + while (i < h) : (i += 1) { + win.writeCell(w - 1, i, .{ .char = vertical, .style = style }); + } + return win.initChild(0, 0, .{ .limit = w - 1 }, .expand); +}