diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-03-01 17:11:56 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-03-01 17:11:56 +0200 |
commit | 3c21281adaccafebe818cfb34b17ec688c94bd32 (patch) | |
tree | 119c2d705e1375d6b424e00216646b294233d7e6 /ui/messages | |
parent | da4a2c670d9c1f399ad87ddbc109445f2d974edb (diff) |
Implement selecting message to reply/react to with keyboard
Diffstat (limited to 'ui/messages')
-rw-r--r-- | ui/messages/base.go | 15 |
1 files changed, 11 insertions, 4 deletions
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)) } } } |