this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

ui: use fancy prefixes in member list

+12 -8
+12 -8
src/irc.zig
··· 173 173 typing: u32 = 0, 174 174 175 175 pub fn compare(_: void, lhs: Member, rhs: Member) bool { 176 - return if (lhs.prefix != ' ' and rhs.prefix == ' ') 177 - true 178 - else if (lhs.prefix == ' ' and rhs.prefix != ' ') 179 - false 180 - else 181 - std.ascii.orderIgnoreCase(lhs.user.nick, rhs.user.nick).compare(.lt); 176 + if (lhs.prefix == rhs.prefix) { 177 + return std.ascii.orderIgnoreCase(lhs.user.nick, rhs.user.nick).compare(.lt); 178 + } 179 + return lhs.prefix > rhs.prefix; 182 180 } 183 181 184 182 pub fn widget(self: *Member) vxfw.Widget { ··· 235 233 else 236 234 .{ .fg = self.user.color }; 237 235 if (self.has_mouse) style.reverse = true; 238 - var prefix = try ctx.arena.alloc(u8, 1); 239 - prefix[0] = self.prefix; 236 + const prefix: []const u8 = switch (self.prefix) { 237 + '~' => "󰜥 ", // founder 238 + '&' => "󰪍 ", // protected 239 + '@' => " ", // operator 240 + '%' => " ", // half op 241 + '+' => " ", // voice 242 + else => try std.fmt.allocPrint(ctx.arena, "{c} ", .{self.prefix}), 243 + }; 240 244 const text: vxfw.RichText = .{ 241 245 .text = &.{ 242 246 .{ .text = prefix, .style = style },