2023-05-19 21:45:39 +00:00
|
|
|
package overlay
|
|
|
|
|
|
|
|
import (
|
2023-05-28 13:04:18 +00:00
|
|
|
"time"
|
|
|
|
|
2023-05-19 21:45:39 +00:00
|
|
|
"github.com/vugu/vugu"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ToastSimple struct {
|
2023-05-25 13:59:13 +00:00
|
|
|
IconSlot vugu.Builder `vugu:"data"` // Slot for the symbol.
|
2023-05-19 21:45:39 +00:00
|
|
|
|
2023-05-28 13:04:18 +00:00
|
|
|
Message string `vugu:"data"`
|
|
|
|
Duration time.Duration // Auto close toast after this duration.
|
2023-05-19 21:45:39 +00:00
|
|
|
|
|
|
|
SignalColor string // A d3c CSS class for the color scheme of the small bar.
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *ToastSimple) OverlayClasses() (signalClasses, containerClasses string) {
|
|
|
|
return c.SignalColor, ""
|
|
|
|
}
|
2023-05-28 13:04:18 +00:00
|
|
|
|
|
|
|
func (c *ToastSimple) ToastDuration() time.Duration {
|
|
|
|
return c.Duration
|
|
|
|
}
|