diff options
| author | raven <citrons@mondecitronne.com> | 2026-02-17 15:21:17 -0600 |
|---|---|---|
| committer | raven <citrons@mondecitronne.com> | 2026-02-17 15:22:10 -0600 |
| commit | 86df926a15da7c5447788b00a34995e0512bd286 (patch) | |
| tree | 13249c0cc6c323ad91ebfc32bffec65a915da23c /client/ui.go | |
| parent | 61ba037f8a70d6a842853b9f0f0b782873e0a763 (diff) | |
direct message list
Diffstat (limited to 'client/ui.go')
| -rw-r--r-- | client/ui.go | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/client/ui.go b/client/ui.go index fc8d9a6..6282bc6 100644 --- a/client/ui.go +++ b/client/ui.go @@ -212,6 +212,40 @@ func (a *application) showWindow() { tui.Pop() } +func (a *application) showChannelLists() { + tui.Push("", tui.Box { + Width: tui.Children, Height: tui.Fill, Dir: tui.Down, + }) + + a.channelList.show(&a.channelScroll, func(cl channelLocation) { + switch { + case tui.MenuOption("list"): + w := globalApp.windowCache.Open(cl) + switch w.(type) { + case *channelWindow: + w.(*channelWindow).userList(func(msg userListMsg) { + globalApp.cmdWindow.Buffer().Add(msg) + }) + } + case tui.MenuOption("leave"): + w := globalApp.windowCache.Open(cl) + switch w.(type) { + case *channelWindow: + defer w.(*channelWindow).leaveChannel() + } + if cl == globalApp.currentWindow { + globalApp.goTo(cmdWindowLocation {}) + } + } + }) + tui.Push("", tui.Box {Width: 12, Height: 1}) + tui.Text(strings.Repeat("─", 12), nil) + tui.Pop() + a.dmList.show(&a.dmScroll, func(cl channelLocation) {}) + + tui.Pop() +} + func (a *application) show() { s := tui.Size() tui.Push("", tui.Box { @@ -219,9 +253,13 @@ func (a *application) show() { Dir: tui.Right, }) - a.channelList.show(&a.channelScroll) + a.showChannelLists() + tui.Push("border", tui.Box {Width: 1, Height: tui.Fill}) - tui.Text(strings.Repeat("│", s.Height), nil) + tui.Text(strings.Repeat("│", s.Height / 2), nil) + tui.Text("┤", nil) + tui.Text(strings.Repeat("│", s.Height / 2), nil) tui.Pop() + a.showWindow() }
\ No newline at end of file |
