an experimental irc client

ui: add bg to text limit

rockorager.dev a89a096f b824f5cf

verified
+5 -5
+5 -5
src/irc.zig
··· 708 708 const max_limit = maximum_message_size -| self.name.len -| 14 -| self.name.len; 709 709 const limit = try std.fmt.allocPrint( 710 710 ctx.arena, 711 - "{d}/{d}", 711 + " {d}/{d}", 712 712 .{ self.text_field.buf.realLength(), max_limit }, 713 713 ); 714 714 const style: vaxis.Style = if (self.text_field.buf.realLength() > max_limit) 715 - .{ .fg = .{ .index = 1 } } 715 + .{ .fg = .{ .index = 1 }, .reverse = true } 716 716 else 717 - .{ .dim = true }; 717 + .{ .bg = self.client.app.blendBg(30) }; 718 718 const limit_text: vxfw.Text = .{ .text = limit, .style = style }; 719 - const limit_ctx = ctx.withConstraints(.{}, ctx.max); 719 + const limit_ctx = ctx.withConstraints(.{ .width = @intCast(limit.len) }, ctx.max); 720 720 const limit_s = try limit_text.draw(limit_ctx); 721 721 722 722 try children.append(.{ ··· 726 726 727 727 const text_field_ctx = ctx.withConstraints( 728 728 ctx.min, 729 - .{ .height = 1, .width = max.width -| limit_s.size.width -| 1 }, 729 + .{ .height = 1, .width = max.width -| limit_s.size.width }, 730 730 ); 731 731 732 732 // Draw the text field