From 7aafcd7c01d0279334bf35e14d1a666102f9fc35 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 9 Apr 2023 16:33:11 -0700 Subject: [PATCH] Update add_title_pane() to match set_title() --- scripts/wk/ui/tui.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/wk/ui/tui.py b/scripts/wk/ui/tui.py index a6662d14..f7834701 100644 --- a/scripts/wk/ui/tui.py +++ b/scripts/wk/ui/tui.py @@ -65,13 +65,18 @@ class TUI(): # Add pane self.layout['Info']['Panes'].append(tmux.split_window(**tmux_args)) - def add_title_pane(self, text) -> None: - """Add additional pane to title row.""" + def add_title_pane(self, line1, line2=None, colors=None) -> None: + """Add pane to title row.""" + lines = [line1, line2] + colors = colors if colors else self.title_colors.copy() + if not line2: + lines.pop() + colors.pop() tmux_args = { 'behind': True, 'lines': TMUX_TITLE_HEIGHT, 'target_id': None, - 'text': text, + 'text': ansi.color_string(lines, colors, sep='\n'), 'vertical': True, } if self.layout['Title']['Panes']: @@ -186,6 +191,7 @@ class TUI(): ), ) + # Functions def fix_layout(layout, forced=False): """Fix pane sizes based on layout."""