╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │165 if (next == @as(usize, @intCast(cur))) return; │ │166 root_focus.setFocus(keys[next]); │ │167 if (box.children.values()[next].rect) |rect| scroll.scrollToRect(rect); │ │168 +} │ │169 + │ │170 +// focus the box beside the selected one in `row`, false when there is none that way.│ │171 +pub fn moveInRow(row: *wgt.Box(Widget), root_focus: *Focus, right: bool) bool { │ │172 + const selected = row.getFocus().child_id orelse return false; │ │173 + const index = row.children.getIndex(selected) orelse return false; │ │174 + const target = if (right) index + 1 else index -| 1; │ │175 + if (target == index or target >= row.children.count()) return false; │ │176 + root_focus.setFocus(row.children.keys()[target]); │ │177 + return true; │ │178 } │ │179 │ │180 pub const FlowBox = struct { │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯