~rockorager/comlink

ui: set window title to current channel v1 PROPOSED

Gregory Anders: 1
 ui: set window title to current channel

 1 files changed, 10 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rockorager/comlink/patches/53915/mbox | git am -3
Learn more about email & git

[PATCH] ui: set window title to current channel Export this patch

---
 src/App.zig | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/App.zig b/src/App.zig
index 7e7e0c1..5169ab2 100644
--- a/src/App.zig
+++ b/src/App.zig
@@ -1532,7 +1532,9 @@ fn draw(self: *App) !void {
                    self.loop.?.postEvent(.redraw);
                }
            }
            var chan_style: vaxis.Style = if (row == self.state.buffers.selected_idx)

            const is_current = row == self.state.buffers.selected_idx;
            var chan_style: vaxis.Style = if (is_current)
                .{
                    .fg = if (client.status == .disconnected) .{ .index = 8 } else .default,
                    .reverse = true,
@@ -1590,7 +1592,7 @@ fn draw(self: *App) !void {
                        .style = chan_style,
                    },
                );
            if (row == self.state.buffers.selected_idx) {
            if (is_current) {
                var write_buf: [128]u8 = undefined;
                if (channel.has_unread) {
                    channel.has_unread = false;
@@ -1618,6 +1620,12 @@ fn draw(self: *App) !void {
                };
                _ = try topic_win.print(&topic_seg, .{ .wrap = .none });

                {
                    var buf: [64]u8 = undefined;
                    const title = try std.fmt.bufPrint(&buf, "{s} - comlink", .{channel.name});
                    try self.vx.setTitle(self.tty.anyWriter(), title);
                }

                if (hasMouse(member_list_win, self.state.mouse)) |mouse| {
                    switch (mouse.button) {
                        .wheel_up => {
-- 
2.45.2