package ui import "gioui.org/unit" const ( // Standard dimensions in Dp statusBarLineHeight = unit.Dp(24) statusBarFilenameLine = unit.Dp(24) statusBarIconsLine = unit.Dp(24) bottomBarHeight = unit.Dp(24) iconSize = unit.Dp(24) iconGap = unit.Dp(36) padding = unit.Dp(8) buttonPadding = unit.Dp(8) ) // EditorLayout computes regions for the editor page. // It takes screen dimensions and returns []Element. func EditorLayout(screenWidth, screenHeight unit.Dp) []Element { // Compute StatusBar region // Line 1: filename (24 DP) // Line 2: icons (24 DP) statusBarHeight := statusBarFilenameLine + statusBarIconsLine statusBarRegion := Region{ X: 0, Y: 0, W: screenWidth, H: statusBarHeight, } // Compute BottomBar region (fixed height, at bottom of screen) bottomBarY := screenHeight - bottomBarHeight bottomBarRegion := Region{ X: 0, Y: bottomBarY, W: screenWidth, H: bottomBarHeight, } // Create StatusBar with mocked filename statusBar := NewStatusBar( statusBarRegion, "very_long_filename_that_does_not_fit_on_a_single_line.txt", false, // FilenameExp true, // CutCopy false, // Copy true, // Paste false, // ConflictIcon true, // Search ) // Create BottomBar with mocked data bottomBar := NewBottomBar( bottomBarRegion, "Ln 47, Col 12", "1024 / 50000", true, // WordWrap ) return []Element{statusBar, bottomBar} }