类型 ContextMenuItem

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

type ContextMenuItem struct {
	ID    ui.ID
	Label string
	// Description is an optional muted second line. It increases the item height
	// and is ellipsized to the available width; Hint may carry the full text.
	Description string
	Shortcut    string
	// Keys, when set, replace Shortcut with one keycap per entry (for example
	// "⌘", "⌥", "H"), painted with Kbd at the row's trailing edge.
	Keys []string
	// TrailingWidth reserves that much of the row's trailing edge for content the
	// caller paints itself (a switch, a badge, a small icon) with AddItemSlot and
	// BeginContent. Keys and Shortcut are not drawn when it is set.
	TrailingWidth float32
	Value         string
	Hint          string
	Kind          ContextMenuItemKind
	Variant       ContextMenuItemVariant
	Checked       bool
	Selected      bool
	Disabled      bool
	Inset         bool
	Expanded      bool
	// Icon, when it has any geometry, is painted before the label (after the
	// checkbox or radio indicator, if the item has one). A single-color icon takes
	// the item's text color; a multi-color one keeps its own.
	Icon ui.Icon
}

ContextMenuItem describes one stable menu action.