╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │628 // backs each link item's `.custom` focus kind. │ │629 arena: std.heap.ArenaAllocator, │ │630 │ │631 - pub const Item = struct { text: []const u8, link: []const u8 = "" }; │ │631 + pub const Item = struct { text: []const u8, link: []const u8 = "", top_label: []const u8 = "" };│ │632 │ │633 pub fn init(allocator: std.mem.Allocator) !WordFlow { │ │634 return .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │652 self.arena.deinit(); │ │653 } │ │654 │ │655 - // the text box copies the item text; links are copied into the arena, so the │ │656 - // caller's slices needn't outlive this call. │ │655 + // the text box copies the item text; links and top labels are copied into the │ │656 + // arena, so the caller's slices needn't outlive this call. │ │657 pub fn setItems(self: *WordFlow, allocator: std.mem.Allocator, items: []const Item) !void {│ │658 for (self.text_boxes.items) |*tb| tb.deinit(allocator); │ │659 self.text_boxes.clearAndFree(allocator); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │665 self.focus.child_id = null; │ │666 │ │667 for (items) |item| { │ │668 - var text_box = try wgt.TextBox.init(allocator, item.text, .{ .border = .single, .round_corners = true, .wrap_kind = .none }); │ │668 + var text_box = try wgt.TextBox.init(allocator, item.text, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .top_label = .{ .text = try aa.dupe(u8, item.top_label) } });│ │669 errdefer text_box.deinit(allocator); │ │670 text_box.getFocus().mode = .all; │ │671 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯