╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
197 else 198 .none, 199 else => .none, 200 }; 201 202 switch (direction) { 203 .up => { 204 switch (child.*) { 205 .repo_header => { 206 try child.input(allocator, key, root_focus); 207 }, 208 .stack => { 209 if (child.stack.getSelected()) |selected_widget| { 210 const at_top = switch (selected_widget.*) { 211 .repo_files => |*v| v.getSelectedIndex() == 0, 212 .repo_commits => |*v| v.getSelectedIndex() == 0, 213 .home_settings => |*v| v.getSelectedIndex() == 0, 214 .home_auth => |*v| v.getSelectedIndex() == 0, 215 .quit => |*v| v.getSelectedIndex() == 0, 216 else => false, 217 }; 218 if (at_top) { 219 index = header_index; 220 } else { 221 try child.input(allocator, key, root_focus); 222 } 223 } 224 }, 225 else => {}, 226 } 227 }, 228 .down => { 229 switch (child.*) { 230 .repo_header => { 231 index = stack_index; 232 }, 233 .stack => { 234 try child.input(allocator, key, root_focus); 235 }, 236 else => {}, 237 } 238 }, 239 .none => { 240 try child.input(allocator, key, root_focus); 241 }, 242 } 243 244 if (index != current_index) { 245 try root_focus.setFocus(self.box.children.keys()[index]); 246 } 247 } 248 } 249 } 250 251 pub fn clearGrid(self: *View) void { 252 self.box.clearGrid(); 253 } 254 255 pub fn getGrid(self: View) ?Grid { 256 return self.box.getGrid(); 257 } 258 259 pub fn getFocus(self: *View) *Focus { 260 return self.box.getFocus(); 261 } 262 }; 263