diff --git a/internal/ui/render.go b/internal/ui/render.go index ea3ef14..5c4ba0f 100644 --- a/internal/ui/render.go +++ b/internal/ui/render.go @@ -145,26 +145,22 @@ 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 + + // BottomBar text at reg.Y (top of bar), using drawText for consistent rendering. + // The BottomBar region is at the bottom of the screen with 10DP margin. + bottomY := reg.Y // Left: Cursor position cursorX := reg.X + unit.Dp(8) - call1 := op.Offset(image.Point{X: int(cursorX), Y: int(reg.Y)}).Push(gtx.Ops) - material.Label(th, r.theme.FontSize, bb.CursorPos).Layout(gtx) - call1.Pop() + r.drawText(gtx, r.shp, bb.CursorPos, r.theme.FontSize, cursorX, bottomY, color.NRGBA{R: 0, G: 0, B: 0, A: 255}) // Center: Byte position byteX := reg.X + reg.W/2 - unit.Dp(60) // approximate center - call2 := op.Offset(image.Point{X: int(byteX), Y: int(reg.Y)}).Push(gtx.Ops) - material.Label(th, r.theme.FontSize, bb.BytePos).Layout(gtx) - call2.Pop() + r.drawText(gtx, r.shp, bb.BytePos, r.theme.FontSize, byteX, bottomY, color.NRGBA{R: 0, G: 0, B: 0, A: 255}) // Right: Word wrap button wordWrapX := reg.X + reg.W - unit.Dp(80) - call3 := op.Offset(image.Point{X: int(wordWrapX), Y: int(reg.Y)}).Push(gtx.Ops) - material.Label(th, r.theme.FontSize, "W:"+boolToString(bb.WordWrap)).Layout(gtx) - call3.Pop() + r.drawText(gtx, r.shp, "W:"+boolToString(bb.WordWrap), r.theme.FontSize, wordWrapX, bottomY, color.NRGBA{R: 0, G: 0, B: 0, A: 255}) } func (r *Renderer) drawButton(gtx layout.Context, btn Button) { @@ -323,3 +319,4 @@ func charWidths(gtx layout.Context, shp *text.Shaper, str string, size unit.Sp) } return widths } + diff --git a/pad b/pad index 4eaff5e..6e8bf2e 100755 Binary files a/pad and b/pad differ