Docking Painters
The theme-aware painting pipeline for docking chrome — captions, tab strips, splitters, auto-hide strips rendered through IDockingPainter and specialized renderers
Table of Contents
Overview
The docking painting pipeline follows a bridge/adapter pattern to decouple Beep theme tokens from docking-specific rendering:
- IDockingPainter — Top-level interface for the painting contract
- DockingPainterAdapter — Bridges BeepTheme tokens to color values
- DockingRendererSet — Set of specialized renderers for each UI element
- DockingPainterFactory — Creates painters based on style/theme
Painter Interfaces
IDockingPainter
internal interface IDockingPainter
{
void Initialize(IBeepTheme theme);
void PaintDockspace(Graphics g, BeepDockspace dockspace, Rectangle bounds);
void PaintCaption(Graphics g, Rectangle bounds, string title,
bool isActive, DockPanelState state);
void PaintTab(Graphics g, Rectangle bounds, string title,
bool isActive, bool isHovered, bool isDirty, string iconPath);
void PaintSplitter(Graphics g, Rectangle bounds,
SplitOrientation orientation);
void PaintAutoHideStrip(Graphics g, AutoHideStrip strip,
Rectangle bounds);
}IDockingElementRenderer
internal interface IDockingElementRenderer
{
void Render(Graphics g, DockingPainterContext ctx);
}Specialized implementations: CaptionRenderer, SplitterRenderer, AutoHideStripRenderer.
DockingPainterFactory
internal static class DockingPainterFactory
{
public static IDockingPainter Create(
BeepControlStyle style, IBeepTheme theme);
}The factory resolves the style to a concrete implementation. NullDockingPainter is the no-op default.
Specialized Renderers
| Class | Location | Renders |
|---|---|---|
| CaptionRenderer | Painters/Caption/ | Title bar, tab strip, action buttons (close, float, pin, dropdown) |
| SplitterRenderer | Painters/Splitter/ | Resize grips between docked groups |
| AutoHideStripRenderer | Painters/AutoHide/ | Edge strip tabs and hover effects |
DockingPainterAdapter
internal class DockingPainterAdapter : IDockingPainter
{
private IBeepTheme _theme;
private DockingRendererSet _renderers;
// Bridges theme tokens:
// _theme.TabActiveBackColor → caption active background
// _theme.TabInactiveBackColor → caption inactive background
// _theme.TabBorderColor → splitter color
// _theme.PanelBackColor → auto-hide strip background
}
internal class DockingRendererSet
{
public CaptionRenderer Caption { get; }
public SplitterRenderer Splitter { get; }
public AutoHideStripRenderer AutoHide { get; }
}Examples
// Apply theme globally
manager.ApplyTheme(myTheme);
// → DockingPainterFactory.Create(style, theme)
// → Adapter bridges theme tokens to renderers
// → All dockspace surfaces repaint
// Apply explicit colors (bypass theme system)
manager.ApplyTheme(
Color.FromArgb(30, 30, 30), // background
Color.White, // foreground
Color.FromArgb(60, 60, 60), // border
Color.FromArgb(80, 80, 80), // hover
Color.DodgerBlue // accent
);