╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ CloneUrl.zig ─────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
139 .mouse => |mouse| blk: { 140 for (0..self.protocol_count) |i| { 141 if (inp.leftClickOn(root_focus, self.protocolLabel(i).getFocus().id, mouse)) break :blk i; 142 } 143 if (self.session.is_terminal and !mouse.ctrl and inp.leftClickOn(root_focus, self.urlInput().getFocus().id, mouse)) 144 self.session.host_request = .{ .show_copyable_text = self.protocols[self.selected].copyable_text }; 145 return; 146 }, 147 else => return, 148 }; 149 self.selected = next; 150 try self.urlInput().setContent(allocator, self.protocols[next].url); 151 } 152 153 fn urlInput(self: *View) *wgt.TextInput(ui.Widget) { 154 return &self.box.children.values()[self.protocol_count].widget.text_input; 155 } 156 157 fn protocolLabel(self: *View, index: usize) *wgt.TextBox(ui.Widget) { 158 return &self.box.children.values()[index].widget.text_box; 159 } 160 161 pub fn clearGrid(self: *View) void { 162 self.box.clearGrid(); 163 } 164 165 pub fn getGrid(self: View) ?Grid { 166 return self.box.getGrid(); 167 } 168 169 pub fn getFocus(self: *View) *Focus { 170 return self.box.getFocus(); 171 } 172 }; 173