╭ changed ───────────────────╮ │src/ui/UserNotifications.zig│ ╰────────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │105 const settings_route = user_route.withUserTab(.{ .view = .settings }); │ │106 const keys_route = user_route.withUserTab(.{ .view = .keys }); │ │107 { │ │108 - var header = try wgt.Box(ui.Widget).init(allocator, .{ .border = null, .direction = .horiz }); │ │109 - errdefer header.deinit(allocator); │ │108 + var header_scroll = try ui.widget.HeaderScroll.init(allocator, session); │ │109 + errdefer header_scroll.deinit(allocator); │ │110 + const header = header_scroll.row(); │ │111 const on_tab = std.meta.activeTag(session.data.current_page) == std.meta.activeTag(user_route); │ │112 const routes = [_]ui.RoutablePage{ user_route.withUserTab(.{}), settings_route, keys_route }; │ │113 for ([_]ui.RoutablePage.UserView{ .notifications, .settings, .keys }, [_][]const u8{ "notifications", "user settings", "ssh keys" }, routes, 0..) |view, label, route, index| {│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │144 } │ │145 header.getFocus().child_id = control_ids[@backingInt(data.view)]; │ │146 // a row taller than the button, leaving a blank line beneath it │ │146 - try box.children.put(allocator, header.getFocus().id, .{ .widget = .{ .box = header }, .rect = null, .min_size = .{ .width = null, .height = 4 } }); │ │147 + try box.children.put(allocator, header_scroll.getFocus().id, .{ .widget = .{ .header_scroll = header_scroll }, .rect = null, .min_size = .{ .width = null, .height = 4 } });│ │148 } │ │149 │ │150 { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │205 } │ │206 │ │207 fn headerBox(self: *View) *wgt.Box(ui.Widget) { │ │207 - return &self.box.children.values()[header_index].widget.box; │ │208 + return self.box.children.values()[header_index].widget.header_scroll.row();│ │209 } │ │210 │ │211 fn contentStack(self: *View) *wgt.Stack(ui.Widget) { │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │213 } │ │214 │ │215 fn headerActive(self: *View) bool { │ │215 - return self.box.getFocus().child_id == self.headerBox().getFocus().id; │ │216 + return self.box.getFocus().child_id == self.box.children.keys()[header_index]; │ │217 } │ │218 │ │219 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯