diff --git a/DefaultBrowser.xcodeproj/project.pbxproj b/DefaultBrowser.xcodeproj/project.pbxproj index 63fe264..e0dba8a 100644 --- a/DefaultBrowser.xcodeproj/project.pbxproj +++ b/DefaultBrowser.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ C5A333771BDAF6EA000767B2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5A333761BDAF6EA000767B2 /* AppDelegate.swift */; }; C5A333791BDAF6EA000767B2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C5A333781BDAF6EA000767B2 /* Assets.xcassets */; }; C5A3337C1BDAF6EA000767B2 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5A3337A1BDAF6EA000767B2 /* MainMenu.xib */; }; + C5AF631129327A380087D317 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5AF631029327A380087D317 /* AboutView.swift */; }; C5E39DC21BE83B48004E722B /* Defaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5E39DC11BE83B48004E722B /* Defaults.swift */; }; /* End PBXBuildFile section */ @@ -23,6 +24,7 @@ C5A3337D1BDAF6EA000767B2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C5AEAF5D29292C0A00F57C2F /* test.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = test.html; sourceTree = ""; }; C5AEAF5E29292C2900F57C2F /* .github */ = {isa = PBXFileReference; lastKnownFileType = folder; path = .github; sourceTree = ""; }; + C5AF631029327A380087D317 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = ""; }; C5C938A0249BF1AD0008EF81 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; C5E39DC11BE83B48004E722B /* Defaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Defaults.swift; sourceTree = ""; }; C5E39DC31BE893EA004E722B /* Default Browser.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Default Browser.entitlements"; sourceTree = ""; }; @@ -63,6 +65,7 @@ isa = PBXGroup; children = ( C5A333761BDAF6EA000767B2 /* AppDelegate.swift */, + C5AF631029327A380087D317 /* AboutView.swift */, C58951F31BEAD8BA0093EE2E /* SystemUtilities.swift */, C5E39DC11BE83B48004E722B /* Defaults.swift */, C5A333781BDAF6EA000767B2 /* Assets.xcassets */, @@ -189,6 +192,7 @@ buildActionMask = 2147483647; files = ( C58951F41BEAD8BA0093EE2E /* SystemUtilities.swift in Sources */, + C5AF631129327A380087D317 /* AboutView.swift in Sources */, C5E39DC21BE83B48004E722B /* Defaults.swift in Sources */, C5A333771BDAF6EA000767B2 /* AppDelegate.swift in Sources */, ); diff --git a/DefaultBrowser/AboutView.swift b/DefaultBrowser/AboutView.swift new file mode 100644 index 0000000..103f325 --- /dev/null +++ b/DefaultBrowser/AboutView.swift @@ -0,0 +1,50 @@ +// +// About.swift +// Default Browser +// +// Created by Cameron Little on 2022-11-26. +// Copyright © 2022 Cameron Little. All rights reserved. +// + +import SwiftUI + +let shortVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "" +let buildNumber = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "" + +@available(macOS 10.15, *) +extension Text { + func withSmallFontStyle() -> some View { + self + .font(.system(size: NSFont.smallSystemFontSize)) + .multilineTextAlignment(.center) + } +} + +@available(macOS 10.15, *) +struct AboutView: View { + var body: some View { + VStack(spacing: 20) { + Image("AppIcon") + .resizable() + .scaledToFill() + .frame(width: 32, height: 100) + Text("DefaultBrowser will automatically open links using the last browser you've used. You can disable this temporarily by clicking the menu icon and choosing a browser.") + VStack(spacing: 8) { + Text("Version \(shortVersion) (\(buildNumber))") + Text("Built by [Cameron Little](https://camlittle.com)") + Text("[GitHub project](https://github.com/apexskier/DefaultBrowser)") + } + .font(.system(size: NSFont.smallSystemFontSize)) + .multilineTextAlignment(.center) + } + .frame(maxWidth: 340) + .padding(.all) + } +} + +@available(macOS 10.15.0, *) +struct AboutView_Previews: PreviewProvider { + static var previews: some View { + AboutView() + } +} diff --git a/DefaultBrowser/Base.lproj/MainMenu.xib b/DefaultBrowser/Base.lproj/MainMenu.xib index 793346b..9765950 100644 --- a/DefaultBrowser/Base.lproj/MainMenu.xib +++ b/DefaultBrowser/Base.lproj/MainMenu.xib @@ -759,7 +759,7 @@ - + diff --git a/DefaultBrowser/Info.plist b/DefaultBrowser/Info.plist index 0295fb6..e8c535e 100644 --- a/DefaultBrowser/Info.plist +++ b/DefaultBrowser/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 130 + 153 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion