╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
243 .up => { 244 switch (child.*) { 245 .repo_header => { 246 try child.input(allocator, key, root_focus); 247 }, 248 .stack => { 249 if (child.stack.getSelected()) |selected_widget| { 250 const at_top = switch (selected_widget.*) { 251 .repo_files => |*v| v.getSelectedIndex() == 0, 252 .repo_commits => |*v| v.getSelectedIndex() == 0, 253 .repo_refs => |*v| v.getSelectedIndex() == 0, 254 .home_settings => |*v| v.getSelectedIndex() == 0, 255 .home_auth => |*v| v.getSelectedIndex() == 0, 256 .quit => |*v| v.getSelectedIndex() == 0, 257 else => false, 258 }; 259 if (at_top) { 260 index = header_index; 261 } else { 262 try child.input(allocator, key, root_focus); 263 } 264 } 265 }, 266 else => {}, 267 } 268 }, 269 .down => { 270 switch (child.*) { 271 .repo_header => { 272 index = stack_index; 273 }, 274 .stack => { 275 try child.input(allocator, key, root_focus); 276 }, 277 else => {}, 278 } 279 }, 280 .none => { 281 try child.input(allocator, key, root_focus); 282 }, 283 } 284 285 if (index != current_index) { 286 try root_focus.setFocus(self.box.children.keys()[index]); 287 } 288 } 289 } 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