类型 MenubarContent

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

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

MenubarContent paints one application-positioned open popup.

构造函数

BeginMenubarContent#

func BeginMenubarContent(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect, options MenubarOverlayOptions) MenubarContent

BeginMenubarContent starts an open popup. Menubar popups use Vega's 9rem minimum width (8rem for a submenu).

方法

AddItem#

func (content *MenubarContent) AddItem(item MenubarItem) ui.Rect

AddItem paints one popup action, checkbox, radio option, or submenu trigger. The rectangle is empty when the row is scrolled out of the popup.

AddItemSlot#

func (content *MenubarContent) AddItemSlot(item MenubarItem) (row, slot ui.Rect)

AddItemSlot paints an item like AddItem and also returns the rectangle its TrailingWidth reserved, vertically centered in the row and ending 8px from its edge. The slot is empty when the item has no TrailingWidth or is scrolled out of the popup. Paint into it between BeginContent and EndContent.

AddLabel#

func (content *MenubarContent) AddLabel(label string, inset bool) ui.Rect

AddLabel paints one popup group label.

AddSeparator#

func (content *MenubarContent) AddSeparator() ui.Rect

AddSeparator paints a group divider.

BeginContent#

func (content *MenubarContent) BeginContent()

BeginContent enters the popup's layer and focus scope so the caller's own components, painted until EndContent, belong to it.

Bounds#

func (content MenubarContent) Bounds() ui.Rect

Bounds returns the normalized popup geometry.

End#

func (content *MenubarContent) End()

End paints the scrollbar of a popup whose items did not all fit, after the last item, and ends the popup's entrance and exit: call it once the last item is painted, or the popup appears and disappears at once.

EndContent#

func (content *MenubarContent) EndContent()

EndContent leaves the layer and focus scope BeginContent entered.

NextItemBounds#

func (content MenubarContent) NextItemBounds() ui.Rect

NextItemBounds reports the next keyboard-navigation row.