feat(config): add message_style and selected_message_style options for messages list (#717)

This commit is contained in:
Ayyan 2026-01-17 00:51:46 -05:00 • committed by GitHub
parent 3c3c33e978
commit e5a4fb25c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View file

@ -152,6 +152,8 @@ mention_style = { foreground = "blue" }
emoji_style = { foreground = "green" }
url_style = { foreground = "blue" }
attachment_style = { foreground = "yellow" }
message_style = {}
selected_message_style = { attributes = "reverse" }
[theme.mentions_list]
# Note: width and height are capped to the avaliable space

View file

@ -146,6 +146,9 @@ type (
EmojiStyle StyleWrapper `toml:"emoji_style"`
URLStyle StyleWrapper `toml:"url_style"`
AttachmentStyle StyleWrapper `toml:"attachment_style"`
MessageStyle StyleWrapper `toml:"message_style"`
SelectedMessageStyle StyleWrapper `toml:"selected_message_style"`
}
MentionsListTheme struct {

View file

@ -123,7 +123,9 @@ func (ml *messagesList) buildItem(index int, cursor int) tview.ScrollListItem {
SetDynamicColors(true).
SetText(ml.renderMessage(message))
if index == cursor {
tv.SetTextStyle(tcell.StyleDefault.Reverse(true))
tv.SetTextStyle(ml.cfg.Theme.MessagesList.SelectedMessageStyle.Style)
} else {
tv.SetTextStyle(ml.cfg.Theme.MessagesList.MessageStyle.Style)
}
return tv
}