theme/devtools/docking.go

Functions Structs

Functions

func PaintZoneBorder

PaintZoneBorder renders the border between a zone and the center.

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 DevTools elevated surface and accent underline.

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]
		dtPaintDockingTab(canvas, ts, colors)
	}

	// Active tab indicator (Blue6 underline, 2px).
	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-dtDockingIndicatorHeight,
			active.Bounds.Width(),
			dtDockingIndicatorHeight,
		)
		canvas.DrawRect(indicatorBounds, colors.ActiveTabBackground)
	}
}

Structs

type DockingPainter struct

DockingPainter renders docking zones and tab bars using DevTools design tokens.

DevTools docking uses a tool window style: compact tab strip at bottom/side,

24px tabs with 12px font, Surface background for panels, SurfaceElevated for

tab bars, and a Blue6 underline (2px) for the selected tab, matching JetBrains

IDE tool window tab styling.

 

If Theme is nil, DockingPainter falls back to the default DevTools dark palette.

type DockingPainter struct {
	Theme *Theme	// nil uses default DevTools dark fallback
}