Selected channel is now marked blue
MODIFY
internal/ui/window.go
internal/ui/window.go
@@ -39,6 +39,7 @@ type Window struct {
shownMessages []*discordgo.Message
selectedGuild *discordgo.UserGuild
+ selectedChannelNode *tview.TreeNode
selectedChannel *discordgo.Channel
}
@@ -123,8 +124,15 @@ func NewWindow(discord *discordgo.Session) (*Window, error) {
//of always the same one.
channelToConnectTo := channel
newNode.SetSelectedFunc(func() {
+ if window.selectedChannelNode != nil {
+ //For some reason using tcell.ColorDefault causes hovering to render incorrect.
+ window.selectedChannelNode.SetColor(tcell.ColorWhite)
+ }
+
window.selectedChannel = channelToConnectTo
+ window.selectedChannelNode = newNode
+ newNode.SetColor(tcell.ColorTeal)
discordError := window.LoadChannel(channelToConnectTo)
if discordError != nil {
log.Fatalf("Error loading messages (%s).", discordError.Error())

Selected channel is now marked blue