╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │26 pub const View = struct { │ │27 scroll: wgt.Scroll(ui.Widget), │ │28 tab_ids: std.AutoArrayHashMapUnmanaged(usize, void), │ │29 + session: *ui.Session, │ │30 │ │31 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │32 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │34 │ │35 var tab_ids: std.AutoArrayHashMapUnmanaged(usize, void) = .empty; │ │36 errdefer tab_ids.deinit(allocator); │ │37 + │ │38 + try ui.widget.addBackButton(allocator, &box, session); │ │39 │ │40 + { │ │41 + var text = try wgt.Text.init(allocator, " "); │ │42 + errdefer text.deinit(allocator); │ │43 + try box.children.put(allocator, text.getFocus().id, .{ │ │44 + .widget = .{ .text = text }, │ │45 + .rect = null, │ │46 + .min_size = .{ .width = 1, .height = null }, │ │47 + }); │ │48 + } │ │49 + │ │50 // title sits to the left of the tabs │ │51 { │ │52 var title_view = try ui.Title.View.init(allocator, &data.title);│ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │189 var self = View{ │ │190 .scroll = try wgt.Scroll(ui.Widget).init(allocator, .{ .box = box }, .{ .direction = .horiz, .show_bar = false, .web_native = !session.is_terminal }),│ │191 .tab_ids = tab_ids, │ │192 + .session = session, │ │193 }; │ │194 self.getFocus().child_id = selected_tab orelse self.tab_ids.keys()[0]; │ │195 return self; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │204 self.clearGrid(); │ │205 // only the selected tab shows its border │ │206 const box = &self.scroll.child.box; │ │207 + ui.widget.setBackButtonVisible(box, self.session.back == .available);│ │208 for (box.children.keys(), box.children.values()) |id, *child| { │ │209 const tb: ?*wgt.TextBox = switch (child.widget) { │ │210 .text_box => |*x| x, │ ╰──────────────────────────────────────────────────────────────────────────────────╯