类型 Command

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

type Command struct {

	// list lays the results out under the input row, scrolled by options.Scroll.

}

Command paints one command snapshot. Filtering, selection, and keyboard movement remain explicit application state.

构造函数

BeginCommand#

func BeginCommand(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect, options CommandOptions) Command

BeginCommand paints the command surface and input row.

方法

AddEmpty#

func (command *Command) AddEmpty(label string) ui.Rect

AddEmpty paints the official centered empty-result state (`py-6 text-sm`).

AddGroup#

func (command *Command) AddGroup(label string) ui.Rect

AddGroup paints an official compact group heading.

AddItem#

func (command *Command) AddItem(item CommandItem) ui.Rect

AddItem paints one command result with selected, checked, and disabled state. The rectangle is empty when the row is scrolled out of the list.

AddSeparator#

func (command *Command) AddSeparator() ui.Rect

AddSeparator paints the one-pixel group divider.

Bounds#

func (command Command) Bounds() ui.Rect

Bounds returns the command surface geometry.

End#

func (command *Command) End()

End paints the scrollbar of a list whose results did not all fit, after the last result. A list that fits needs no End.

NextItemBounds#

func (command Command) NextItemBounds() ui.Rect

NextItemBounds returns the next result row without mutating paint state.