aboutsummaryrefslogtreecommitdiff
path: root/Sources/phbar/Models/Screen.swift
diff options
context:
space:
mode:
authorTommaso Negri <me@tommasongr.com>2026-08-07 23:51:15 +0200
committerTommaso Negri <me@tommasongr.com>2026-08-07 23:51:15 +0200
commit06ad0204f9e6c74f7e3ae06d89323d9bd022d5eb (patch)
tree013590f98900b5daedc6a5bc9ab70906fd1fcea6 /Sources/phbar/Models/Screen.swift
parenta211c90700cc9d21d3c3e5d92205eeb385a54e4a (diff)
downloadbar-06ad0204f9e6c74f7e3ae06d89323d9bd022d5eb.tar.gz
bar-06ad0204f9e6c74f7e3ae06d89323d9bd022d5eb.zip
improve documentation
Diffstat (limited to 'Sources/phbar/Models/Screen.swift')
-rw-r--r--Sources/phbar/Models/Screen.swift16
1 files changed, 15 insertions, 1 deletions
diff --git a/Sources/phbar/Models/Screen.swift b/Sources/phbar/Models/Screen.swift
index e4b968f..870d3b6 100644
--- a/Sources/phbar/Models/Screen.swift
+++ b/Sources/phbar/Models/Screen.swift
@@ -1,8 +1,22 @@
import AppKit
-@MainActor
+/// 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: