Skip to content

Commit

Permalink
fix: Add an about screen (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmorley authored Feb 20, 2024
1 parent cbf3bad commit 3142f63
Show file tree
Hide file tree
Showing 73 changed files with 683 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Dependencies/diligence
Submodule diligence updated 60 files
+3 −2 .github/workflows/build.yaml
+2 −0 .gitignore
+1 −1 LICENSE
+2 −2 README.md
+1 −1 Sources/Diligence/Builders/AcknowledgementsBuilder.swift
+1 −1 Sources/Diligence/Builders/ActionsBuilder.swift
+1 −1 Sources/Diligence/Builders/CreditsBuilder.swift
+1 −1 Sources/Diligence/Builders/LicenseGroupsBuilder.swift
+1 −1 Sources/Diligence/Builders/LicensesBuilder.swift
+1 −1 Sources/Diligence/Commands/AboutCommands.swift
+1 −1 Sources/Diligence/Environment/PrefersTextualRepresentationEnvironmentKey.swift
+31 −0 Sources/Diligence/Extensions/Array.swift
+1 −1 Sources/Diligence/Extensions/Bundle.swift
+1 −1 Sources/Diligence/Extensions/Color.swift
+1 −1 Sources/Diligence/Extensions/NSWindow.swift
+1 −1 Sources/Diligence/Extensions/String.swift
+1 −1 Sources/Diligence/Extensions/UIView.swift
+1 −1 Sources/Diligence/Extensions/URL.swift
+1 −1 Sources/Diligence/Model/Acknowledgements.swift
+1 −1 Sources/Diligence/Model/Action.swift
+1 −1 Sources/Diligence/Model/Contents.swift
+1 −1 Sources/Diligence/Model/Credit.swift
+2 −2 Sources/Diligence/Model/Legal.swift
+1 −1 Sources/Diligence/Model/License.swift
+3 −3 Sources/Diligence/Model/LicenseGroup.swift
+1 −1 Sources/Diligence/Model/NamedURL.swift
+1 −1 Sources/Diligence/Resources/LICENSE
+1 −1 Sources/Diligence/Scenes/AboutWindowGroup.swift
+1 −1 Sources/Diligence/Scenes/MacAboutWindow.swift
+1 −1 Sources/Diligence/Scenes/MacLicenseWindowGroup.swift
+1 −1 Sources/Diligence/View Modifiers/HookView.swift
+1 −1 Sources/Diligence/View Modifiers/HorizontalSpace.swift
+1 −1 Sources/Diligence/View Modifiers/Hyperlink.swift
+1 −1 Sources/Diligence/View Modifiers/IsVisibleInScrollView.swift
+1 −1 Sources/Diligence/View Modifiers/PaddingWithMultiplier.swift
+54 −0 Sources/Diligence/Views/AboutLink.swift
+1 −1 Sources/Diligence/Views/AboutView.swift
+1 −1 Sources/Diligence/Views/ActionSection.swift
+1 −1 Sources/Diligence/Views/ApplicationNameTitle.swift
+1 −1 Sources/Diligence/Views/BuildSection.swift
+1 −1 Sources/Diligence/Views/CreditSection.swift
+34 −0 Sources/Diligence/Views/DefaultAboutLinkLabel.swift
+1 −1 Sources/Diligence/Views/HeaderSection.swift
+1 −1 Sources/Diligence/Views/Icon.swift
+1 −1 Sources/Diligence/Views/LabeledContent.swift
+1 −1 Sources/Diligence/Views/LicenseRow.swift
+1 −1 Sources/Diligence/Views/LicenseSection.swift
+1 −1 Sources/Diligence/Views/LicenseView.swift
+1 −1 Sources/Diligence/Views/Link.swift
+1 −1 Sources/Diligence/Views/MacAboutSection.swift
+1 −1 Sources/Diligence/Views/MacAboutView.swift
+1 −1 Sources/Diligence/Views/MacIcon.swift
+1 −1 Sources/Diligence/Views/MacLicenseView.swift
+1 −1 Sources/Diligence/Views/PhoneAboutView.swift
+1 −1 Sources/Diligence/Windows/NSLicenseWindow.swift
+4 −4 Tests/DiligenceTests/DiligenceTests.swift
+1 −1 Tests/DiligenceTests/Equivalence.swift
+1 −1 scripts/environment.sh
+1 −1 scripts/install-dependencies.sh
+1 −1 scripts/release.sh
10 changes: 10 additions & 0 deletions InContext/Helper/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,61 @@
{
"images" : [
{
"filename" : "icon_16x16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "icon_32x32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "icon_128x128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "icon_256x256.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "icon_256x256@2x 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "icon_512x512.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions InContext/Helper/Assets.xcassets/Icon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "icon_256x256.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions InContext/Helper/Extensions/Scene.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// MIT License
//
// Copyright (c) 2016-2024 Jason Morley
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import SwiftUI

extension Scene {

public func handlesExternalEvents(matching conditions: Set<URL>) -> some Scene {
return handlesExternalEvents(matching: Set(conditions.map { $0.absoluteString }))
}

}
2 changes: 2 additions & 0 deletions InContext/Helper/Extensions/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import SwiftUI

extension URL: Identifiable {

static let aboutURL = URL(string: "x-incontext-helper://about")!

public var id: Self { return self }

}
66 changes: 25 additions & 41 deletions InContext/Helper/HelperApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import SwiftUI

import Diligence

@main
struct HelperApp: App {

Expand All @@ -35,46 +37,8 @@ struct HelperApp: App {
var body: some Scene {

MenuBarExtra {
SiteList(applicationModel: applicationModel)
Divider()
Menu {
SettingsMenu(applicationModel: applicationModel)
} label: {
Text("Settings")
}
Divider()
Menu {
Menu {
Button("Copy x-location") {
Task {
do {
let pasteboard = NSPasteboard.general
guard let address = pasteboard.string(forType: .string) else {
return
}
let location = try await Geocoder.xLocation(for: address)
pasteboard.clearContents()
pasteboard.setString(location, forType: .string)
} catch {
print("Failed to geocode address with error \(error).")
}
}
}
} label: {
Text("Location")
}
} label: {
Text("Utilities")
}

Divider()

Button {
applicationModel.quit()
} label: {
Text("Quit")
}

MainMenu()
.environmentObject(applicationModel)
} label: {
#if DEBUG
Label("InContext Helper", systemImage: "hammer")
Expand All @@ -85,7 +49,27 @@ struct HelperApp: App {

LogWindow(applicationModel: applicationModel)

}
About(repository: "inseven/incontext", copyright: "Copyright © 2016-2024 Jason Morley") {
Action("Website", url: URL(string: "https://incontext.app")!)
Action("GitHub", url: URL(string: "https://github.com/inseven/incontext")!)
} acknowledgements: {
Acknowledgements("Developers") {
Credit("Jason Morley", url: URL(string: "https://jbmorley.co.uk"))
Credit("Tom Sutcliffe", url: URL(string: "https://github.com/tomsci"))
}
Acknowledgements("Thanks") {
Credit("Lukas Fittl")
Credit("Sarah Barbour")
}
} licenses: {
License("Hummingbird", author: "Hummingbird", filename: "hummingbird-license")
License("InContext", author: "Jason Morley", filename: "incontext-license")
License("LuaSwift", author: "Tom Sutcliffe", filename: "luaswift-license")
License("SQLite.swift", author: "Stephen Celis", filename: "sqliteswift-license")
License("Tilt", author: "Tom Sutcliffe", filename: "tilt-license")
}
.handlesExternalEvents(matching: [.aboutURL])

}

}
Loading

0 comments on commit 3142f63

Please sign in to comment.