╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │283 pub fn addTab(self: *Header, allocator: std.mem.Allocator, label: []const u8, link: []const u8, view_index: usize) !void { │ │284 var text_box = try wgt.TextBox.init(allocator, label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │285 errdefer text_box.deinit(allocator); │ │286 - text_box.getFocus().focusable = true; │ │286 + text_box.getFocus().mode = .all; │ │287 text_box.getFocus().kind = .{ .custom = link }; │ │288 try self.tab_ids.put(allocator, text_box.getFocus().id, view_index); │ │289 try self.box.children.put(allocator, text_box.getFocus().id, .{ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │505 fn addToolButton(allocator: std.mem.Allocator, row: *wgt.Box(Widget), label: []const u8, action: []const u8) !void { │ │506 var button = try wgt.TextBox.init(allocator, label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │507 errdefer button.deinit(allocator); │ │508 - button.getFocus().focusable = true; │ │508 + button.getFocus().mode = .all; │ │509 button.getFocus().kind = .{ .custom = action }; │ │510 try row.children.put(allocator, button.getFocus().id, .{ .widget = .{ .text_box = button }, .rect = null, .min_size = .{ .width = try xitui.width.displayWidth(label) + 2, .height = null } });│ │511 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │591 } │ │592 │ │593 for (row.children.keys(), row.children.values()) |id, *child| {│ │594 - if (!child.widget.getFocus().focusable) continue; │ │594 + if (child.widget.getFocus().mode != .all) continue; │ │595 row.getFocus().child_id = id; │ │596 break; │ │597 } │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │626 const back_label = try std.fmt.bufPrint(&back_label_buf, "← back to {s}", .{thread_name}); │ │627 var text_box = try wgt.TextBox.init(allocator, back_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │628 errdefer text_box.deinit(allocator); │ │629 - text_box.getFocus().focusable = true; │ │629 + text_box.getFocus().mode = .all; │ │630 text_box.getFocus().kind = .{ .custom = try listLink(self.session.page_arena, self.data.identity, entryStatus(entry), "", entry.id) }; │ │631 try inner_box.children.put(allocator, text_box.getFocus().id, .{ .widget = .{ .text_box = text_box }, .rect = null, .min_size = null });│ │632 self.title_id = text_box.getFocus().id; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │633 } else { │ │634 var title = try wgt.TextBox.init(allocator, entry.record.event.title, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .word, .label = " title " });│ │635 errdefer title.deinit(allocator); │ │636 - title.getFocus().focusable = true; │ │636 + title.getFocus().mode = .all; │ │637 try inner_box.children.put(allocator, title.getFocus().id, .{ .widget = .{ .text_box = title }, .rect = null, .min_size = null }); │ │638 self.title_id = title.getFocus().id; │ │639 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │673 .bottom_label = if (preview_end != null) " click or press enter to see more " else "", │ │674 }); │ │675 errdefer description.deinit(allocator); │ │676 - description.getFocus().focusable = true; │ │676 + description.getFocus().mode = .all; │ │677 if (preview_end != null) { │ │678 const route = ui.RoutablePage.repoThreadDescriptionRoute(kind, self.data.identity, entry.id) orelse return error.RouteTooLong; │ │679 description.getFocus().kind = .{ .custom = try std.fmt.allocPrint(self.session.page_arena.allocator(), "a:{s}", .{try route.toUrl(self.session.page_arena)}) };│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │809 var previous = cur; │ │810 while (previous > 0) { │ │811 previous -= 1; │ │812 - if (!row.children.values()[previous].widget.getFocus().focusable) continue; │ │812 + if (row.children.values()[previous].widget.getFocus().mode != .all) continue;│ │813 root_focus.setFocus(row.children.keys()[previous]); │ │814 return; │ │815 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │818 .arrow_right => { │ │819 var next = cur + 1; │ │820 while (next < row.children.count()) : (next += 1) { │ │821 - if (!row.children.values()[next].widget.getFocus().focusable) continue; │ │821 + if (row.children.values()[next].widget.getFocus().mode != .all) continue;│ │822 root_focus.setFocus(row.children.keys()[next]); │ │823 return; │ │824 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │895 const focus = self.inner().getFocus(); │ │896 var chosen: ?usize = null; │ │897 for (focus.children.keys(), focus.children.values()) |id, child| {│ │898 - if (!child.focus.focusable) continue; │ │898 + if (child.focus.mode != .all) continue; │ │899 chosen = id; │ │900 if (!to_end) break; │ │901 } │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │925 const child = &inner_box.children.values()[child_index]; │ │926 const child_rect = child.rect orelse return false; │ │927 var chosen: ?usize = null; │ │928 - if (child.widget.getFocus().focusable and self.rectVisible(child_rect)) { │ │928 + if (child.widget.getFocus().mode == .all and self.rectVisible(child_rect)) {│ │929 const id = inner_box.children.keys()[child_index]; │ │930 chosen = id; │ │931 if (!last) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯