╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
361 .stack => { 362 if (child.stack.getSelected()) |selected_widget| { 363 const at_top = switch (selected_widget.*) { 364 .repo_files => |*v| v.getSelectedIndex() == 0, 365 .repo_commits => |*v| v.getSelectedIndex() == 0, 366 .repo_refs => |*v| v.getSelectedIndex() == 0, 367 .repo_issues => |*v| v.getSelectedIndex() == 0, 368 .home_settings => |*v| v.getSelectedIndex() == 0, 369 .home_auth => |*v| v.getSelectedIndex() == 0, 370 .quit => |*v| v.getSelectedIndex() == 0, 371 else => false, 372 }; 373 if (at_top) { 374 index = header_index; 375 } else { 376 try child.input(allocator, key, root_focus); 377 } 378 } 379 }, 380 else => {}, 381 } 382 }, 383 .down => { 384 switch (child.*) { 385 .repo_header => { 386 index = stack_index; 387 }, 388 .stack => { 389 try child.input(allocator, key, root_focus); 390 }, 391 else => {}, 392 } 393 }, 394 .none => { 395 try child.input(allocator, key, root_focus); 396 }, 397 } 398 399 if (index != current_index) { 400 root_focus.setFocus(self.box.children.keys()[index]); 401 } 402 } 403 } 404 } 405 406 pub fn clearGrid(self: *View) void { 407 self.box.clearGrid(); 408 } 409 410 pub fn getGrid(self: View) ?Grid { 411 return self.box.getGrid(); 412 } 413 414 pub fn getFocus(self: *View) *Focus { 415 return self.box.getFocus(); 416 } 417 }; 418