╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ widget.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1633 } 1634 1635 fn textInput(self: *CopyableText) *wgt.TextInput { 1636 return &self.box.children.values()[if (self.choices.len > 1) self.choices.len else 0].widget.text_input; 1637 } 1638 1639 fn selector(self: *CopyableText, index: usize) *wgt.TextBox { 1640 return &self.box.children.values()[index].widget.text_box; 1641 } 1642 1643 fn maxWidth(choices: []const Choice) usize { 1644 var width: usize = 0; 1645 for (choices) |choice| width = @max(width, choice.text.len, choice.label.len, choice.bottom_label.len); 1646 return width; 1647 } 1648 1649 pub fn clearGrid(self: *CopyableText) void { 1650 self.box.clearGrid(); 1651 } 1652 1653 pub fn getGrid(self: CopyableText) ?Grid { 1654 return self.box.getGrid(); 1655 } 1656 1657 pub fn getFocus(self: *CopyableText) *Focus { 1658 return self.box.getFocus(); 1659 } 1660 }; 1661