diff --git a/docs/config.md b/docs/config.md index 5d35d66..08ddcf3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -375,6 +375,12 @@ Default: `">"` Default: `"<"` +### ui.messages_list.image_protocol + +How avatars and attachment previews are drawn: "auto", "kitty" or "halfblocks". + +Default: `"auto"` + ### ui.messages_list.attachments #### ui.messages_list.attachments.show_links @@ -394,12 +400,6 @@ Whether to draw image attachments and embedded images below their messages. Default: `true` -#### ui.messages_list.attachments.protocol - -How previews are drawn: "auto", "kitty" or "halfblocks". - -Default: `"auto"` - ### ui.messages_list.avatars #### ui.messages_list.avatars.preview diff --git a/internal/config/ui.go b/internal/config/ui.go index e772864..937e63a 100644 --- a/internal/config/ui.go +++ b/internal/config/ui.go @@ -175,6 +175,9 @@ type ( ReplyIndicator string `toml:"reply_indicator"` ForwardedIndicator string `toml:"forwarded_indicator"` + // How avatars and attachment previews are drawn: "auto", "kitty" or "halfblocks". + ImageProtocol string `toml:"image_protocol"` + Attachments AttachmentsUIConfig `toml:"attachments"` Avatars AvatarsUIConfig `toml:"avatars"` Grouping GroupingUIConfig `toml:"grouping"` @@ -200,8 +203,6 @@ type ( AllowedMIMETypes MIMETypes `toml:"allowed_mime_types"` // Whether to draw image attachments and embedded images below their messages. Preview bool `toml:"preview"` - // How previews are drawn: "auto", "kitty" or "halfblocks". - Protocol string `toml:"protocol"` } MentionsListUIConfig struct { @@ -215,7 +216,7 @@ type ( func defaultUI() UIConfig { left := TitleUIConfig{AlignmentWrapper{tview.AlignmentLeft}} round := BorderSetWrapper{tview.BorderSetRound()} - attachments := AttachmentsUIConfig{ShowLinks: true, AllowedMIMETypes: MIMETypes{"image/*", "video/*"}, Preview: true, Protocol: "auto"} + attachments := AttachmentsUIConfig{ShowLinks: true, AllowedMIMETypes: MIMETypes{"image/*", "video/*"}, Preview: true} return UIConfig{ Tabs: TabsUIConfig{ Alignment: AlignmentWrapper{tview.AlignmentCenter}, @@ -230,7 +231,7 @@ func defaultUI() UIConfig { GuildsTree: GuildsTreeUIConfig{TreeUIConfig{Graphics: true}, true}, MembersTree: TreeUIConfig{Graphics: true}, ScrollBar: ScrollBarUIConfig{SymbolSet: SymbolSetWrapper{boxDrawing}, Visibility: ScrollBarVisibilityWrapper{viewport.ScrollBarVisibilityAutomatic}}, - MessagesList: MessagesListUIConfig{Spacing: 1, ReplyIndicator: ">", ForwardedIndicator: "<", Attachments: attachments, Avatars: AvatarsUIConfig{Preview: true, Height: 2}, Grouping: GroupingUIConfig{Enabled: true, Interval: 10 * time.Minute}}, + MessagesList: MessagesListUIConfig{Spacing: 1, ReplyIndicator: ">", ForwardedIndicator: "<", ImageProtocol: "auto", Attachments: attachments, Avatars: AvatarsUIConfig{Preview: true, Height: 2}, Grouping: GroupingUIConfig{Enabled: true, Interval: 10 * time.Minute}}, MentionsList: MentionsListUIConfig{MinWidth: 20}, } } diff --git a/internal/ui/chat/messageslist/model.go b/internal/ui/chat/messageslist/model.go index 94ac4ec..d985c8c 100644 --- a/internal/ui/chat/messageslist/model.go +++ b/internal/ui/chat/messageslist/model.go @@ -1151,7 +1151,7 @@ func (m Model) Update(msg tview.Msg) (Model, tview.Cmd) { m.cellWidth, m.cellHeight = uint(width/cols), uint(height/rows) } case tview.TerminalInfoMsg: - switch m.cfg.UI.MessagesList.Attachments.Protocol { + switch m.cfg.UI.MessagesList.ImageProtocol { case "kitty": m.kitty = true case "halfblocks":