theme/material3/splitview.go

Functions Structs

Functions

func PaintDivider

PaintDivider renders a split view divider according to Material 3 specifications.

func (p SplitViewPainter) PaintDivider(canvas widget.Canvas, ps splitview.PaintState) {
	if ps.DividerRect.IsEmpty() {
		return
	}

	// Determine the color scheme to use.
	colors := ps.ColorScheme
	if colors == (splitview.DividerColorScheme{}) {
		colors = p.resolveColors()
	}

	// Resolve divider background color based on interaction state.
	bgColor := m3ResolvedSplitDividerColor(ps, colors)

	// Draw divider background.
	canvas.DrawRect(ps.DividerRect, bgColor)

	// Draw center handle indicator.
	m3PaintSplitHandle(canvas, ps.DividerRect, ps.Orientation, colors.Handle)
}

Structs

type SplitViewPainter struct

SplitViewPainter renders split view dividers using Material 3 design tokens.

It maps divider states (normal, hovered, dragging) to the M3 color scheme

with outline-variant for the divider and primary color for the handle.

 

If Theme is nil, SplitViewPainter falls back to the default M3 purple palette.

type SplitViewPainter struct {
	Theme *Theme	// nil uses default M3 purple fallback
}