╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
226 (if (mouse.action.scroll == .up) .up else .down) 227 else 228 .none, 229 else => .none, 230 }; 231 232 switch (direction) { 233 .up => { 234 switch (child.*) { 235 .repo_header => { 236 try child.input(allocator, key, root_focus); 237 }, 238 .stack => { 239 if (child.stack.getSelected()) |selected_widget| { 240 const at_top = switch (selected_widget.*) { 241 .repo_files => |*v| v.getSelectedIndex() == 0, 242 .repo_commits => |*v| v.getSelectedIndex() == 0, 243 .repo_refs => |*v| v.getSelectedIndex() == 0, 244 .home_settings => |*v| v.getSelectedIndex() == 0, 245 .home_auth => |*v| v.getSelectedIndex() == 0, 246 .quit => |*v| v.getSelectedIndex() == 0, 247 else => false, 248 }; 249 if (at_top) { 250 index = header_index; 251 } else { 252 try child.input(allocator, key, root_focus); 253 } 254 } 255 }, 256 else => {}, 257 } 258 }, 259 .down => { 260 switch (child.*) { 261 .repo_header => { 262 index = stack_index; 263 }, 264 .stack => { 265 try child.input(allocator, key, root_focus); 266 }, 267 else => {}, 268 } 269 }, 270 .none => { 271 try child.input(allocator, key, root_focus); 272 }, 273 } 274 275 if (index != current_index) { 276 try root_focus.setFocus(self.box.children.keys()[index]); 277 } 278 } 279 } 280 } 281 282 pub fn clearGrid(self: *View) void { 283 self.box.clearGrid(); 284 } 285 286 pub fn getGrid(self: View) ?Grid { 287 return self.box.getGrid(); 288 } 289 290 pub fn getFocus(self: *View) *Focus { 291 return self.box.getFocus(); 292 } 293 }; 294