╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Fork.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
264 var next_index = current_index; 265 switch (inp.vertDirection(key)) { 266 .up => switch (child.*) { 267 .fork_header => try child.input(allocator, key, root_focus), 268 .stack => if (stack.getSelected()) |selected| { 269 if (selected.atTop(root_focus)) next_index = header_index else try child.input(allocator, key, root_focus); 270 }, 271 else => {}, 272 }, 273 .down => switch (child.*) { 274 .fork_header => { 275 if (stack.getSelected()) |selected| switch (selected.*) { 276 .repo_patch_detail => |*view| if (view.focusFirst(root_focus)) return, 277 .repo_files => |*view| if (view.focusHeader(root_focus)) return, 278 .repo_commits => |*view| if (view.focusHeader(root_focus)) return, 279 .user_notifications => |*view| if (view.focusHeader(root_focus)) return, 280 else => {}, 281 }; 282 next_index = stack_index; 283 }, 284 .stack => try child.input(allocator, key, root_focus), 285 else => {}, 286 }, 287 .none => try child.input(allocator, key, root_focus), 288 } 289 if (next_index != current_index) root_focus.setFocus(self.box.children.keys()[next_index]); 290 } 291 292 pub fn clearGrid(self: *View) void { 293 self.box.clearGrid(); 294 } 295 296 pub fn getGrid(self: View) ?Grid { 297 return self.box.getGrid(); 298 } 299 300 pub fn getFocus(self: *View) *Focus { 301 return self.box.getFocus(); 302 } 303 }; 304