feat: add licence to about page
Also use data from Info.plist to make it more DRY
This commit is contained in:
1 parent
efc9bd3d3e
commit
cb66b79582
5 files changed
+10
-9
No files matched your search
@@ -23,7 +23,7 @@
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>GPL-3.0 licence (https://github.com/lwouis/alt-tab-macos/blob/master/LICENCE.md)</string>
|
||||
<string>GPL-3.0 licence</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>LSUIElement</key>
|
||||
|
||||
@@ -4,8 +4,9 @@ import Darwin
|
||||
let cgsMainConnectionId = CGSMainConnectionID()
|
||||
|
||||
class App: NSApplication, NSApplicationDelegate, NSWindowDelegate {
|
||||
static let name = "AltTab"
|
||||
static let version = "#VERSION#"
|
||||
static let name = Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as! String
|
||||
static let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String
|
||||
static let licence = Bundle.main.object(forInfoDictionaryKey: "NSHumanReadableCopyright") as! String
|
||||
static let repository = "https://github.com/lwouis/alt-tab-macos"
|
||||
var statusItem: NSStatusItem?
|
||||
var thumbnailsPanel: ThumbnailsPanel?
|
||||
|
||||
@@ -3,7 +3,7 @@ import Cocoa
|
||||
class Menubar {
|
||||
static func make(_ app: App) -> NSStatusItem {
|
||||
let item = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||
item.button!.title = App.name
|
||||
item.button!.title = "AltTab"
|
||||
item.menu = NSMenu()
|
||||
item.menu!.addItem(
|
||||
withTitle: "Show",
|
||||
|
||||
@@ -7,17 +7,19 @@ class AboutTab: NSObject {
|
||||
|
||||
static func makeView() -> NSGridView {
|
||||
let appIcon = NSImageView(image: App.shared.applicationIconImage)
|
||||
appIcon.fit(128, 128)
|
||||
appIcon.fit(150, 150)
|
||||
let appText = NSStackView(views: [
|
||||
BoldLabel(App.name),
|
||||
NSTextField(wrappingLabelWithString: "Version \(App.version)"),
|
||||
NSTextField(wrappingLabelWithString: "Version " + App.version),
|
||||
NSTextField(wrappingLabelWithString: App.licence),
|
||||
HyperlinkLabel("Source code repository", App.repository),
|
||||
HyperlinkLabel("Latest releases", App.repository + "/releases"),
|
||||
])
|
||||
appText.orientation = .vertical
|
||||
appText.alignment = .left
|
||||
appText.spacing = GridView.interPadding / 2
|
||||
appText.views[2].topAnchor.constraint(equalTo: appText.views[1].bottomAnchor, constant: GridView.interPadding).isActive = true
|
||||
let rowToSeparate = 3
|
||||
appText.views[rowToSeparate].topAnchor.constraint(equalTo: appText.views[rowToSeparate - 1].bottomAnchor, constant: GridView.interPadding).isActive = true
|
||||
let appInfo = NSStackView(views: [appIcon, appText])
|
||||
appInfo.spacing = GridView.interPadding
|
||||
let view = GridView.make([
|
||||
|
||||
@@ -3,7 +3,5 @@
|
||||
set -exu
|
||||
|
||||
version="$(cat VERSION.txt)"
|
||||
# set the version displayed in the app UI
|
||||
sed -i '' -e "s/#VERSION#/$version/" alt-tab-macos/ui/App.swift
|
||||
# set the version in the app meta-data for the AppStore and app "Get Info" panel
|
||||
sed -i '' -e "s/#VERSION#/$version/" alt-tab-macos/Info.plist
|
||||
Reference in new issue
Block a user