diff --git a/Applite.xcodeproj/project.pbxproj b/Applite.xcodeproj/project.pbxproj index d130a0a..4a29c0a 100644 --- a/Applite.xcodeproj/project.pbxproj +++ b/Applite.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ 413E60C22BBFF98A00978F6A /* AppIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 413E60C12BBFF98A00978F6A /* AppIconView.swift */; }; 413F77A52972B2E70053349A /* DependencyManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 413F77A42972B2E70053349A /* DependencyManager.swift */; }; 413F87242D32D2B100D4BE10 /* IfritStatic in Frameworks */ = {isa = PBXBuildFile; productRef = 413F87232D32D2B100D4BE10 /* IfritStatic */; }; + 413F87262D33048800D4BE10 /* InfoPopup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 413F87252D33048800D4BE10 /* InfoPopup.swift */; }; 414074F528DF53E80073EB22 /* AppliteApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 414074F428DF53E80073EB22 /* AppliteApp.swift */; }; 414074F728DF53E80073EB22 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 414074F628DF53E80073EB22 /* ContentView.swift */; }; 414074F928DF53EB0073EB22 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 414074F828DF53EB0073EB22 /* Assets.xcassets */; }; @@ -158,6 +159,7 @@ 413E60B62BBAE5E000978F6A /* NetworkProxyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProxyManager.swift; sourceTree = ""; }; 413E60C12BBFF98A00978F6A /* AppIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIconView.swift; sourceTree = ""; }; 413F77A42972B2E70053349A /* DependencyManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DependencyManager.swift; sourceTree = ""; }; + 413F87252D33048800D4BE10 /* InfoPopup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoPopup.swift; sourceTree = ""; }; 414074F128DF53E80073EB22 /* Applite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Applite.app; sourceTree = BUILT_PRODUCTS_DIR; }; 414074F428DF53E80073EB22 /* AppliteApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppliteApp.swift; sourceTree = ""; }; 414074F628DF53E80073EB22 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -327,6 +329,7 @@ 418989AE2A33B65A004AC23B /* SmallProgressView.swift */, 419256902D23F93E00D9EF10 /* Card.swift */, 4120AB662A755B0700F68EFE /* Sparkle Updater */, + 413F87252D33048800D4BE10 /* InfoPopup.swift */, ); path = Components; sourceTree = ""; @@ -794,6 +797,7 @@ 415563A42A98C54300AE2F2E /* AppdirSelectorView.swift in Sources */, 4140750528DF5FA60073EB22 /* AppView.swift in Sources */, 415135642D32C4360025DB70 /* Cask+Identifiable.swift in Sources */, + 413F87262D33048800D4BE10 /* InfoPopup.swift in Sources */, 418F332428EC8BA10023D76F /* Cask.swift in Sources */, 4126353E2A77C6EF00155034 /* ArrayExtension.swift in Sources */, 4192564B2D1E0B9B00D9EF10 /* DownloadView+NoSearchResults.swift in Sources */, diff --git a/Applite/Views/Components/AppdirSelectorView.swift b/Applite/Views/Components/AppdirSelectorView.swift index 4652b9d..5633ad6 100644 --- a/Applite/Views/Components/AppdirSelectorView.swift +++ b/Applite/Views/Components/AppdirSelectorView.swift @@ -15,8 +15,12 @@ struct AppdirSelectorView: View { var body: some View { VStack(alignment: .leading) { - Toggle("Use Custom Installation Directory", isOn: $appdirOn) - + HStack { + Toggle("Use Custom Installation Directory", isOn: $appdirOn) + + InfoPopup(text: "Download apps to a custom directory instead of `/Applications`") + } + HStack { TextField("Custom Installation Directory", text: $appdirPath, prompt: Text("/path/to/dir")) .autocorrectionDisabled() diff --git a/Applite/Views/Components/InfoPopup.swift b/Applite/Views/Components/InfoPopup.swift new file mode 100644 index 0000000..63eed54 --- /dev/null +++ b/Applite/Views/Components/InfoPopup.swift @@ -0,0 +1,34 @@ +// +// InfoPopup.swift +// Applite +// +// Created by Milán Várady on 2025.01.11. +// + +import SwiftUI + +struct InfoPopup: View { + let text: LocalizedStringKey + + @State var showPopover: Bool = false + + var body: some View { + Button { + showPopover = true + } label: { + Image(systemName: "info.circle") + } + .buttonStyle(.plain) + .popover(isPresented: $showPopover) { + Text(text) + .textSelection(.enabled) + .frame(maxWidth: 400) + .fixedSize(horizontal: true, vertical: true) + .padding(16) + } + } +} + +#Preview { + InfoPopup(text: "") +} diff --git a/Applite/Views/Settings/SettingsView+BrewSettingsView.swift b/Applite/Views/Settings/SettingsView+BrewSettingsView.swift index 6f1bdba..003218e 100644 --- a/Applite/Views/Settings/SettingsView+BrewSettingsView.swift +++ b/Applite/Views/Settings/SettingsView+BrewSettingsView.swift @@ -92,8 +92,12 @@ extension SettingsView { Text("Other Flags", comment: "Brew settings command line flags section title") .bold() - Toggle(isOn: $noQuarantine) { - Text("No Quarantine", comment: "Brew no quarantine flag toggle title") + HStack { + Toggle(isOn: $noQuarantine) { + Text("No Quarantine", comment: "Brew no quarantine flag toggle title") + } + + InfoPopup(text: "Bypasses the Apple Gatekeeper check, which can be useful if the app is from an unregistered developer. **Use it at your own risk!**") } } } diff --git a/Localizable.xcstrings b/Localizable.xcstrings index 7b144de..261a06a 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -1447,6 +1447,9 @@ } } } + }, + "Bypasses the Apple Gatekeeper check, which can be useful if the app is from an unregistered developer. **Use it at your own risk!**" : { + }, "Cancel" : { "comment" : "Alert cancel button", @@ -2121,6 +2124,9 @@ } } } + }, + "Download apps to a custom directory instead of `/Applications`" : { + }, "Download apps with ease" : { "comment" : "Onboarding",