diff --git a/Sources/ColorWellKit/Views/Cocoa/Style.swift b/Sources/ColorWellKit/Views/Cocoa/CWColorWell.Style.swift similarity index 85% rename from Sources/ColorWellKit/Views/Cocoa/Style.swift rename to Sources/ColorWellKit/Views/Cocoa/CWColorWell.Style.swift index 0a94c29..7610cec 100644 --- a/Sources/ColorWellKit/Views/Cocoa/Style.swift +++ b/Sources/ColorWellKit/Views/Cocoa/CWColorWell.Style.swift @@ -32,13 +32,10 @@ extension CWColorWell { extension CWColorWell.Style: CustomStringConvertible { public var description: String { let prefix = String(describing: Self.self) + "." - switch self { - case .default: - return prefix + "default" - case .minimal: - return prefix + "minimal" - case .expanded: - return prefix + "expanded" + return switch self { + case .default: prefix + "default" + case .minimal: prefix + "minimal" + case .expanded: prefix + "expanded" } } } diff --git a/Sources/ColorWellKit/Views/Cocoa/CWColorWellLayoutView.swift b/Sources/ColorWellKit/Views/Cocoa/CWColorWellLayoutView.swift index 42d2207..7757217 100644 --- a/Sources/ColorWellKit/Views/Cocoa/CWColorWellLayoutView.swift +++ b/Sources/ColorWellKit/Views/Cocoa/CWColorWellLayoutView.swift @@ -13,8 +13,6 @@ private extension LayoutAnchorProtocol { } } -extension NSLayoutAnchor: LayoutAnchorProtocol { } - private struct LayoutAnchorKey: Hashable { private let rawValue: Int @@ -23,6 +21,8 @@ private struct LayoutAnchorKey: Hashable { } } +extension NSLayoutAnchor: LayoutAnchorProtocol { } + /// A grid view that displays color well segments side by side. class CWColorWellLayoutView: NSGridView { diff --git a/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift b/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift index 3ee3c5e..cbf2f85 100644 --- a/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift +++ b/Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift @@ -43,6 +43,7 @@ class CWColorWellPopover: NSPopover, NSPopoverDelegate { } // MARK: - ContentViewController + extension CWColorWellPopover { private class ContentViewController: NSViewController { let contentView: ContentView @@ -61,6 +62,7 @@ extension CWColorWellPopover { } // MARK: - ContentView + extension CWColorWellPopover { private class ContentView: NSView { let layoutView: LayoutView @@ -107,6 +109,7 @@ extension CWColorWellPopover { } // MARK: - LayoutView + extension CWColorWellPopover { private class LayoutView: NSGridView { private weak var colorWell: CWColorWell? @@ -146,6 +149,7 @@ extension CWColorWellPopover { } // MARK: - SwatchLayout + extension CWColorWellPopover { private class SwatchLayout: NSGridView { private let selectionIndicator = SelectionIndicator() @@ -267,6 +271,7 @@ extension CWColorWellPopover { } // MARK: - SelectionIndicator + extension CWColorWellPopover { private class SelectionIndicator: NSView { override init(frame frameRect: NSRect) { @@ -296,6 +301,7 @@ extension CWColorWellPopover { } // MARK: - ColorSwatch + extension CWColorWellPopover { private class ColorSwatch: NSView { private weak var colorWell: CWColorWell?