╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │ 8 const Key = xitui.input.Key; │ │ 9 const Grid = xitui.grid.Grid; │ │10 const Focus = xitui.focus.Focus; │ │11 + │ │12 +const repos_tab_label = "repos"; │ │13 +const users_tab_label = "users"; │ │14 +const settings_tab_label = "settings"; │ │15 │ │16 pub const AuthTab = @import("./../AuthTab.zig");│ │17 │ ╰────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │90 │ │91 // repos tab │ │92 { │ │89 - var text_box = try wgt.TextBox.init(allocator, "repos", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │93 + var text_box = try wgt.TextBox.init(allocator, repos_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │94 errdefer text_box.deinit(allocator); │ │95 text_box.getFocus().mode = .all; │ │96 text_box.getFocus().kind = .{ .custom = repos_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │ 99 try box.children.put(allocator, text_box.getFocus().id, .{ │ │100 .widget = .{ .text_box = text_box }, │ │101 .rect = null, │ │ 98 - .min_size = .{ .width = "repos".len + 2, .height = null }, │ │102 + .min_size = .{ .width = repos_tab_label.len + 2, .height = null },│ │103 }); │ │104 } │ │105 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │106 // users tab │ │107 { │ │104 - var text_box = try wgt.TextBox.init(allocator, "users", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │108 + var text_box = try wgt.TextBox.init(allocator, users_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │109 errdefer text_box.deinit(allocator); │ │110 text_box.getFocus().mode = .all; │ │111 text_box.getFocus().kind = .{ .custom = users_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │114 try box.children.put(allocator, text_box.getFocus().id, .{ │ │115 .widget = .{ .text_box = text_box }, │ │116 .rect = null, │ │113 - .min_size = .{ .width = "users".len + 2, .height = null }, │ │117 + .min_size = .{ .width = users_tab_label.len + 2, .height = null },│ │118 }); │ │119 } │ │120 │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │132 │ │133 // settings tab. settings are account preferences, so it needs a login. │ │134 if (session.data.user_id != null) { │ │131 - var text_box = try wgt.TextBox.init(allocator, "settings", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │135 + var text_box = try wgt.TextBox.init(allocator, settings_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │136 errdefer text_box.deinit(allocator); │ │137 text_box.getFocus().mode = .all; │ │138 text_box.getFocus().kind = .{ .custom = settings_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │141 try box.children.put(allocator, text_box.getFocus().id, .{ │ │142 .widget = .{ .text_box = text_box }, │ │143 .rect = null, │ │140 - .min_size = .{ .width = "settings".len + 2, .height = null }, │ │144 + .min_size = .{ .width = settings_tab_label.len + 2, .height = null },│ │145 }); │ │146 } │ │147 │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯