feat(msgviewer): re-enable composite renderer with scroll support and inline images
Composite mode now handles j/k/g/G/PgUp/PgDown/mouse wheel for scrolling. Text uses the configured default style. Images render inline via Vaxis. Emails without images still use the standard pager path.
This commit is contained in:
@@ -186,13 +186,16 @@ func (cc *compositeContent) CleanupFiles() {
|
||||
}
|
||||
|
||||
// Draw renders the composite content into the given UI context.
|
||||
// scroll is the row offset from the top.
|
||||
func (cc *compositeContent) Draw(ctx *ui.Context, scroll int) {
|
||||
// scroll is the row offset from the top. style is the default text style.
|
||||
func (cc *compositeContent) Draw(ctx *ui.Context, scroll int, style ...vaxis.Style) {
|
||||
width := ctx.Width()
|
||||
height := ctx.Height()
|
||||
row := -scroll // start above viewport if scrolled
|
||||
|
||||
defaultStyle := vaxis.Style{}
|
||||
if len(style) > 0 {
|
||||
defaultStyle = style[0]
|
||||
}
|
||||
|
||||
for _, b := range cc.blocks {
|
||||
switch b.blockType {
|
||||
|
||||
Reference in New Issue
Block a user