╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ widget.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2094 } 2095 2096 fn textInput(self: *CopyableText) *wgt.TextInput { 2097 return &self.box.children.values()[if (self.choices.len > 1) self.choices.len else 0].widget.text_input; 2098 } 2099 2100 fn selector(self: *CopyableText, index: usize) *wgt.TextBox { 2101 return &self.box.children.values()[index].widget.text_box; 2102 } 2103 2104 fn maxWidth(choices: []const Choice) usize { 2105 var width: usize = 0; 2106 for (choices) |choice| width = @max(width, choice.text.len, choice.label.len, choice.bottom_label.len); 2107 return width; 2108 } 2109 2110 pub fn clearGrid(self: *CopyableText) void { 2111 self.box.clearGrid(); 2112 } 2113 2114 pub fn getGrid(self: CopyableText) ?Grid { 2115 return self.box.getGrid(); 2116 } 2117 2118 pub fn getFocus(self: *CopyableText) *Focus { 2119 return self.box.getFocus(); 2120 } 2121 }; 2122