Files
phbar/Sources/phbar/Models/PHTheme/PHThemeWindow.swift
T
2026-07-12 15:06:51 +02:00

34 lines
831 B
Swift

import Foundation
struct PHThemeWindow: Decodable {
let name: String
var hasShadow: Bool? = false
var blur: Double? = 0
/// Window height in points.
var height: Double? = 30
/// Window width: a point value or a percentage of the screen width.
var width: PHThemeWindowDimension? = .percentage(1.0)
/// Semantic placement within the screen.
var anchor: PHThemeWindowAnchor? = .top
/// Insets from the anchored edges.
var margin: PHThemeWindowMargin? = .init()
/// Absolute origin. Overrides `anchor` and `margin` when set.
var origin: PHThemeWindowPoint?
private enum CodingKeys: String, CodingKey {
case name
case hasShadow = "shadow"
case blur
case height, width, anchor, margin, origin
}
static let `default`: Self = {
PHThemeWindow(
name: "_default",
hasShadow: false,
blur: 0.0
)
}()
}