╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Home.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
130 var index = current_index; 131 132 const direction = inp.vertDirection(key); 133 134 switch (direction) { 135 .up => { 136 switch (child.*) { 137 .home_header => { 138 try child.input(allocator, key, root_focus); 139 }, 140 .stack => { 141 if (child.stack.getSelected()) |selected_widget| { 142 if (selected_widget.atTop(root_focus)) { 143 index = header_index; 144 } else { 145 try child.input(allocator, key, root_focus); 146 } 147 } 148 }, 149 else => {}, 150 } 151 }, 152 .down => { 153 switch (child.*) { 154 .home_header => { 155 if (stack.getSelected()) |selected_widget| switch (selected_widget.*) { 156 .home_users => |*v| return v.focusHeader(root_focus), 157 else => {}, 158 }; 159 index = stack_index; 160 }, 161 .stack => { 162 try child.input(allocator, key, root_focus); 163 }, 164 else => {}, 165 } 166 }, 167 .none => { 168 try child.input(allocator, key, root_focus); 169 }, 170 } 171 172 if (index != current_index) { 173 root_focus.setFocus(self.box.children.keys()[index]); 174 } 175 } 176 } 177 } 178 179 pub fn clearGrid(self: *View) void { 180 self.box.clearGrid(); 181 } 182 183 pub fn getGrid(self: View) ?Grid { 184 return self.box.getGrid(); 185 } 186 187 pub fn getFocus(self: *View) *Focus { 188 return self.box.getFocus(); 189 } 190 }; 191