this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

widgets!: remove border widget

The border widget functionality is replicated in Window.child

-55
-3
src/widgets.zig
··· 1 1 //! Specialized TUI Widgets 2 2 3 - const opts = @import("build_options"); 4 - 5 - pub const border = @import("widgets/border.zig"); 6 3 pub const alignment = @import("widgets/alignment.zig"); 7 4 pub const Scrollbar = @import("widgets/Scrollbar.zig"); 8 5 pub const Table = @import("widgets/Table.zig");
-52
src/widgets/border.zig
··· 1 - const Cell = @import("../Cell.zig"); 2 - const Window = @import("../Window.zig"); 3 - 4 - const Style = Cell.Style; 5 - const Character = Cell.Character; 6 - 7 - const horizontal = Character{ .grapheme = "─", .width = 1 }; 8 - const vertical = Character{ .grapheme = "│", .width = 1 }; 9 - const top_left = Character{ .grapheme = "╭", .width = 1 }; 10 - const top_right = Character{ .grapheme = "╮", .width = 1 }; 11 - const bottom_right = Character{ .grapheme = "╯", .width = 1 }; 12 - const bottom_left = Character{ .grapheme = "╰", .width = 1 }; 13 - 14 - pub fn all(win: Window, style: Style) Window { 15 - const h = win.height; 16 - const w = win.width; 17 - win.writeCell(0, 0, .{ .char = top_left, .style = style }); 18 - win.writeCell(0, h -| 1, .{ .char = bottom_left, .style = style }); 19 - win.writeCell(w -| 1, 0, .{ .char = top_right, .style = style }); 20 - win.writeCell(w -| 1, h -| 1, .{ .char = bottom_right, .style = style }); 21 - var i: usize = 1; 22 - while (i < (h -| 1)) : (i += 1) { 23 - win.writeCell(0, i, .{ .char = vertical, .style = style }); 24 - win.writeCell(w -| 1, i, .{ .char = vertical, .style = style }); 25 - } 26 - i = 1; 27 - while (i < w -| 1) : (i += 1) { 28 - win.writeCell(i, 0, .{ .char = horizontal, .style = style }); 29 - win.writeCell(i, h -| 1, .{ .char = horizontal, .style = style }); 30 - } 31 - return win.initChild(1, 1, .{ .limit = w -| 2 }, .{ .limit = h -| 2 }); 32 - } 33 - 34 - pub fn right(win: Window, style: Style) Window { 35 - const h = win.height; 36 - const w = win.width; 37 - var i: usize = 0; 38 - while (i < h) : (i += 1) { 39 - win.writeCell(w -| 1, i, .{ .char = vertical, .style = style }); 40 - } 41 - return win.initChild(0, 0, .{ .limit = w -| 1 }, .expand); 42 - } 43 - 44 - pub fn bottom(win: Window, style: Style) Window { 45 - const h = win.height; 46 - const w = win.width; 47 - var i: usize = 0; 48 - while (i < w) : (i += 1) { 49 - win.writeCell(i, h -| 1, .{ .char = horizontal, .style = style }); 50 - } 51 - return win.initChild(0, 0, .expand, .{ .limit = h -| 1 }); 52 - }