summaryrefslogtreecommitdiff
path: root/client/ui.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/ui.go')
-rw-r--r--client/ui.go42
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