╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Users.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
96 try items.append(aa, .{ 97 .text = try aa.dupe(u8, user.name), 98 .link = try std.fmt.allocPrint(aa, "a:/user/{s}", .{user.name}), 99 }); 100 if (data.next_start) |next_start| 101 try items.append(aa, .{ .text = "next →", .link = try std.fmt.allocPrint(aa, "a:/users/start:{d}", .{next_start}) }); 102 try self.list.setItems(allocator, items.items); 103 104 return self; 105 } 106 107 pub fn deinit(self: *View, allocator: std.mem.Allocator) void { 108 self.list.deinit(allocator); 109 } 110 111 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void { 112 try self.list.build(allocator, constraint, root_focus); 113 } 114 115 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { 116 try self.list.input(allocator, key, root_focus); 117 } 118 119 pub fn clearGrid(self: *View) void { 120 self.list.clearGrid(); 121 } 122 123 pub fn getGrid(self: View) ?Grid { 124 return self.list.getGrid(); 125 } 126 127 pub fn getFocus(self: *View) *Focus { 128 return self.list.getFocus(); 129 } 130 131 pub fn getSelectedIndex(self: View) ?usize { 132 return self.list.getSelectedIndex(); 133 } 134 }; 135