╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Files.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
849 box: wgt.Box(ui.Widget), 850 data: *const Header, 851 852 pub fn init(allocator: std.mem.Allocator, data: *const Header, session: *ui.Session) !Header.View { 853 _ = session; 854 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .horiz }); 855 errdefer box.deinit(allocator); 856 857 var text_box = try wgt.TextBox(ui.Widget).init(allocator, data.content, .{ .border_style = .hidden, .wrap_kind = .none }); 858 errdefer text_box.deinit(allocator); 859 try box.children.put(allocator, text_box.getFocus().id, .{ .widget = .{ .text_box = text_box }, .rect = null, .min_size = null }); 860 861 return .{ .box = box, .data = data }; 862 } 863 864 pub fn deinit(self: *Header.View, allocator: std.mem.Allocator) void { 865 self.box.deinit(allocator); 866 } 867 868 pub fn build(self: *Header.View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void { 869 self.clearGrid(); 870 try self.box.build(allocator, constraint, root_focus); 871 } 872 873 pub fn input(self: *Header.View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { 874 _ = self; 875 _ = allocator; 876 _ = key; 877 _ = root_focus; 878 } 879 880 pub fn clearGrid(self: *Header.View) void { 881 self.box.clearGrid(); 882 } 883 884 pub fn getGrid(self: Header.View) ?Grid { 885 return self.box.getGrid(); 886 } 887 888 pub fn getFocus(self: *Header.View) *Focus { 889 return self.box.getFocus(); 890 } 891 }; 892 }; 893