diff --git a/internal/ui/render.go b/internal/ui/render.go index 898ff63..f5cc2cc 100644 --- a/internal/ui/render.go +++ b/internal/ui/render.go @@ -133,17 +133,32 @@ func (r *Renderer) drawStatusBar(gtx layout.Context, sb StatusBar) { } func (r *Renderer) drawBottomBar(gtx layout.Context, bb BottomBar) { + reg := bb.Region() th := material.NewTheme() th.Shaper = r.shp + // Clip to bottom bar region + c := clip.Rect{ + Min: image.Point{X: int(reg.X), Y: int(reg.Y)}, + Max: image.Point{X: int(reg.X + reg.W), Y: int(reg.Y + reg.H)}, + }.Push(gtx.Ops) + // Left: Cursor position + cursorX := reg.X + unit.Dp(8) + gtx.Constraints.Min.X = int(cursorX) material.Label(th, r.theme.FontSize, bb.CursorPos).Layout(gtx) // Center: Byte position + byteX := reg.X + reg.W/2 - unit.Dp(60) // approximate center + gtx.Constraints.Min.X = int(byteX) material.Label(th, r.theme.FontSize, bb.BytePos).Layout(gtx) // Right: Word wrap button + wordWrapX := reg.X + reg.W - unit.Dp(120) + gtx.Constraints.Min.X = int(wordWrapX) material.Label(th, r.theme.FontSize, "[Word Wrap: "+boolToString(bb.WordWrap)+"]").Layout(gtx) + + c.Pop() } func (r *Renderer) drawButton(gtx layout.Context, btn Button) { diff --git a/pad b/pad index 065f543..b142832 100755 Binary files a/pad and b/pad differ