类型 ToastLayout

API 文档由 Go 源码生成,内容为英文。

type ToastLayout struct {
	Bounds ui.Rect
	Icon   ui.Rect
	Body   ui.Rect
	Action ui.Rect
	Close  ui.Rect
}

ToastLayout exposes deterministic geometry for pointer routing and tests.

构造函数

PaintToast#

func PaintToast(canvas *ui.Canvas, theme ui.Theme, viewport ui.Rect, snapshot ToastSnapshot, options ToastOptions) ToastLayout

PaintToast paints one toast snapshot at the viewport position the options name, bottom right by default. Its height follows its text: the description wraps. It schedules no work and retains no lifetime state, except that a loading toast asks for a frame every 100ms to turn its spinner, until it is no longer painted.