diff --git a/doc/shaper_usage.md b/doc/layout_rendering.md similarity index 100% rename from doc/shaper_usage.md rename to doc/layout_rendering.md diff --git a/internal/ui/render.go b/internal/ui/render.go index cbb4815..c4e2c8f 100644 --- a/internal/ui/render.go +++ b/internal/ui/render.go @@ -110,6 +110,18 @@ func (r *Renderer) drawStatusBar(gtx layout.Context, sb StatusBar, _ WindowConst th := material.NewTheme() th.Shaper = r.shp + // Draw light gray background + bgColor := color.NRGBA{R: 230, G: 230, B: 230, A: 255} + m := op.Record(gtx.Ops) + clip.Rect{ + Min: image.Point{X: int(r.toPx(reg.X)), Y: int(r.toPx(reg.Y))}, + Max: image.Point{X: int(r.toPx(reg.X + reg.W)), Y: int(r.toPx(reg.Y + reg.H))}, + }.Op().Push(gtx.Ops) + paint.ColorOp{Color: bgColor}.Add(gtx.Ops) + paint.PaintOp{}.Add(gtx.Ops) + call := m.Stop() + call.Add(gtx.Ops) + // Clip to status bar region (convert Dp to pixels) c := clip.Rect{ Min: image.Point{X: int(r.toPx(reg.X)), Y: int(r.toPx(reg.Y))}, @@ -173,6 +185,18 @@ func (r *Renderer) drawStatusBar(gtx layout.Context, sb StatusBar, _ WindowConst func (r *Renderer) drawBottomBar(gtx layout.Context, bb BottomBar, constraints WindowConstraints) { reg := bb.Region() + // Draw light gray background + bgColor := color.NRGBA{R: 230, G: 230, B: 230, A: 255} + m := op.Record(gtx.Ops) + clip.Rect{ + Min: image.Point{X: int(r.toPx(reg.X)), Y: int(r.toPx(reg.Y))}, + Max: image.Point{X: int(r.toPx(reg.X + reg.W)), Y: int(r.toPx(reg.Y + reg.H))}, + }.Op().Push(gtx.Ops) + paint.ColorOp{Color: bgColor}.Add(gtx.Ops) + paint.PaintOp{}.Add(gtx.Ops) + call := m.Stop() + call.Add(gtx.Ops) + // Use captured constraints for positioning — they are in pixels and // represent the actual window bounds. Never use gtx.Constraints here // because clips modify them.