theme/cupertino/scrollbar.go

Functions Structs

Functions

func PaintScrollbar

PaintScrollbar renders thin Cupertino-style scrollbars.

func (p ScrollbarPainter) PaintScrollbar(canvas widget.Canvas, ps scrollview.PaintState) {
	if ps.Bounds.IsEmpty() {
		return
	}

	colors := ps.ColorScheme
	if colors == (scrollview.ScrollbarColorScheme{}) {
		colors = p.resolveColors()
	}

	// Override paint state with resolved colors and delegate.
	ps.ColorScheme = colors
	scrollview.DefaultPainter{}.PaintScrollbar(canvas, ps)
}

Structs

type ScrollbarPainter struct

ScrollbarPainter renders scrollbars using Apple HIG design tokens.

Cupertino scrollbars are very thin (3px), use rounded ends, and appear

only during scrolling with a fade-out effect. They overlay content

rather than taking up layout space.

 

If Theme is nil, ScrollbarPainter falls back to the default Cupertino palette.

type ScrollbarPainter struct {
	Theme *Theme	// nil uses default fallback
}