tangled
alpha
login
or
join now
rockorager.dev
/
comlink
2
fork
atom
an experimental irc client
2
fork
atom
overview
issues
pulls
pipelines
ui: add bg to text limit
rockorager.dev
1 year ago
a89a096f
b824f5cf
verified
This commit was signed with the committer's
known signature
.
rockorager.dev
SSH Key Fingerprint:
SHA256:qn/Fjy7CpbcogGEPB14Y53hLnQleZNFY9lkQnuudFLs=
+5
-5
1 changed file
expand all
collapse all
unified
split
src
irc.zig
+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
711
-
"{d}/{d}",
711
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
715
-
.{ .fg = .{ .index = 1 } }
715
715
+
.{ .fg = .{ .index = 1 }, .reverse = true }
716
716
else
717
717
-
.{ .dim = true };
717
717
+
.{ .bg = self.client.app.blendBg(30) };
718
718
const limit_text: vxfw.Text = .{ .text = limit, .style = style };
719
719
-
const limit_ctx = ctx.withConstraints(.{}, ctx.max);
719
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
729
-
.{ .height = 1, .width = max.width -| limit_s.size.width -| 1 },
729
729
+
.{ .height = 1, .width = max.width -| limit_s.size.width },
730
730
);
731
731
732
732
// Draw the text field