diff --git a/Sources/gitdiff/Core/PlatformColors.swift b/Sources/gitdiff/Core/PlatformColors.swift deleted file mode 100644 index 94e05ef..0000000 --- a/Sources/gitdiff/Core/PlatformColors.swift +++ /dev/null @@ -1,31 +0,0 @@ -import SwiftUI - -#if os(iOS) || os(tvOS) || os(watchOS) - import UIKit -#endif -#if os(macOS) - import AppKit -#endif - -/// Cross-platform system background color wrapper -enum PlatformColors { - static var background: Color { - #if os(iOS) || os(tvOS) || os(watchOS) - return Color(UIColor.systemBackground) - #elseif os(macOS) - if #available(macOS 10.15, *) { - // There is no NSColor.systemBackground; windowBackgroundColor is closest for content areas - return Color(NSColor.windowBackgroundColor) - } else { - return Color.white - } - #else - return Color.white - #endif - } -} - -extension Color { - /// A cross-platform background color similar to system background. - public static var appBackground: Color { PlatformColors.background } -} diff --git a/Sources/gitdiff/Views/DiffFileView.swift b/Sources/gitdiff/Views/DiffFileView.swift index 3032f7a..bf393bf 100644 --- a/Sources/gitdiff/Views/DiffFileView.swift +++ b/Sources/gitdiff/Views/DiffFileView.swift @@ -110,5 +110,4 @@ struct DiffFileView: View { DiffFileView(file: sampleFile) .padding() - .background(Color.appBackground) } diff --git a/Sources/gitdiff/Views/DiffLineView.swift b/Sources/gitdiff/Views/DiffLineView.swift index 923f8cf..2fc5b3b 100644 --- a/Sources/gitdiff/Views/DiffLineView.swift +++ b/Sources/gitdiff/Views/DiffLineView.swift @@ -142,5 +142,4 @@ struct DiffLineView: View { ) ) } - .background(Color.appBackground) } diff --git a/Sources/gitdiff/Views/DiffRenderer.swift b/Sources/gitdiff/Views/DiffRenderer.swift index 1b12ac6..f23be03 100644 --- a/Sources/gitdiff/Views/DiffRenderer.swift +++ b/Sources/gitdiff/Views/DiffRenderer.swift @@ -40,7 +40,6 @@ public struct DiffRenderer: View { .font(.caption) .foregroundColor(.secondary) } - .padding() .frame(maxWidth: .infinity, maxHeight: .infinity) } else if let files = parsedFiles, files.isEmpty { VStack(spacing: 20) { @@ -58,7 +57,6 @@ public struct DiffRenderer: View { .multilineTextAlignment(.center) .padding(.horizontal) } - .padding() .frame(maxWidth: .infinity, maxHeight: .infinity) } else if let files = parsedFiles { VStack(spacing: 16) { @@ -66,10 +64,8 @@ public struct DiffRenderer: View { DiffFileView(file: file) } } - .padding() } } - .background(Color.appBackground) .task(id: diffText) { self.parsedFiles = try? await DiffParser.parse(diffText) }