╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ widget.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1990 self.session.host_request = .{ .show_copyable_text = choice.copyable_text orelse choice.text }; 1991 } 1992 1993 fn textInput(self: *CopyableText) *wgt.TextInput { 1994 return &self.box.children.values()[if (self.choices.len > 1) self.choices.len else 0].widget.text_input; 1995 } 1996 1997 fn selector(self: *CopyableText, index: usize) *wgt.TextBox { 1998 return &self.box.children.values()[index].widget.text_box; 1999 } 2000 2001 fn maxWidth(choices: []const Choice) usize { 2002 var width: usize = 0; 2003 for (choices) |choice| width = @max(width, choice.text.len, choice.label.len, choice.bottom_label.len); 2004 return width; 2005 } 2006 2007 pub fn clearGrid(self: *CopyableText) void { 2008 self.box.clearGrid(); 2009 } 2010 2011 pub fn getGrid(self: CopyableText) ?Grid { 2012 return self.box.getGrid(); 2013 } 2014 2015 pub fn getFocus(self: *CopyableText) *Focus { 2016 return self.box.getFocus(); 2017 } 2018 }; 2019