类型 AttachmentGroup

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

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

AttachmentGroup lays attachments out in a row, the official AttachmentGroup: gap-3 between them and py-1 above and below. It only places; scrolling the row (the official one scrolls and snaps) is the caller's, by shifting the bounds it begins with inside a clip, and Extent is how far there is to scroll.

构造函数

BeginAttachmentGroup#

func BeginAttachmentGroup(theme ui.Theme, bounds ui.Rect) AttachmentGroup

BeginAttachmentGroup starts a row of attachments at the left of bounds.

方法

Extent#

func (group AttachmentGroup) Extent() float32

Extent is the width of the attachments placed so far with their gaps.

Fits#

func (group AttachmentGroup) Fits(size ui.Size) bool

Fits reports whether a slot of the given size would end inside the group's width, for a caller that wraps or truncates the row instead of scrolling it.

Height#

func (group AttachmentGroup) Height(attachmentHeight float32) float32

Height is the group's height for attachments up to the given height: they and the padding above and below.

Next#

func (group *AttachmentGroup) Next(size ui.Size) ui.Rect

Next reserves a slot of the given size, vertically at the group's top padding, and returns its bounds.