类型 MessageScroller

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

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

MessageScroller is a vertical, source-owned scrolling recipe. The caller owns the offset, item list, content extent, and any auto-follow policy. Scoped wheel routing, pointer capture, inertia, observers, timers, and virtualization are runtime responsibilities and are not faked here.

构造函数

BeginMessageScroller#

func BeginMessageScroller(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect, contentExtent, offset float32) MessageScroller

BeginMessageScroller declares a vertically clipped message viewport.

方法

BeginContent#

func (scroller *MessageScroller) BeginContent() MessageScrollerGeometry

BeginContent pushes the viewport clip for caller-painted message items.

Buttons#

func (scroller MessageScroller) Buttons(startID ui.ID, startLabel string, endID ui.ID, endLabel string) MessageScroller

Buttons configures start/end jump actions. Visibility is derived from the clamped offset; inactive controls keep geometry but emit no paint or hit.

Disabled#

func (scroller MessageScroller) Disabled() MessageScroller

Disabled preserves deterministic geometry while suppressing all actions.

EndContent#

func (scroller *MessageScroller) EndContent() MessageScrollerGeometry

EndContent closes the clip, then paints the thin thumb and active jump buttons.

Geometry#

func (scroller MessageScroller) Geometry() MessageScrollerGeometry

Geometry returns the complete clamped layout without changing Canvas state.

ItemGeometry#

func (scroller MessageScroller) ItemGeometry(index int, contentOffset, extent float32) MessageScrollerItemGeometry

ItemGeometry translates one caller-supplied item offset and extent. The index is carried unchanged so stable application identity stays explicit.

Scrollbar#

func (scroller MessageScroller) Scrollbar(id ui.ID, label, value string) MessageScroller

Scrollbar configures the optional thin scrollbar as a typed slider.