类型 Breadcrumb

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

type Breadcrumb struct {

	// font size; zero selects the theme's body size

}

Breadcrumb incrementally paints one breadcrumb row without collecting items in a slice. Each Add call emits its commands immediately and advances the insertion point, keeping the paint path allocation-free after warm-up.

构造函数

BeginBreadcrumb#

func BeginBreadcrumb(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect) Breadcrumb

BeginBreadcrumb starts a compact breadcrumb row.

方法

AddCurrent#

func (breadcrumb *Breadcrumb) AddCurrent(label string)

AddCurrent paints the current destination with stronger emphasis.

AddDisabled#

func (breadcrumb *Breadcrumb) AddDisabled(label string)

AddDisabled paints an unavailable destination without a hit region.

AddEllipsis#

func (breadcrumb *Breadcrumb) AddEllipsis(id ui.ID)

AddEllipsis paints the overflow item: three dots in a 20px box. A non-zero id makes it a button, typically opening a menu of the omitted levels; a zero id leaves it presentational.

FontSize#

func (breadcrumb Breadcrumb) FontSize(size float32) Breadcrumb

FontSize sets the size of every item and separator. The default is the theme's body size (text-sm); a denser path, say in a toolbar, can pass the small size.