Reformat code

This commit is contained in:
世界
2026-01-12 08:17:59 +08:00
parent b937e8d24a
commit 69e7ac9ad2
5 changed files with 13 additions and 14 deletions
@@ -5,10 +5,10 @@ import SwiftUI
public extension View { public extension View {
@ViewBuilder @ViewBuilder
func tabViewBottomAccessoryCompat<Content: View>( func tabViewBottomAccessoryCompat(
isEnabled: Bool = true, isEnabled: Bool = true,
useSystemAccessory: Bool = true, useSystemAccessory: Bool = true,
@ViewBuilder content: @escaping () -> Content @ViewBuilder content: @escaping () -> some View
) -> some View { ) -> some View {
if isEnabled { if isEnabled {
if #available(iOS 26.0, *), useSystemAccessory { if #available(iOS 26.0, *), useSystemAccessory {
@@ -24,7 +24,6 @@ import SwiftUI
self self
} }
} }
} }
private struct TabViewBottomAccessoryContainer<Content: View>: View { private struct TabViewBottomAccessoryContainer<Content: View>: View {
@@ -61,6 +60,5 @@ import SwiftUI
static let horizontalPadding: CGFloat = 20 static let horizontalPadding: CGFloat = 20
static let topPadding: CGFloat = 8 static let topPadding: CGFloat = 8
static let bottomPadding: CGFloat = 12 static let bottomPadding: CGFloat = 12
} }
#endif #endif
+1
View File
@@ -93,6 +93,7 @@ public extension Color {
return bestColor return bestColor
} }
} }
#elseif canImport(AppKit) #elseif canImport(AppKit)
public extension NSColor { public extension NSColor {
var relativeLuminance: CGFloat { var relativeLuminance: CGFloat {
+1 -1
View File
@@ -96,7 +96,7 @@ struct MainView: View {
} }
@ViewBuilder @ViewBuilder
private func tabBarBackgroundIfAvailable<Content: View>(_ content: Content) -> some View { private func tabBarBackgroundIfAvailable(_ content: some View) -> some View {
content content
} }