╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
278 .repo_header => { 279 try child.input(allocator, key, root_focus); 280 }, 281 .stack => { 282 if (child.stack.getSelected()) |selected_widget| { 283 const at_top = switch (selected_widget.*) { 284 .repo_files => |*v| v.getSelectedIndex() == 0, 285 .repo_commits => |*v| v.getSelectedIndex() == 0, 286 .repo_refs => |*v| v.getSelectedIndex() == 0, 287 .home_settings => |*v| v.getSelectedIndex() == 0, 288 .home_auth => |*v| v.getSelectedIndex() == 0, 289 .quit => |*v| v.getSelectedIndex() == 0, 290 else => false, 291 }; 292 if (at_top) { 293 index = header_index; 294 } else { 295 try child.input(allocator, key, root_focus); 296 } 297 } 298 }, 299 else => {}, 300 } 301 }, 302 .down => { 303 switch (child.*) { 304 .repo_header => { 305 index = stack_index; 306 }, 307 .stack => { 308 try child.input(allocator, key, root_focus); 309 }, 310 else => {}, 311 } 312 }, 313 .none => { 314 try child.input(allocator, key, root_focus); 315 }, 316 } 317 318 if (index != current_index) { 319 root_focus.setFocus(self.box.children.keys()[index]); 320 } 321 } 322 } 323 } 324 325 pub fn clearGrid(self: *View) void { 326 self.box.clearGrid(); 327 } 328 329 pub fn getGrid(self: View) ?Grid { 330 return self.box.getGrid(); 331 } 332 333 pub fn getFocus(self: *View) *Focus { 334 return self.box.getFocus(); 335 } 336 }; 337