╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1420 sc.getFocus().version +%= 1; │ │1421 } │ │1422 │ │1423 - pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │1423 + pub fn input(self: *View, allocator: std.mem.Allocator, raw_key: Key, root_focus: *Focus) !void {│ │1424 + // wheel input moves focus like the arrows │ │1425 + const key: Key = if (raw_key == .mouse and raw_key.mouse.action == .scroll) │ │1426 + (if (raw_key.mouse.action.scroll == .up) .arrow_up else .arrow_down) │ │1427 + else │ │1428 + raw_key; │ │1429 + │ │1430 if (self.headerActive()) { │ │1431 // down from the tabs re-enters the stack if the selected view has │ │1432 // something to focus; other keys move the tabs. │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1526 .arrow_up => self.focusHeader(root_focus), │ │1527 .arrow_down => self.focusTitle(index, root_focus), │ │1528 .enter => if (on_status) try self.toggleIssueStatus(allocator, index), │ │1523 - .mouse => |mouse| switch (mouse.action) { │ │1524 - .scroll => |dir| { │ │1525 - const sc = self.detailScroll(index); │ │1526 - sc.y += if (dir == .up) @as(isize, -1) else 1; │ │1527 - sc.clampToContent(); │ │1528 - }, │ │1529 - else => if (self.statusButton(index)) |button| { │ │1530 - if (inp.leftClickOn(root_focus, button.getFocus().id, mouse)) try self.toggleIssueStatus(allocator, index);│ │1531 - }, │ │1529 + .mouse => |mouse| if (self.statusButton(index)) |button| { │ │1530 + if (inp.leftClickOn(root_focus, button.getFocus().id, mouse)) try self.toggleIssueStatus(allocator, index); │ │1531 }, │ │1532 else => {}, │ │1533 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │1534 } │ │1535 │ │1536 fn titleInput(self: *View, index: usize, key: Key, root_focus: *Focus) !void {│ │1538 - const sc = self.detailScroll(index); │ │1537 switch (key) { │ │1538 .arrow_left => try self.focusList(index, root_focus), │ │1539 .arrow_up => self.focusToolRow(index, root_focus), │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1540 .arrow_down => if (self.authorPresent(index)) self.focusAuthor(index, root_focus) else try self.focusDescription(index, root_focus),│ │1543 - .mouse => |mouse| switch (mouse.action) { │ │1544 - .scroll => |dir| { │ │1545 - sc.y += if (dir == .up) @as(isize, -1) else 1; │ │1546 - sc.clampToContent(); │ │1547 - }, │ │1548 - else => {}, │ │1549 - }, │ │1541 else => {}, │ │1542 } │ │1543 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │1545 // the author box's a: link (when it has one) is followed by the host on │ │1546 // enter / a click; arrows cross to the neighboring widgets. │ │1547 fn authorInput(self: *View, index: usize, key: Key, root_focus: *Focus) !void {│ │1557 - const sc = self.detailScroll(index); │ │1548 switch (key) { │ │1549 .arrow_left => try self.focusList(index, root_focus), │ │1550 .arrow_up => self.focusTitle(index, root_focus), │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1551 .arrow_down => if (self.tagFlow(index) != null) try self.focusTags(index, root_focus) else try self.focusDescription(index, root_focus),│ │1562 - .mouse => |mouse| switch (mouse.action) { │ │1563 - .scroll => |dir| { │ │1564 - sc.y += if (dir == .up) @as(isize, -1) else 1; │ │1565 - sc.clampToContent(); │ │1566 - }, │ │1567 - else => {}, │ │1568 - }, │ │1552 else => {}, │ │1553 } │ │1554 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │1578 .page_down => sc.y += 10, │ │1579 .home => sc.y = 0, │ │1580 .end => sc.y = std.math.maxInt(isize), │ │1598 - .mouse => |mouse| switch (mouse.action) { │ │1599 - .scroll => |dir| sc.y += if (dir == .up) @as(isize, -1) else 1,│ │1600 - else => {}, │ │1601 - }, │ │1581 else => return, │ │1582 } │ │1583 sc.clampToContent(); │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │1648 .enter => if (on_submit) try self.submitResolution(allocator), │ │1649 .mouse => |mouse| if (on_submit and inp.leftClickOn(root_focus, cid, mouse)) {│ │1650 try self.submitResolution(allocator); │ │1672 - } else if (mouse.action == .scroll) { │ │1673 - if (self.resolveScroll()) |sc| { │ │1674 - sc.y += if (mouse.action.scroll == .up) @as(isize, -1) else 1; │ │1675 - sc.clampToContent(); │ │1676 - } │ │1651 }, │ │1652 else => try child.widget.input(allocator, key, root_focus), │ │1653 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1922 const cid = tf.focus.child_id orelse return; │ │1923 const cur = tf.indexOfFocusId(cid) orelse return; │ │1924 const count = tf.text_boxes.items.len; │ │1951 - const sc = self.detailScroll(index); │ │1925 switch (key) { │ │1926 .arrow_left => if (cur > 0) self.focusTag(index, tf, root_focus, cur - 1) else try self.focusList(index, root_focus),│ │1927 .arrow_right => if (cur + 1 < count) self.focusTag(index, tf, root_focus, cur + 1), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1929 .arrow_down => if (tf.rowStep(cur, true)) |i| self.focusTag(index, tf, root_focus, i) else try self.focusDescription(index, root_focus),│ │1930 .home => self.focusTag(index, tf, root_focus, 0), │ │1931 .end => self.focusTag(index, tf, root_focus, count - 1), │ │1959 - .mouse => |mouse| switch (mouse.action) { │ │1960 - .scroll => |dir| { │ │1961 - sc.y += if (dir == .up) @as(isize, -1) else 1; │ │1962 - sc.clampToContent(); │ │1963 - }, │ │1964 - else => {}, │ │1965 - }, │ │1932 else => {}, │ │1933 } │ │1934 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯