an experimental irc client

ui(Scrollbar): update style

+5 -2
+5 -2
src/Scrollbar.zig
··· 5 5 const Scrollbar = @This(); 6 6 7 7 /// character to use for the scrollbar 8 - character: vaxis.Cell.Character = .{ .grapheme = "▐", .width = 1 }, 8 + const character: vaxis.Cell.Character = .{ .grapheme = "▐", .width = 1 }; 9 + const empty: vaxis.Cell = .{ .char = character, .style = .{ .fg = .{ .index = 8 } } }; 9 10 10 11 /// style to draw the bar character with 11 12 style: vaxis.Style = .{}, ··· 54 55 // don't draw when all items can be shown 55 56 if (self.view_size >= self.total) return surface; 56 57 58 + @memset(surface.buffer, empty); 59 + 57 60 // (view_size / total) * window height = size of the scroll bar 58 61 const bar_height = @max(std.math.divCeil(usize, self.view_size * max.height, self.total) catch unreachable, 1); 59 62 ··· 62 65 63 66 var i: usize = 0; 64 67 while (i <= bar_height) : (i += 1) 65 - surface.writeCell(0, @intCast(bar_bottom -| i), .{ .char = self.character, .style = self.style }); 68 + surface.writeCell(0, @intCast(bar_bottom -| i), .{ .char = character, .style = self.style }); 66 69 67 70 return surface; 68 71 }