╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ widget.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2050 2051 fn selector(self: *CopyableText, index: usize) *wgt.TextBox { 2052 return &self.box.children.values()[index].widget.text_box; 2053 } 2054 2055 fn maxWidth(choices: []const Choice) usize { 2056 var width: usize = 0; 2057 for (choices) |choice| width = @max(width, choice.text.len, choice.label.len, choice.bottom_label.len); 2058 return width; 2059 } 2060 2061 pub fn clearGrid(self: *CopyableText) void { 2062 self.box.clearGrid(); 2063 } 2064 2065 pub fn getGrid(self: CopyableText) ?Grid { 2066 return self.box.getGrid(); 2067 } 2068 2069 pub fn getFocus(self: *CopyableText) *Focus { 2070 return self.box.getFocus(); 2071 } 2072 }; 2073