╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Unauthorized.zig│ ╰───────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │29 ; │ │30 │ │31 pub fn init(allocator: std.mem.Allocator) !View { │ │32 - var text_box = try wgt.TextBox(ui.Widget).init(allocator, message, .{ .border_style = null, .rounded_corners = false, .wrap_kind = .word });│ │32 + var text_box = try wgt.TextBox.init(allocator, message, .{ .border_style = null, .rounded_corners = false, .wrap_kind = .word }); │ │33 errdefer text_box.deinit(allocator); │ │34 return .{ .center = try ui.widget.Center.init(allocator, .{ .text_box = text_box }) }; │ │35 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │53 │ │54 // spacer │ │55 { │ │56 - var text = try wgt.Text(ui.Widget).init(allocator, " ");│ │56 + var text = try wgt.Text.init(allocator, " "); │ │57 errdefer text.deinit(allocator); │ │58 try box.children.put(allocator, text.getFocus().id, .{ │ │59 .widget = .{ .text = text }, │ ╰────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │90 │ │91 // repos tab │ │92 { │ │93 - var text_box = try wgt.TextBox(ui.Widget).init(allocator, "repos", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │93 + var text_box = try wgt.TextBox.init(allocator, "repos", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │94 errdefer text_box.deinit(allocator); │ │95 text_box.getFocus().focusable = true; │ │96 text_box.getFocus().kind = .{ .custom = repos_link }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │105 │ │106 // forks tab │ │107 { │ │108 - var text_box = try wgt.TextBox(ui.Widget).init(allocator, "forks", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │108 + var text_box = try wgt.TextBox.init(allocator, "forks", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │109 errdefer text_box.deinit(allocator); │ │110 text_box.getFocus().focusable = true; │ │111 text_box.getFocus().kind = .{ .custom = forks_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │132 │ │133 // settings tab. settings are account preferences, so it needs a login. │ │134 if (session.data.user_id != null) { │ │135 - var text_box = try wgt.TextBox(ui.Widget).init(allocator, "settings", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │135 + var text_box = try wgt.TextBox.init(allocator, "settings", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │136 errdefer text_box.deinit(allocator); │ │137 text_box.getFocus().focusable = true; │ │138 text_box.getFocus().kind = .{ .custom = settings_link }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │162 │ │163 // quit tab │ │164 if (session.is_terminal) { │ │165 - var text_box = try wgt.TextBox(ui.Widget).init(allocator, ui.Quit.tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │165 + var text_box = try wgt.TextBox.init(allocator, ui.Quit.tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │166 errdefer text_box.deinit(allocator); │ │167 text_box.getFocus().focusable = true; │ │168 text_box.getFocus().kind = .{ .custom = ui.Quit.tab_kind }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │193 // only the selected tab shows its border │ │194 const box = &self.scroll.child.box; │ │195 for (box.children.keys(), box.children.values()) |id, *child| { │ │196 - const tb: ?*wgt.TextBox(ui.Widget) = switch (child.widget) { │ │196 + const tb: ?*wgt.TextBox = switch (child.widget) { │ │197 .text_box => |*x| x, │ │198 .auth_tab => |*at| blk: { │ │199 // the label tracks login state per frame, so the width must too│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭────────────────────────────────────────────────────╮ │12 pub const thread = @import("widget/thread.zig");│ │13 │ │14 pub const Widget = union(enum) { │ │15 - text: wgt.Text(Widget), │ │15 + text: wgt.Text, │ │16 box: wgt.Box(Widget), │ │17 - text_box: wgt.TextBox(Widget), │ │18 - text_input: wgt.TextInput(Widget), │ │17 + text_box: wgt.TextBox, │ │18 + text_input: wgt.TextInput, │ │19 scroll: wgt.Scroll(Widget), │ │20 stack: wgt.Stack(Widget), │ │21 flow_box: FlowBox, │ ╰────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │112 pub const FlowBox = struct { │ │113 focus: *Focus, │ │114 grid: ?Grid, │ │115 - text_boxes: std.ArrayList(wgt.TextBox(Widget)), │ │115 + text_boxes: std.ArrayList(wgt.TextBox), │ │116 // backs each link item's `.custom` focus kind (e.g. "a:/user/foo"). reset│ │117 // wholesale on each setItems so there's no per-string ownership to track.│ │118 arena: std.heap.ArenaAllocator, │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │170 self.focus.child_id = null; │ │171 │ │172 for (items) |item| { │ │173 - var text_box = try wgt.TextBox(Widget).init(allocator, item.text, .{ .border_style = .hidden, .rounded_corners = true, .wrap_kind = .word });│ │173 + var text_box = try wgt.TextBox.init(allocator, item.text, .{ .border_style = .hidden, .rounded_corners = true, .wrap_kind = .word }); │ │174 errdefer text_box.deinit(allocator); │ │175 text_box.getFocus().focusable = true; │ │176 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯