diff options
| author | Tommaso Negri <me@tommasongr.com> | 2026-08-09 23:58:42 +0200 |
|---|---|---|
| committer | Tommaso Negri <me@tommasongr.com> | 2026-08-09 23:58:44 +0200 |
| commit | d59b22e557fa5d69ea6be725a7e5bcd829588225 (patch) | |
| tree | 618e20ef2b648e46eac3d51e14b8e0fcc1faba3c /Sources/phbar/Models/Screen.swift | |
| parent | 62ce97dcb63d61c8db739c1b32bd387042ca66a0 (diff) | |
| download | bar-d59b22e557fa5d69ea6be725a7e5bcd829588225.tar.gz bar-d59b22e557fa5d69ea6be725a7e5bcd829588225.zip | |
rename project and add documentation guides
Diffstat (limited to 'Sources/phbar/Models/Screen.swift')
| -rw-r--r-- | Sources/phbar/Models/Screen.swift | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/Sources/phbar/Models/Screen.swift b/Sources/phbar/Models/Screen.swift deleted file mode 100644 index 870d3b6..0000000 --- a/Sources/phbar/Models/Screen.swift +++ /dev/null @@ -1,38 +0,0 @@ -import AppKit - -/// Helpers for multi-screen geometry. -/// -/// Maps a bar configuration (position, height) into concrete -/// screen coordinates so the window can be placed correctly -/// on each display. -enum Screen { - /// Frame of the bar within a screen, in global display coordinates. - /// - /// - Parameters: - /// - screen: The screen to calculate the bar frame for. - /// - position: Whether the bar sits at the top or bottom - /// of the screen. - /// - height: The bar height in points (see ``Config/height``). - /// - /// - Returns: An ``NSRect`` in screen coordinates. The bar spans - /// the full width of the screen and is anchored at the top - /// or bottom edge. - static func barFrame(_ screen: NSScreen, position: Config.Position, height: CGFloat) -> NSRect { - switch position { - case .top: - return NSRect( - x: screen.frame.minX, - y: screen.frame.maxY - height, - width: screen.frame.width, - height: height - ) - case .bottom: - return NSRect( - x: screen.frame.minX, - y: screen.frame.minY, - width: screen.frame.width, - height: height - ) - } - } -} |
