╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ widget.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1663 } 1664 1665 fn selector(self: *CopyableText, index: usize) *wgt.TextBox { 1666 return &self.box.children.values()[index].widget.text_box; 1667 } 1668 1669 fn maxWidth(choices: []const Choice) usize { 1670 var width: usize = 0; 1671 for (choices) |choice| width = @max(width, choice.text.len, choice.label.len, choice.bottom_label.len); 1672 return width; 1673 } 1674 1675 pub fn clearGrid(self: *CopyableText) void { 1676 self.box.clearGrid(); 1677 } 1678 1679 pub fn getGrid(self: CopyableText) ?Grid { 1680 return self.box.getGrid(); 1681 } 1682 1683 pub fn getFocus(self: *CopyableText) *Focus { 1684 return self.box.getFocus(); 1685 } 1686 }; 1687