theme/devtools/dialog.go
Functions
func PaintDialog
func (p DialogPainter) PaintDialog(canvas widget.Canvas, ps dialog.PaintState) {
if ps.Bounds.IsEmpty() {
return
}
colors := ps.ColorScheme
if colors == (dialog.DialogColorScheme{}) {
colors = p.resolveColors()
}
// Surface with border.
canvas.DrawRoundRect(ps.Bounds, colors.Surface, dtDialogRadius)
canvas.StrokeRoundRect(ps.Bounds, colors.Border, dtDialogRadius, dtDialogBorderWidth)
// Title.
if ps.Title != "" {
titleBounds := geometry.Rect{
Min: geometry.Pt(ps.Bounds.Min.X+dtDialogPadding, ps.Bounds.Min.Y+dtDialogPadding),
Max: geometry.Pt(ps.Bounds.Max.X-dtDialogPadding, ps.Bounds.Min.Y+dtDialogPadding+dtDialogTitleHeight),
}
canvas.DrawText(ps.Title, titleBounds, dtDialogTitleFontSize, colors.Title, true, dtDialogTextAlignLeft)
}
// Action buttons.
p.paintActions(canvas, ps, colors)
// Focus indicator.
if ps.Focused {
dtDrawFocusRing(canvas, ps.Bounds, dtDialogRadius, colors.ActionFg)
}
}
Structs
type DialogPainter struct
DialogPainter renders dialogs using DevTools design tokens.
DevTools dialogs use Surface (#2B2D30) background with 8px radius,
subtle shadow, 1px border, and 16px bold title — matching JetBrains
IDE modal dialog styling.
If Theme is nil, DialogPainter falls back to the default DevTools dark palette.
type DialogPainter struct {
Theme *Theme // nil uses default DevTools dark fallback
}
PaintDialog renders a dialog according to DevTools design specifications.