theme/material3/docking.go

Functions Structs

Functions

func PaintZoneBorder

PaintZoneBorder renders the border between a zone and the center using M3 outline-variant.

func (p DockingPainter) PaintZoneBorder(canvas widget.Canvas, borderRect geometry.Rect, _ docking.Zone) {
	if borderRect.IsEmpty() {
		return
	}
	colors := p.resolveColors()
	canvas.DrawRect(borderRect, colors.Border)
}

func PaintZoneTabs

PaintZoneTabs renders the tab header bar using M3 surface-variant and primary accent.

func (p DockingPainter) PaintZoneTabs(canvas widget.Canvas, ps docking.ZoneTabsPaintState) {
	if ps.TabBarBounds.IsEmpty() {
		return
	}

	colors := p.effectiveColors(ps.ColorScheme)

	// Tab bar background.
	canvas.DrawRect(ps.TabBarBounds, colors.TabBarBackground)

	// Draw each tab.
	for i := range ps.Tabs {
		ts := &ps.Tabs[i]
		m3PaintDockingTab(canvas, ts, colors)
	}

	// Active tab indicator.
	if ps.ActiveIdx >= 0 && ps.ActiveIdx < len(ps.Tabs) {
		active := &ps.Tabs[ps.ActiveIdx]
		indicatorBounds := geometry.NewRect(
			active.Bounds.Min.X,
			active.Bounds.Max.Y-m3DockingIndicatorHeight,
			active.Bounds.Width(),
			m3DockingIndicatorHeight,
		)
		canvas.DrawRect(indicatorBounds, colors.ActiveTabBackground)
	}
}

Structs

type DockingPainter struct

DockingPainter renders docking zones and tab bars using Material 3 design tokens.

It maps M3 color roles to docking elements: surface for zones, outline for borders,

and surface-variant for the tab bar background.

 

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

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