Add 5px margin around StatusBar and BottomBar to avoid macOS corner clipping
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
+12
-15
@@ -146,25 +146,22 @@ func (r *Renderer) drawBottomBar(gtx layout.Context, bb BottomBar) {
|
||||
}.Push(gtx.Ops)
|
||||
|
||||
// Left: Cursor position
|
||||
{
|
||||
cursorX := reg.X + unit.Dp(8)
|
||||
op.Offset(image.Point{X: int(cursorX), Y: int(reg.Y)}).Push(gtx.Ops).Pop()
|
||||
material.Label(th, r.theme.FontSize, bb.CursorPos).Layout(gtx)
|
||||
}
|
||||
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()
|
||||
|
||||
// Center: Byte position
|
||||
{
|
||||
byteX := reg.X + reg.W/2 - unit.Dp(60) // approximate center
|
||||
op.Offset(image.Point{X: int(byteX), Y: int(reg.Y)}).Push(gtx.Ops).Pop()
|
||||
material.Label(th, r.theme.FontSize, bb.BytePos).Layout(gtx)
|
||||
}
|
||||
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()
|
||||
|
||||
// Right: Word wrap button
|
||||
{
|
||||
wordWrapX := reg.X + reg.W - unit.Dp(120)
|
||||
op.Offset(image.Point{X: int(wordWrapX), Y: int(reg.Y)}).Push(gtx.Ops).Pop()
|
||||
material.Label(th, r.theme.FontSize, "[Word Wrap: "+boolToString(bb.WordWrap)+"]").Layout(gtx)
|
||||
}
|
||||
wordWrapX := reg.X + reg.W - unit.Dp(120)
|
||||
call3 := op.Offset(image.Point{X: int(wordWrapX), Y: int(reg.Y)}).Push(gtx.Ops)
|
||||
material.Label(th, r.theme.FontSize, "[Word Wrap: "+boolToString(bb.WordWrap)+"]").Layout(gtx)
|
||||
call3.Pop()
|
||||
|
||||
c.Pop()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user