From b0fd9a1c7848343ef378b772eb76a0e99747260c Mon Sep 17 00:00:00 2001 From: citrons Date: Wed, 4 Jun 2025 12:12:13 -0500 Subject: channel list --- client/ui.go | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'client/ui.go') diff --git a/client/ui.go b/client/ui.go index 014c7e9..87edea8 100644 --- a/client/ui.go +++ b/client/ui.go @@ -67,6 +67,10 @@ func (a *application) onInput(ev tui.Event) { input.SetText("") } } + case keys.Up | keys.Alt: + a.channelList.traverse(-1) + case keys.Down | keys.Alt: + a.channelList.traverse(1) case 'p' | keys.Ctrl: a.traverseHistory(-1) case 'n' | keys.Ctrl: @@ -106,13 +110,8 @@ func (a *application) showNickBox() { tui.Pop() } -func (a *application) show() { - tui.Clear() - s := tui.Size() - tui.Push("", tui.Box { - Width: tui.BoxSize(s.Width), Height: tui.BoxSize(s.Height), - Style: &tui.Style {Fg: tui.White, Bg: colorDefault[false]}, - }) +func (a *application) showWindow() { + tui.Push("window", tui.Box {Width: tui.Fill, Height: tui.Fill}) if a.currentWindow != (cmdWindowLocation{}) { a.cmdWindow.showPreview() @@ -153,6 +152,22 @@ func (a *application) show() { tui.Pop() tui.Pop() +} + +func (a *application) show() { + tui.Clear() + s := tui.Size() + tui.Push("", tui.Box { + Width: tui.BoxSize(s.Width), Height: tui.BoxSize(s.Height), + Dir: tui.Right, + }) + + a.channelList.show() + tui.Push("border", tui.Box {Width: 1, Height: tui.Fill}) + tui.Text(strings.Repeat("│", s.Height), nil) + tui.Pop() + a.showWindow() + tui.DrawLayout() if tui.Present() != nil { os.Exit(-1) -- cgit v1.2.3