╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │14 const new_tab_label = "new"; │ │15 const new_repo_tab_bottom_label = "repo"; │ │16 const new_user_tab_bottom_label = "user"; │ │17 - │ │18 -pub const AuthTab = @import("./../AuthTab.zig");│ │17 │ │18 // null hides the title │ │19 title: ?ui.Title, │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │93 const users_link = try ui.inPageTabLink(session, .{ .home_users = .{} }, current_tag == .home_users);│ │94 const new_repo_link = try ui.inPageTabLink(session, .home_new_repo, current_tag == .home_new_repo); │ │95 const new_user_link = try ui.inPageTabLink(session, .home_new_user, current_tag == .home_new_user); │ │98 - const auth_link = try ui.inPageTabLink(session, .home_auth, current_tag == .home_auth); │ │96 + const user_link = try ui.inPageTabLink(session, .home_user, current_tag == .home_user); │ │97 const current_link: []const u8 = switch (current_tag) { │ │98 .home_users => users_link, │ │99 .home_new_repo => new_repo_link, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │100 .home_new_user => new_user_link,│ │103 - .home_auth => auth_link, │ │101 + .home_user => user_link, │ │102 else => about_link, │ │103 }; │ │104 var selected_tab: ?usize = null; │ ╰─────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │133 }); │ │134 } │ │135 │ │138 - // spacer pushes new repo, new user, and auth to the right│ │136 + // spacer pushes new repo, new user, and user to the right│ │137 { │ │138 var spacer = try ui.widget.Spacer.init(allocator); │ │139 errdefer spacer.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │172 }); │ │173 } │ │174 │ │177 - // auth tab (login / logout) │ │175 + // user tab │ │176 { │ │179 - var auth_tab = try AuthTab.View.init(allocator, session); │ │180 - errdefer auth_tab.deinit(allocator); │ │181 - auth_tab.text_box.getFocus().kind = .{ .custom = auth_link }; │ │182 - try tab_ids.put(allocator, auth_tab.getFocus().id, {}); │ │183 - if (std.mem.eql(u8, auth_link, current_link)) selected_tab = auth_tab.getFocus().id; │ │184 - try tabs_box.children.put(allocator, auth_tab.getFocus().id, .{ │ │185 - .widget = .{ .auth_tab = auth_tab }, │ │177 + const label = ui.UserLogout.tabLabel(session); │ │178 + var text_box = try wgt.TextBox.init(allocator, label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ │179 + errdefer text_box.deinit(allocator); │ │180 + text_box.getFocus().mode = .all; │ │181 + text_box.getFocus().kind = .{ .custom = user_link }; │ │182 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │183 + if (std.mem.eql(u8, user_link, current_link)) selected_tab = text_box.getFocus().id; │ │184 + try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │185 + .widget = .{ .text_box = text_box }, │ │186 .rect = null, │ │187 - .min_size = .{ .width = auth_tab.minWidth(), .height = null }, │ │187 + .min_size = .{ .width = label.len + 2, .height = null }, │ │188 }); │ │189 } │ │190 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │249 for (tabs_box.children.keys(), tabs_box.children.values()) |id, *child| { │ │250 const tb: ?*wgt.TextBox = switch (child.widget) { │ │251 .text_box => |*x| x, │ │252 - .auth_tab => |*at| blk: { │ │253 - // the label tracks login state per frame, so the width must too│ │254 - child.min_size = .{ .width = at.minWidth(), .height = null }; │ │255 - break :blk &at.text_box; │ │256 - }, │ │252 else => null, │ │253 }; │ │254 if (tb) |t| ui.widget.markSelected(t, selected_tab == id); │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯