From 3c21281adaccafebe818cfb34b17ec688c94bd32 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 1 Mar 2020 17:11:56 +0200 Subject: Implement selecting message to reply/react to with keyboard --- ui/messages/base.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ui/messages/base.go') diff --git a/ui/messages/base.go b/ui/messages/base.go index 4d82b00..e86b85c 100644 --- a/ui/messages/base.go +++ b/ui/messages/base.go @@ -85,6 +85,13 @@ type UIMessage struct { Renderer MessageRenderer } +func (msg *UIMessage) GetEvent() *event.Event { + if msg == nil { + return nil + } + return msg.Event +} + const DateFormat = "January _2, 2006" const TimeFormat = "15:04:05" @@ -314,9 +321,9 @@ func (msg *UIMessage) DrawReactions(screen mauview.Screen) { } func (msg *UIMessage) Draw(screen mauview.Screen) { - screen = msg.DrawReply(screen) - msg.Renderer.Draw(screen) - msg.DrawReactions(screen) + proxyScreen := msg.DrawReply(screen) + msg.Renderer.Draw(proxyScreen) + msg.DrawReactions(proxyScreen) if msg.IsSelected { w, h := screen.Size() for x := 0; x < w; x++ { @@ -324,7 +331,7 @@ func (msg *UIMessage) Draw(screen mauview.Screen) { mainc, combc, style, _ := screen.GetContent(x, y) _, bg, _ := style.Decompose() if bg == tcell.ColorDefault { - screen.SetContent(x, y, mainc, combc, style.Background(tcell.ColorLightSkyBlue)) + screen.SetContent(x, y, mainc, combc, style.Background(tcell.ColorDarkGreen)) } } } -- cgit v1.2.3