From 6ca09f901fd0d546eb9bea297a042bcd5842b901 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 14 Jun 2025 15:24:10 -0700 Subject: [PATCH 1/4] Add packages as explicit dependency. --- Sources/Secretive.xcodeproj/project.pbxproj | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Sources/Secretive.xcodeproj/project.pbxproj b/Sources/Secretive.xcodeproj/project.pbxproj index 1edd651..a96d508 100644 --- a/Sources/Secretive.xcodeproj/project.pbxproj +++ b/Sources/Secretive.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -438,6 +438,9 @@ ca, ); mainGroup = 50617D7623FCE48D0099B055; + packageReferences = ( + 5068431C2DFE2DE000920856 /* XCLocalSwiftPackageReference "Packages" */, + ); productRefGroup = 50617D8023FCE48E0099B055 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -1010,6 +1013,13 @@ }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 5068431C2DFE2DE000920856 /* XCLocalSwiftPackageReference "Packages" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Packages; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ 5003EF3A278005E800DF2006 /* SecretKit */ = { isa = XCSwiftPackageProductDependency; From d68c5a162c3abdbadbf5a5862add6762f9116769 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 14 Jun 2025 15:24:59 -0700 Subject: [PATCH 2/4] Fix shadowed type --- Sources/Secretive/Views/CreateSecretView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Secretive/Views/CreateSecretView.swift b/Sources/Secretive/Views/CreateSecretView.swift index accd8be..7fc641b 100644 --- a/Sources/Secretive/Views/CreateSecretView.swift +++ b/Sources/Secretive/Views/CreateSecretView.swift @@ -93,14 +93,14 @@ struct ThumbnailPickerView: View { extension ThumbnailPickerView { - struct Item: Identifiable { + struct Item: Identifiable { let id = UUID() - let value: ValueType + let value: InnerValueType let name: LocalizedStringKey let description: LocalizedStringKey let thumbnail: AnyView - init(value: ValueType, name: LocalizedStringKey, description: LocalizedStringKey, thumbnail: ViewType) { + init(value: InnerValueType, name: LocalizedStringKey, description: LocalizedStringKey, thumbnail: ViewType) { self.value = value self.name = name self.description = description From 697fdfafe49784e2c732a937f8fc9d6f07817de9 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 14 Jun 2025 16:42:12 -0700 Subject: [PATCH 3/4] Toolbar tweaks --- Sources/Secretive.xcodeproj/project.pbxproj | 12 ++--- Sources/Secretive/Views/ContentView.swift | 21 +++++--- .../Secretive/Views/ToolbarButtonStyle.swift | 50 +++++++++++++------ 3 files changed, 56 insertions(+), 27 deletions(-) diff --git a/Sources/Secretive.xcodeproj/project.pbxproj b/Sources/Secretive.xcodeproj/project.pbxproj index a96d508..ee2659a 100644 --- a/Sources/Secretive.xcodeproj/project.pbxproj +++ b/Sources/Secretive.xcodeproj/project.pbxproj @@ -705,7 +705,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1; PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.Secretive.Host; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -733,7 +733,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1; PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.Secretive.Host; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -866,7 +866,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1; PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.Secretive.Host; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -910,7 +910,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1; PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.Secretive.SecretAgent; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -934,7 +934,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1; PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.Secretive.SecretAgent; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -959,7 +959,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 12.0; + MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1; PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.Secretive.SecretAgent; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Sources/Secretive/Views/ContentView.swift b/Sources/Secretive/Views/ContentView.swift index c48991c..b7f2f76 100644 --- a/Sources/Secretive/Views/ContentView.swift +++ b/Sources/Secretive/Views/ContentView.swift @@ -30,10 +30,12 @@ struct ContentView ToolbarItem { - ToolbarItem(id: id) { view } + @ToolbarContentBuilder + func toolbarItem(_ view: some View, id: String) -> some ToolbarContent { + if #available(macOS 26.0, *) { + ToolbarItem(id: id) { view } + .sharedBackgroundVisibility(.hidden) + } else { + ToolbarItem(id: id) { view } + } } var needsSetup: Bool { diff --git a/Sources/Secretive/Views/ToolbarButtonStyle.swift b/Sources/Secretive/Views/ToolbarButtonStyle.swift index a80cde4..045a24b 100644 --- a/Sources/Secretive/Views/ToolbarButtonStyle.swift +++ b/Sources/Secretive/Views/ToolbarButtonStyle.swift @@ -16,22 +16,44 @@ struct ToolbarButtonStyle: ButtonStyle { self.lightColor = lightColor self.darkColor = darkColor } + + private var backingColor: Color { + if !hovering { + colorScheme == .light ? lightColor : darkColor + } else { + colorScheme == .light ? .black.opacity(0.1) : .white.opacity(0.05) + } + } + @Namespace var namespace func makeBody(configuration: Configuration) -> some View { - configuration.label - .padding(EdgeInsets(top: 6, leading: 8, bottom: 6, trailing: 8)) - .background(colorScheme == .light ? lightColor : darkColor) - .foregroundColor(.white) - .clipShape(RoundedRectangle(cornerRadius: 5)) - .overlay( - RoundedRectangle(cornerRadius: 5) - .stroke(colorScheme == .light ? .black.opacity(0.15) : .white.opacity(0.15), lineWidth: 1) - .background(hovering ? (colorScheme == .light ? .black.opacity(0.1) : .white.opacity(0.05)) : Color.clear) - ) - .onHover { hovering in - withAnimation { - self.hovering = hovering + if #available(macOS 26.0, *) { + configuration + .label + .foregroundColor(.white) + .padding(EdgeInsets(top: 6, leading: 8, bottom: 6, trailing: 8)) + .glassEffect(.regular.tint(backingColor), in: .capsule, isEnabled: true) + .onHover { hovering in + withAnimation { + self.hovering = hovering + } } - } + } else { + configuration + .label + .background(colorScheme == .light ? lightColor : darkColor) + .foregroundColor(.white) + .clipShape(RoundedRectangle(cornerRadius: 5)) + .overlay( + RoundedRectangle(cornerRadius: 5) + .stroke(colorScheme == .light ? .black.opacity(0.15) : .white.opacity(0.15), lineWidth: 1) + .background(hovering ? (colorScheme == .light ? .black.opacity(0.1) : .white.opacity(0.05)) : Color.clear) + ) + .onHover { hovering in + withAnimation { + self.hovering = hovering + } + } + } } } From 9ae0ca781b91cfa34c8c4bfa27ff6e03fed84a49 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 14 Jun 2025 16:50:00 -0700 Subject: [PATCH 4/4] Tweak hover --- Sources/Secretive/Views/ToolbarButtonStyle.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Sources/Secretive/Views/ToolbarButtonStyle.swift b/Sources/Secretive/Views/ToolbarButtonStyle.swift index 045a24b..c361601 100644 --- a/Sources/Secretive/Views/ToolbarButtonStyle.swift +++ b/Sources/Secretive/Views/ToolbarButtonStyle.swift @@ -16,15 +16,15 @@ struct ToolbarButtonStyle: ButtonStyle { self.lightColor = lightColor self.darkColor = darkColor } - - private var backingColor: Color { + + @available(macOS 26.0, *) + private var glassTint: Color { if !hovering { colorScheme == .light ? lightColor : darkColor } else { - colorScheme == .light ? .black.opacity(0.1) : .white.opacity(0.05) + colorScheme == .light ? lightColor.exposureAdjust(1) : darkColor.exposureAdjust(1) } } - @Namespace var namespace func makeBody(configuration: Configuration) -> some View { if #available(macOS 26.0, *) { @@ -32,11 +32,9 @@ struct ToolbarButtonStyle: ButtonStyle { .label .foregroundColor(.white) .padding(EdgeInsets(top: 6, leading: 8, bottom: 6, trailing: 8)) - .glassEffect(.regular.tint(backingColor), in: .capsule, isEnabled: true) + .glassEffect(.regular.tint(glassTint), in: .capsule, isEnabled: true) .onHover { hovering in - withAnimation { - self.hovering = hovering - } + self.hovering = hovering } } else { configuration