╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ User.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
291 switch (direction) { 292 .up => { 293 switch (child.*) { 294 .user_header => { 295 try child.input(allocator, key, root_focus); 296 }, 297 .stack => { 298 if (child.stack.getSelected()) |selected_widget| { 299 if (selected_widget.atTop(root_focus)) { 300 index = header_index; 301 } else { 302 try child.input(allocator, key, root_focus); 303 } 304 } 305 }, 306 else => {}, 307 } 308 }, 309 .down => { 310 switch (child.*) { 311 .user_header => { 312 index = stack_index; 313 }, 314 .stack => { 315 try child.input(allocator, key, root_focus); 316 }, 317 else => {}, 318 } 319 }, 320 .none => { 321 try child.input(allocator, key, root_focus); 322 }, 323 } 324 325 if (index != current_index) { 326 root_focus.setFocus(self.box.children.keys()[index]); 327 } 328 } 329 } 330 } 331 332 pub fn clearGrid(self: *View) void { 333 self.box.clearGrid(); 334 } 335 336 pub fn getGrid(self: View) ?Grid { 337 return self.box.getGrid(); 338 } 339 340 pub fn getFocus(self: *View) *Focus { 341 return self.box.getFocus(); 342 } 343 }; 344