类型 DropdownMenuItem
API 文档由 Go 源码生成,内容为英文。
type DropdownMenuItem struct {
ID ui.ID
Label 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 DropdownMenuItemKind
Variant DropdownMenuItemVariant
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
}DropdownMenuItem describes one stable menu action.