Created
April 11, 2024 15:48
-
-
Save haleyrc/3d089b2bc9d880716d71025bd8c31235 to your computer and use it in GitHub Desktop.
A four-pane layout for Amethyst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function layout() { | |
return { | |
name: "Quadrants", | |
getFrameAssignments: (windows, screenFrame) => { | |
const columnWidth = screenFrame.width / 2; | |
const rowHeight = screenFrame.height / 2; | |
const frames = windows.map((window, index) => { | |
const frame = { | |
x: screenFrame.x + (columnWidth * (index % 2)), | |
y: screenFrame.y + (index < 2 ? 0 : rowHeight), | |
width: columnWidth, | |
height: rowHeight | |
}; | |
return { [window.id]: frame }; | |
}); | |
return frames.reduce((frames, frame) => ({ ...frames, ...frame }), {}); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment