From 553ebc26cda61b567418205f7ee60be122b3c84f Mon Sep 17 00:00:00 2001 From: citrons Date: Fri, 6 Jun 2025 00:49:26 -0500 Subject: clickable, draggable channel list --- client/main.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'client/main.go') diff --git a/client/main.go b/client/main.go index 5993cf6..707cf7e 100644 --- a/client/main.go +++ b/client/main.go @@ -28,19 +28,21 @@ func main() { defer globalApp.Stop() drawTick := time.Tick(time.Second / 60) - redraw := true for { select { case m := <-globalApp.Messages(): m.Handle(globalApp) - redraw = true + globalApp.redraw = true case e := <-tui.Events(): globalApp.onInput(e) - redraw = true + globalApp.redraw = true case <-drawTick: - if redraw { - for i := 0; i < 2; i++ { - // some information takes two passes to propogate + if globalApp.redraw { + globalApp.show() + tui.DrawLayout() + // multi-pass + for globalApp.redraw { + globalApp.redraw = false tui.Clear() globalApp.show() tui.DrawLayout() @@ -48,12 +50,11 @@ func main() { if tui.Present() != nil { os.Exit(-1) } - redraw = false } case text := <-globalApp.activePaste: globalApp.onPaste(text) globalApp.activePaste = nil - redraw = true + globalApp.redraw = true } if globalApp.quit == true { return -- cgit v1.2.3