aerc/widgets/dialog.go
Koni Marti 00e908e2ae widgets: add dialog interface
Implement an interface for aerc's dialog implementation. Provide dialogs
the ability to set their own height and width of their drawing context.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 09:30:37 +02:00

25 lines
467 B
Go

package widgets
import (
"git.sr.ht/~rjarry/aerc/lib/ui"
)
type Dialog interface {
ui.DrawableInteractive
ContextHeight() (func(int) int, func(int) int)
}
type dialog struct {
ui.DrawableInteractive
y func(int) int
h func(int) int
}
func (d *dialog) ContextHeight() (func(int) int, func(int) int) {
return d.y, d.h
}
func NewDialog(d ui.DrawableInteractive, y func(int) int, h func(int) int) Dialog {
return &dialog{DrawableInteractive: d, y: y, h: h}
}