home · contact · privacy
Expand window titles in status line. master
authorChristian Heller <c.heller@plomlompom.de>
Tue, 5 Aug 2025 00:50:07 +0000 (02:50 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 5 Aug 2025 00:50:07 +0000 (02:50 +0200)
ircplom/client_tui.py
ircplom/tui_base.py

index 6245571bc3d3bb79d0cb1f1f3ad799beeeb627ab..eed3137e27e634054356698db7e802166f1198c4 100644 (file)
@@ -44,6 +44,10 @@ class _ClientWindow(Window, ClientQueueMixin):
         self.chat = chat
         super().__init__(**kwargs)
 
+    @property
+    def status_title(self) -> str:
+        return f'{super().status_title}|{self.client_id}|{self.chat}'
+
     def cmd__disconnect(self, quit_msg: str = 'ircplom says bye') -> None:
         'Send QUIT command to server.'
         self._cput(SendEvent,
index 5a758d6ddb65f2396d74ed1231bcca876104f20b..d084df69e52f27675b12b58c7938a2141fd30a48 100644 (file)
@@ -313,6 +313,11 @@ class Window(_Widget):
         self.prompt.set_geometry(_YX(self._term.size.y - 1, self._term.size.x))
         return True
 
+    @property
+    def status_title(self) -> str:
+        'Window title to display in status line.'
+        return str(self.idx)
+
     def draw(self) -> bool:
         self._term.clear()
         if not super().draw():
@@ -325,8 +330,8 @@ class Window(_Widget):
                 for y, line in enumerate(lines):
                     self._term.write(line, y)
             return False
-        idx_box = f'[{self.idx}]'
-        status_line = idx_box + '=' * (self._term.size.x - len(idx_box))
+        title_box = f'[{self.status_title}]'
+        status_line = title_box + '=' * (self._term.size.x - len(title_box))
         self.log.draw()
         self._term.write(status_line, self._y_status)
         self.prompt.draw()