类型 DropdownMenuOptions
API 文档由 Go 源码生成,内容为英文。
type DropdownMenuOptions struct {
Layer uint16
Scope ui.ID
DismissID ui.ID
// ID names the menu for its entrance and exit when DismissID, the default,
// does not tell it from another menu painted under the same Scope. Side is
// the edge of its anchor the menu opens on (the zero value is under it), which
// is the edge it slides in from. End has to be called for the menu to animate.
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 (96) than a menu opened by a trigger (128).
Submenu bool
}DropdownMenuOptions supplies application-owned overlay identities.