╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Commits.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
782 try self.box.build(allocator, constraint, root_focus); 783 } 784 785 pub fn input(self: *Header.View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { 786 const clone_url = self.cloneUrl() orelse return; 787 try clone_url.input(allocator, key, root_focus); 788 } 789 790 pub fn focusCloneUrl(self: *Header.View, root_focus: *Focus) bool { 791 const clone_url = self.cloneUrl() orelse return false; 792 root_focus.setFocus(clone_url.getFocus().id); 793 return true; 794 } 795 796 pub fn hasCloneUrl(self: *Header.View) bool { 797 return self.cloneUrl() != null; 798 } 799 800 fn cloneUrl(self: *Header.View) ?*ui.widget.CopyableText { 801 for (self.box.children.values()) |*child| switch (child.widget) { 802 .copyable_text => |*copyable_text| return copyable_text, 803 else => {}, 804 }; 805 return null; 806 } 807 808 pub fn clearGrid(self: *Header.View) void { 809 self.box.clearGrid(); 810 } 811 812 pub fn getGrid(self: Header.View) ?Grid { 813 return self.box.getGrid(); 814 } 815 816 pub fn getFocus(self: *Header.View) *Focus { 817 return self.box.getFocus(); 818 } 819 }; 820 }; 821