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:
@@ -25,24 +25,27 @@ func NewState(screenWidth, screenHeight unit.Dp) *State {
|
||||
// EditorLayout computes regions for the editor page.
|
||||
// It takes screen dimensions and returns []Element.
|
||||
func EditorLayout(screenWidth, screenHeight unit.Dp) []ui.Element {
|
||||
// Margin to avoid clipping on macOS round corners
|
||||
margin := unit.Dp(5)
|
||||
|
||||
// Compute StatusBar region
|
||||
// Line 1: filename (24 DP)
|
||||
// Line 2: icons (24 DP)
|
||||
statusBarHeight := unit.Dp(48)
|
||||
statusBarRegion := ui.Region{
|
||||
X: 0,
|
||||
Y: 0,
|
||||
W: screenWidth,
|
||||
X: margin,
|
||||
Y: margin,
|
||||
W: screenWidth - margin*2,
|
||||
H: statusBarHeight,
|
||||
}
|
||||
|
||||
// Compute BottomBar region (fixed height, at bottom of screen)
|
||||
bottomBarHeight := unit.Dp(24)
|
||||
bottomBarY := screenHeight - bottomBarHeight
|
||||
bottomBarY := screenHeight - margin - bottomBarHeight
|
||||
bottomBarRegion := ui.Region{
|
||||
X: 0,
|
||||
X: margin,
|
||||
Y: bottomBarY,
|
||||
W: screenWidth,
|
||||
W: screenWidth - margin*2,
|
||||
H: bottomBarHeight,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user