Skip to content

Commit

Permalink
More style changes and better organization
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed Jan 7, 2024
1 parent 42fd8c4 commit 4eb3156
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
4 changes: 2 additions & 2 deletions Sources/ColorWellKit/Views/Cocoa/CWColorWellLayoutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ private extension LayoutAnchorProtocol {
}
}

extension NSLayoutAnchor: LayoutAnchorProtocol { }

private struct LayoutAnchorKey: Hashable {
private let rawValue: Int

Expand All @@ -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 {

Expand Down
6 changes: 6 additions & 0 deletions Sources/ColorWellKit/Views/Cocoa/CWColorWellPopover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class CWColorWellPopover: NSPopover, NSPopoverDelegate {
}

// MARK: - ContentViewController

extension CWColorWellPopover {
private class ContentViewController: NSViewController {
let contentView: ContentView
Expand All @@ -61,6 +62,7 @@ extension CWColorWellPopover {
}

// MARK: - ContentView

extension CWColorWellPopover {
private class ContentView: NSView {
let layoutView: LayoutView
Expand Down Expand Up @@ -107,6 +109,7 @@ extension CWColorWellPopover {
}

// MARK: - LayoutView

extension CWColorWellPopover {
private class LayoutView: NSGridView {
private weak var colorWell: CWColorWell?
Expand Down Expand Up @@ -146,6 +149,7 @@ extension CWColorWellPopover {
}

// MARK: - SwatchLayout

extension CWColorWellPopover {
private class SwatchLayout: NSGridView {
private let selectionIndicator = SelectionIndicator()
Expand Down Expand Up @@ -267,6 +271,7 @@ extension CWColorWellPopover {
}

// MARK: - SelectionIndicator

extension CWColorWellPopover {
private class SelectionIndicator: NSView {
override init(frame frameRect: NSRect) {
Expand Down Expand Up @@ -296,6 +301,7 @@ extension CWColorWellPopover {
}

// MARK: - ColorSwatch

extension CWColorWellPopover {
private class ColorSwatch: NSView {
private weak var colorWell: CWColorWell?
Expand Down

0 comments on commit 4eb3156

Please sign in to comment.