╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Files.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
878 self.box.deinit(allocator); 879 } 880 881 pub fn build(self: *Header.View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void { 882 self.clearGrid(); 883 try self.box.build(allocator, constraint, root_focus); 884 } 885 886 pub fn input(self: *Header.View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { 887 const clone_url = self.cloneUrl() orelse return; 888 try clone_url.input(allocator, key, root_focus); 889 } 890 891 pub fn focusCloneUrl(self: *Header.View, root_focus: *Focus) bool { 892 const clone_url = self.cloneUrl() orelse return false; 893 root_focus.setFocus(clone_url.getFocus().id); 894 return true; 895 } 896 897 pub fn hasCloneUrl(self: *Header.View) bool { 898 return self.cloneUrl() != null; 899 } 900 901 fn cloneUrl(self: *Header.View) ?*ui.CopyableText.View { 902 for (self.box.children.values()) |*child| switch (child.widget) { 903 .copyable_text => |*copyable_text| return copyable_text, 904 else => {}, 905 }; 906 return null; 907 } 908 909 pub fn clearGrid(self: *Header.View) void { 910 self.box.clearGrid(); 911 } 912 913 pub fn getGrid(self: Header.View) ?Grid { 914 return self.box.getGrid(); 915 } 916 917 pub fn getFocus(self: *Header.View) *Focus { 918 return self.box.getFocus(); 919 } 920 }; 921 }; 922