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