类型 AlertDialog

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

type AlertDialog struct {
	// contains filtered or unexported fields
}

AlertDialog is an application-owned modal confirmation recipe.

构造函数

BeginAlertDialog#

func BeginAlertDialog(canvas *ui.Canvas, theme ui.Theme, viewport ui.Rect, options AlertDialogOptions) AlertDialog

BeginAlertDialog creates a confirmation declaration.

方法

Begin#

func (dialog AlertDialog) Begin(title, description, actionLabel, cancelLabel string) AlertDialogLayout

Begin paints the dialog and leaves its layer/scope active for custom body UI.

DisableAction#

func (dialog AlertDialog) DisableAction() AlertDialog

DisableAction keeps the primary action visible and semantically disabled.

DisableCancel#

func (dialog AlertDialog) DisableCancel() AlertDialog

DisableCancel keeps cancellation visible and semantically disabled.

Disabled#

func (dialog AlertDialog) Disabled() AlertDialog

Disabled disables both explicit dialog actions.

End#

func (dialog AlertDialog) End()

End closes the modal scope and layer and traps focus until cancellation. It also ends what the dialog animates in and out.

Paint#

func (dialog AlertDialog) Paint(title, description, actionLabel, cancelLabel string) AlertDialogLayout

Paint paints a complete confirmation and closes the modal layer.

WithMedia#

func (dialog AlertDialog) WithMedia() AlertDialog

WithMedia reserves and paints the official 64px muted media slot.