╭ changed ────╮ │build.zig.zon│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 .version = "0.0.0", │ │ 4 .dependencies = .{ │ │ 5 .xit = .{ │ │ 6 - .url = "git+https://github.com/xit-vcs/xit#f4cfffb8fa3fffae22861766ec81b89215e36820",│ │ 7 - .hash = "xit-0.0.0-Ub3nDAPMUAGRqJsjQXOyihC0M0VskcCCcWM0zl0AI7qP", │ │ 6 + .url = "git+https://github.com/xit-vcs/xit#0876e1411cdfe273836e8cf91111fba684ff250e",│ │ 7 + .hash = "xit-0.0.0-Ub3nDIzhUAH0YKyuBv9yZR8qsAv5oLProGZLuCBrw601", │ │ 8 }, │ │ 9 }, │ │10 .paths = .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2012 }, │ │2013 .mouse => |mouse| { │ │2014 if (mouse.action == .press and mouse.action.press == .left) { │ │2015 - var clicked: ?usize = null; │ │2016 - var iter = root_focus.children.iterator(); │ │2017 - while (iter.next()) |entry| { │ │2018 - const child = entry.value_ptr.*; │ │2019 - if (!child.focus.focusable and !widget.isBackButton(child.focus)) continue; │ │2020 - const r = child.rect; │ │2021 - if (mouse.x >= r.x and mouse.y >= r.y and │ │2022 - mouse.x < r.x + r.size.width and mouse.y < r.y + r.size.height) │ │2023 - { │ │2024 - clicked = entry.key_ptr.*; │ │2025 - break; │ │2015 + if (root_focus.hitTest(mouse.x, mouse.y)) |hit| { │ │2016 + const focus_id = hit.id; │ │2017 + if (hit.kind == .background) { │ │2018 + root_focus.setFocus(focus_id); │ │2019 + return; │ │2020 } │ │2027 - } │ │2028 - if (clicked) |focus_id| { │ │2021 if (widget.isBackButton((root_focus.children.get(focus_id) orelse return).focus)) {│ │2022 if (session.back == .available) session.back = .requested; │ │2023 return; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2174 }; │ │2175 var tb = try wgt.TextBox.init(allocator, text, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none, .label = " author " });│ │2176 errdefer tb.deinit(allocator); │ │2185 - tb.getFocus().focusable = true; │ │2177 + tb.getFocus().mode = .all; │ │2178 switch (author) { │ │2179 .user_name => |name| tb.getFocus().kind = .{ .custom = try userLink(page_arena, name) }, │ │2180 else => {}, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Auth/Login.zig│ ╰─────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │43 { │ │44 var username = try wgt.TextInput.init(allocator, .{ .label = " username ", .name = "username", .rounded_corners = true, .render_content = session.is_terminal });│ │45 errdefer username.deinit(allocator); │ │46 - username.getFocus().focusable = true; │ │46 + username.getFocus().mode = .all; │ │47 if (session.formFeedback(.login)) |feedback| try username.setContent(allocator, feedback.username); │ │48 nav_ids[username_index] = username.getFocus().id; │ │49 try box.children.put(allocator, username.getFocus().id, .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │56 { │ │57 var password = try wgt.TextInput.init(allocator, .{ .label = " password ", .password = true, .name = "password", .rounded_corners = true, .render_content = session.is_terminal });│ │58 errdefer password.deinit(allocator); │ │59 - password.getFocus().focusable = true; │ │59 + password.getFocus().mode = .all; │ │60 nav_ids[password_index] = password.getFocus().id; │ │61 try box.children.put(allocator, password.getFocus().id, .{ │ │62 .widget = .{ .text_input = password }, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │68 { │ │69 var button = try wgt.TextBox.init(allocator, "login", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │70 errdefer button.deinit(allocator); │ │71 - button.getFocus().focusable = true; │ │71 + button.getFocus().mode = .all; │ │72 // the renderer distinguishes plain clickables from buttons that │ │73 // should POST to a server route by this kind. │ │74 button.getFocus().kind = .{ .custom = "submit" }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Auth/Logout.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │44 { │ │45 var button = try wgt.TextBox.init(allocator, "logout", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │46 errdefer button.deinit(allocator); │ │47 - button.getFocus().focusable = true; │ │47 + button.getFocus().mode = .all; │ │48 // the renderer distinguishes plain clickables from buttons that │ │49 // should POST to a server route by this kind. │ │50 button.getFocus().kind = .{ .custom = "submit" }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/ui/AuthTab.zig│ ╰──────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │17 pub fn init(allocator: std.mem.Allocator, session: *ui.Session) !View { │ │18 var text_box = try wgt.TextBox.init(allocator, "login", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │19 errdefer text_box.deinit(allocator); │ │20 - text_box.getFocus().focusable = true; │ │20 + text_box.getFocus().mode = .all; │ │21 text_box.getFocus().kind = .{ .custom = "ai:/auth" }; │ │22 return .{ │ │23 .text_box = text_box, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Fork/Header.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │65 const text = try std.fmt.bufPrint(&text_buf, "{s}/", .{data.owner_name}); │ │66 var owner = try wgt.TextBox.init(allocator, text, .{ .border_style = .hidden, .wrap_kind = .none }); │ │67 errdefer owner.deinit(allocator); │ │68 - owner.getFocus().focusable = true; │ │68 + owner.getFocus().mode = .all; │ │69 owner.getFocus().kind = .{ .custom = try std.fmt.allocPrint(aa, "a:/user/{s}", .{data.owner_name}) }; │ │70 first_group_width += try xitui.width.displayWidth(text) + 2; │ │71 try title_box.children.put(allocator, owner.getFocus().id, .{ .widget = .{ .text_box = owner }, .rect = null, .min_size = null });│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │76 const route = ui.RoutablePage.repoFilesRoute(identity, null, "", "", 0) orelse return error.RouteTooLong; │ │77 var title = try ui.Title.View.init(allocator, &data.title); │ │78 errdefer title.deinit(allocator); │ │79 - title.getFocus().focusable = true; │ │79 + title.getFocus().mode = .all; │ │80 title.getFocus().kind = .{ .custom = try std.fmt.allocPrint(aa, "a:{s}", .{try route.toUrl(session.page_arena)}) }; │ │81 try title_box.children.put(allocator, title.getFocus().id, .{ .widget = .{ .title = title }, .rect = null, .min_size = null });│ │82 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯