╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │24 pub const View = struct { │ │25 scroll: wgt.Scroll(ui.Widget), │ │26 tab_ids: std.AutoArrayHashMapUnmanaged(usize, void), │ │27 + session: *ui.Session, │ │28 │ │29 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │30 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │32 │ │33 var tab_ids: std.AutoArrayHashMapUnmanaged(usize, void) = .empty; │ │34 errdefer tab_ids.deinit(allocator); │ │35 + │ │36 + try ui.widget.addBackButton(allocator, &box, session); │ │37 │ │38 + { │ │39 + var text = try wgt.Text.init(allocator, " "); │ │40 + errdefer text.deinit(allocator); │ │41 + try box.children.put(allocator, text.getFocus().id, .{ │ │42 + .widget = .{ .text = text }, │ │43 + .rect = null, │ │44 + .min_size = .{ .width = 1, .height = null }, │ │45 + }); │ │46 + } │ │47 + │ │48 // title sits to the left of the tabs │ │49 { │ │50 var title_view = try ui.Title.View.init(allocator, &data.title);│ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │173 var self = View{ │ │174 .scroll = try wgt.Scroll(ui.Widget).init(allocator, .{ .box = box }, .{ .direction = .horiz, .show_bar = false, .web_native = !session.is_terminal }),│ │175 .tab_ids = tab_ids, │ │176 + .session = session, │ │177 }; │ │178 self.getFocus().child_id = selected_tab orelse self.tab_ids.keys()[0]; │ │179 return self; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │187 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │188 self.clearGrid(); │ │189 const box = &self.scroll.child.box; │ │190 + ui.widget.setBackButtonVisible(box, self.session.back == .available); │ │191 for (box.children.keys(), box.children.values()) |id, *child| { │ │192 const tb: ?*wgt.TextBox = switch (child.widget) { │ │193 .text_box => |*x| x, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯