类型 ContextMenuOptions
API 文档由 Go 源码生成,内容为英文。
type ContextMenuOptions struct {
Layer uint16
Scope ui.ID
DismissID ui.ID
// ID and Side are those of DropdownMenuOptions. A context menu appears and
// disappears at once, as a native one does, so neither changes how it moves.
ID ui.ID
Side OverlaySide
// Viewport, with DismissID, makes the menu declare a hit over the whole
// window behind its surface, so pressing anywhere outside it reports
// DismissID (Escape reports it too). The menu is also kept inside it: shifted
// back when it sticks out, and shortened, so that it scrolls, when it is taller
// than the window. Leave it empty to dismiss only on Escape and handle outside
// presses yourself.
Viewport ui.Rect
// Scroll is the scroll position of a menu whose items do not all fit its
// bounds (see MenuScroll). Without one such a menu shows only the items at
// its top.
Scroll *MenuScroll
// Submenu makes this the content of a submenu, which has a smaller minimum
// width (128) than a context menu (144).
Submenu bool
// RowHeight is the height of an item row. Zero is the standard 32px; a menu
// with many items can ask for a denser one (24, say). Group labels, separators
// and everything else keep their size. An icon never grows past the row.
RowHeight float32
}ContextMenuOptions supplies application-owned overlay identities.