╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
406 switch (direction) { 407 .up => { 408 switch (child.*) { 409 .repo_header => { 410 try child.input(allocator, key, root_focus); 411 }, 412 .stack => { 413 if (child.stack.getSelected()) |selected_widget| { 414 if (selected_widget.atTop(root_focus)) { 415 index = header_index; 416 } else { 417 try child.input(allocator, key, root_focus); 418 } 419 } 420 }, 421 else => {}, 422 } 423 }, 424 .down => { 425 switch (child.*) { 426 .repo_header => { 427 if (stack.getSelected()) |selected_widget| switch (selected_widget.*) { 428 .repo_files => |*v| if (v.focusCloneUrl(root_focus)) return, 429 .repo_commits => |*v| if (v.focusCloneUrl(root_focus)) return, 430 else => {}, 431 }; 432 index = stack_index; 433 }, 434 .stack => { 435 try child.input(allocator, key, root_focus); 436 }, 437 else => {}, 438 } 439 }, 440 .none => { 441 try child.input(allocator, key, root_focus); 442 }, 443 } 444 445 if (index != current_index) { 446 root_focus.setFocus(self.box.children.keys()[index]); 447 } 448 } 449 } 450 } 451 452 pub fn clearGrid(self: *View) void { 453 self.box.clearGrid(); 454 } 455 456 pub fn getGrid(self: View) ?Grid { 457 return self.box.getGrid(); 458 } 459 460 pub fn getFocus(self: *View) *Focus { 461 return self.box.getFocus(); 462 } 463 }; 464