aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Hotline.xcodeproj/project.pbxproj4
-rw-r--r--Hotline/Application-macOS.swift20
-rw-r--r--Hotline/Assets.xcassets/About Hotline.imageset/Contents.json23
-rw-r--r--Hotline/Assets.xcassets/About Hotline.imageset/Group 3.pngbin0 -> 14188 bytes
-rw-r--r--Hotline/Assets.xcassets/About Hotline.imageset/Group 3@2x.pngbin0 -> 38758 bytes
-rw-r--r--Hotline/Assets.xcassets/About Hotline.imageset/Group 3@3x.pngbin0 -> 71532 bytes
-rw-r--r--Hotline/Assets.xcassets/Hotline Red.colorset/Contents.json (renamed from Hotline/Assets.xcassets/Unread Message Dot.colorset/Contents.json)4
-rw-r--r--Hotline/macOS/AboutView.swift42
8 files changed, 91 insertions, 2 deletions
diff --git a/Hotline.xcodeproj/project.pbxproj b/Hotline.xcodeproj/project.pbxproj
index d6ea58a..ab013d5 100644
--- a/Hotline.xcodeproj/project.pbxproj
+++ b/Hotline.xcodeproj/project.pbxproj
@@ -25,6 +25,7 @@
DA4F2C012B1A558E00D8ADDC /* ChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA4F2C002B1A558E00D8ADDC /* ChatView.swift */; platformFilter = ios; };
DA55AC732BE42AF000034857 /* AsyncLinkPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA55AC722BE42AF000034857 /* AsyncLinkPreview.swift */; platformFilters = (macos, ); };
DA55AC752BE4888300034857 /* InstantMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA55AC742BE4888300034857 /* InstantMessage.swift */; };
+ DA55AC772BE589F700034857 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA55AC762BE589F700034857 /* AboutView.swift */; platformFilters = (macos, ); };
DA5753682B33E88A00FAC277 /* HotlineFileClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA5753672B33E88A00FAC277 /* HotlineFileClient.swift */; };
DA57536C2B36BA1D00FAC277 /* TextDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA57536B2B36BA1D00FAC277 /* TextDocument.swift */; };
DA6300972B24036B0034CBFD /* HotlineClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA6300962B24036B0034CBFD /* HotlineClient.swift */; };
@@ -98,6 +99,7 @@
DA4F2C002B1A558E00D8ADDC /* ChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatView.swift; sourceTree = "<group>"; };
DA55AC722BE42AF000034857 /* AsyncLinkPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncLinkPreview.swift; sourceTree = "<group>"; };
DA55AC742BE4888300034857 /* InstantMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstantMessage.swift; sourceTree = "<group>"; };
+ DA55AC762BE589F700034857 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = "<group>"; };
DA5753672B33E88A00FAC277 /* HotlineFileClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HotlineFileClient.swift; sourceTree = "<group>"; };
DA57536B2B36BA1D00FAC277 /* TextDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextDocument.swift; sourceTree = "<group>"; };
DA6300962B24036B0034CBFD /* HotlineClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HotlineClient.swift; sourceTree = "<group>"; };
@@ -321,6 +323,7 @@
DA72A0DC2B4CD0BF00A0F48A /* NewsEditorView.swift */,
DA2863D72B37AD1C00A7D050 /* SettingsView.swift */,
DAE136B92B9D1147007D8307 /* HotlinePanelView.swift */,
+ DA55AC762BE589F700034857 /* AboutView.swift */,
);
path = macOS;
sourceTree = "<group>";
@@ -427,6 +430,7 @@
DADDB28F2B238D850024040D /* Hotline.swift in Sources */,
DADDB28D2B22B5920024040D /* Server.swift in Sources */,
DABE8C042B57940B00884D28 /* DAKeychain.swift in Sources */,
+ DA55AC772BE589F700034857 /* AboutView.swift in Sources */,
DA72A0E22B4DAA4000A0F48A /* NewsArticle.swift in Sources */,
DAE734FB2B2E41F9000C56F6 /* TrackerView.swift in Sources */,
DAE136BA2B9D1147007D8307 /* HotlinePanelView.swift in Sources */,
diff --git a/Hotline/Application-macOS.swift b/Hotline/Application-macOS.swift
index ec42a89..eb5be32 100644
--- a/Hotline/Application-macOS.swift
+++ b/Hotline/Application-macOS.swift
@@ -60,6 +60,25 @@ struct Application: App {
}
}
+ Window("About", id: "about") {
+ AboutView()
+ .ignoresSafeArea()
+ .background(Color.hotlineRed)
+ }
+ .windowResizability(.contentSize)
+ .windowStyle(.hiddenTitleBar)
+ .defaultSize(width: 300, height: 400)
+ .defaultPosition(.center)
+ .commands {
+ CommandGroup(replacing: CommandGroupPlacement.appInfo) {
+ Button(action: {
+ openWindow(id: "about")
+ }) {
+ Text("About Hotline")
+ }
+ }
+ }
+
// MARK: Server Window
WindowGroup(id: "server", for: Server.self) { server in
ServerView(server: server)
@@ -165,6 +184,7 @@ struct Application: App {
SettingsView()
}
+
// MARK: News Editor Window
// WindowGroup(id: "news-editor", for: NewsArticle.self) { $article in
// NewsEditorView(article: $article)
diff --git a/Hotline/Assets.xcassets/About Hotline.imageset/Contents.json b/Hotline/Assets.xcassets/About Hotline.imageset/Contents.json
new file mode 100644
index 0000000..84fb02e
--- /dev/null
+++ b/Hotline/Assets.xcassets/About Hotline.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "filename" : "Group 3.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "filename" : "Group 3@2x.png",
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "filename" : "Group 3@3x.png",
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/Hotline/Assets.xcassets/About Hotline.imageset/Group 3.png b/Hotline/Assets.xcassets/About Hotline.imageset/Group 3.png
new file mode 100644
index 0000000..84f7790
--- /dev/null
+++ b/Hotline/Assets.xcassets/About Hotline.imageset/Group 3.png
Binary files differ
diff --git a/Hotline/Assets.xcassets/About Hotline.imageset/Group 3@2x.png b/Hotline/Assets.xcassets/About Hotline.imageset/Group 3@2x.png
new file mode 100644
index 0000000..e0961c2
--- /dev/null
+++ b/Hotline/Assets.xcassets/About Hotline.imageset/Group 3@2x.png
Binary files differ
diff --git a/Hotline/Assets.xcassets/About Hotline.imageset/Group 3@3x.png b/Hotline/Assets.xcassets/About Hotline.imageset/Group 3@3x.png
new file mode 100644
index 0000000..a3ef5d0
--- /dev/null
+++ b/Hotline/Assets.xcassets/About Hotline.imageset/Group 3@3x.png
Binary files differ
diff --git a/Hotline/Assets.xcassets/Unread Message Dot.colorset/Contents.json b/Hotline/Assets.xcassets/Hotline Red.colorset/Contents.json
index 05fcb96..1f6e488 100644
--- a/Hotline/Assets.xcassets/Unread Message Dot.colorset/Contents.json
+++ b/Hotline/Assets.xcassets/Hotline Red.colorset/Contents.json
@@ -7,7 +7,7 @@
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
- "red" : "0xF1"
+ "red" : "0xE1"
}
},
"idiom" : "universal"
@@ -25,7 +25,7 @@
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
- "red" : "0xF1"
+ "red" : "0xE1"
}
},
"idiom" : "universal"
diff --git a/Hotline/macOS/AboutView.swift b/Hotline/macOS/AboutView.swift
new file mode 100644
index 0000000..378385a
--- /dev/null
+++ b/Hotline/macOS/AboutView.swift
@@ -0,0 +1,42 @@
+import SwiftUI
+
+struct AboutView: View {
+ @Environment(\.openURL) private var openURL
+
+ var body: some View {
+ VStack(alignment: .center) {
+ Spacer()
+ Image("About Hotline")
+ .padding(.top, 32)
+ Text("Hotline")
+ .font(.title)
+ .fontWeight(.semibold)
+ .padding(.top, 16)
+ let appDetails = getAppVersionAndBuild()
+ Text("\(appDetails.version)b\(appDetails.build)")
+ .fontWeight(.semibold)
+ .opacity(0.6)
+ Button("Download Latest") {
+ if let url = URL(string: "https://github.com/mierau/hotline/releases/latest") {
+ openURL(url)
+ }
+ }
+ .controlSize(.large)
+ .padding(.top, 16)
+ Spacer()
+ }
+ .frame(width: 300, height: 400)
+ .ignoresSafeArea()
+ }
+
+ func getAppVersionAndBuild() -> (version: String, build: String) {
+ let infoDictionary = Bundle.main.infoDictionary
+ let version = infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
+ let build = infoDictionary?["CFBundleVersion"] as? String ?? "Unknown"
+ return (version, build)
+ }
+}
+
+#Preview {
+ AboutView()
+}