╭ changed ────────╮ │src/ui/widget.zig│ ╰─────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │129 // draw a text box as the selected one of its group: bordered and inverted,│ │130 // while the rest stay borderless │ │131 pub fn markSelected(text_box: *wgt.TextBox, selected: bool) void { │ │132 - text_box.options.border_style = if (selected) .single else .hidden; │ │132 + text_box.options.border = if (selected) .single else .hidden; │ │133 text_box.options.invert = selected; │ │134 } │ │135 │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │136 pub fn addBackButton(allocator: std.mem.Allocator, box: *wgt.Box(Widget), session: *ui.Session) !void {│ │137 if (!session.is_terminal) return; │ │138 - var back = try wgt.TextBox.init(allocator, "←", .{ .border_style = .hidden, .wrap_kind = .none }); │ │138 + var back = try wgt.TextBox.init(allocator, "←", .{ .border = .hidden, .wrap_kind = .none }); │ │139 errdefer back.deinit(allocator); │ │140 back.getFocus().kind = .{ .custom = back_kind }; │ │141 back.getFocus().mode = .mouse; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │246 // a repo tab's placeholder while the repo has no commits, with the remote to │ │247 // push to for a viewer who can │ │248 pub fn initNoCommits(allocator: std.mem.Allocator, session: *ui.Session, handle: ui.RepoHandle) !Center {│ │249 - var box = try wgt.Box(Widget).init(allocator, .{ .border_style = null, .direction = .vert }); │ │249 + var box = try wgt.Box(Widget).init(allocator, .{ .border = null, .direction = .vert }); │ │250 errdefer box.deinit(allocator); │ │251 │ │252 // built first so the text can center over it │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │268 │ │269 { │ │270 var text_widget: Widget = blk: { │ │271 - var text_box = try wgt.TextBox.init(allocator, "no commits yet", .{ .border_style = null, .wrap_kind = .none }); │ │271 + var text_box = try wgt.TextBox.init(allocator, "no commits yet", .{ .border = null, .wrap_kind = .none }); │ │272 errdefer text_box.deinit(allocator); │ │273 break :blk if (remote_maybe != null) .{ .center = try Center.init(allocator, .{ .text_box = text_box }) } else .{ .text_box = text_box };│ │274 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │355 self.focus.child_id = null; │ │356 │ │357 for (items) |item| { │ │358 - var text_box = try wgt.TextBox.init(allocator, item.text, .{ .border_style = .hidden, .round_corners = true, .wrap_kind = .word, .bottom_label = try aa.dupe(u8, item.bottom_label) }); │ │358 + var text_box = try wgt.TextBox.init(allocator, item.text, .{ .border = .hidden, .round_corners = true, .wrap_kind = .word, .bottom_label = .{ .text = try aa.dupe(u8, item.bottom_label) } });│ │359 errdefer text_box.deinit(allocator); │ │360 text_box.getFocus().mode = .all; │ │361 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │387 │ │388 // build at the slot size so every text box fits a single grid cell │ │389 for (self.text_boxes.items) |*tb| { │ │390 - tb.options.border_style = if (root_focus.grandchild_id == tb.getFocus().id) .double else .hidden;│ │390 + tb.options.border = if (root_focus.grandchild_id == tb.getFocus().id) .double else .hidden; │ │391 try tb.build(allocator, .{ │ │392 .min_size = .{ .width = cell_width, .height = null }, │ │393 .max_size = .{ .width = cell_width, .height = slot_height }, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │618 self.focus.child_id = null; │ │619 │ │620 for (items) |item| { │ │621 - var text_box = try wgt.TextBox.init(allocator, item.text, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ │621 + var text_box = try wgt.TextBox.init(allocator, item.text, .{ .border = .single, .round_corners = true, .wrap_kind = .none }); │ │622 errdefer text_box.deinit(allocator); │ │623 text_box.getFocus().mode = .all; │ │624 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1000 pub const min_size: layout.MaybeSize = .{ .width = 20, .height = 3 }; │ │1001 │ │1002 pub fn init(allocator: std.mem.Allocator, session: *ui.Session, label: []const u8, name: []const u8, text_value: ?[]const u8) !SearchBox { │ │1003 - var text_input = try wgt.TextInput.init(allocator, .{ .label = label, .name = name, .round_corners = true, .visible_width = 18, .render_content = session.is_terminal }); │ │1003 + var text_input = try wgt.TextInput.init(allocator, .{ .top_label = .{ .text = label }, .name = name, .round_corners = true, .visible_width = 18, .render_content = session.is_terminal });│ │1004 errdefer text_input.deinit(allocator); │ │1005 text_input.getFocus().mode = .all; │ │1006 if (text_value) |value| try text_input.setContent(allocator, value); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1012 } │ │1013 │ │1014 pub fn build(self: *SearchBox, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void { │ │1015 - self.text_input.options.bottom_label = if (root_focus.grandchild_id == self.getFocus().id) " press enter " else ""; │ │1015 + self.text_input.options.bottom_label.text = if (root_focus.grandchild_id == self.getFocus().id) " press enter " else "";│ │1016 try self.text_input.build(allocator, constraint, root_focus); │ │1017 if (!self.session.is_terminal) { │ │1018 try self.session.text_inputs.put(self.session.arena.allocator(), self.getFocus().id, &self.text_input); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1055 values: []const []const u8, │ │1056 │ │1057 pub fn init(allocator: std.mem.Allocator, session: *ui.Session, name: []const u8, values: []const []const u8, initial: []const u8) !Radio {│ │1058 - var box = try wgt.Box(Widget).init(allocator, .{ .border_style = null, .direction = .horiz }); │ │1058 + var box = try wgt.Box(Widget).init(allocator, .{ .border = null, .direction = .horiz }); │ │1059 errdefer box.deinit(allocator); │ │1060 for (values) |value| { │ │1061 - var option = try wgt.TextBox.init(allocator, value, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none }); │ │1061 + var option = try wgt.TextBox.init(allocator, value, .{ .border = .single, .round_corners = true, .wrap_kind = .none }); │ │1062 errdefer option.deinit(allocator); │ │1063 option.getFocus().mode = .all; │ │1064 option.getFocus().kind = .{ .custom = try session.page_arena.allocator().print(ui.radio_prefix ++ "{s}={s}", .{ name, value }) }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯