mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
- add support button
- add Paypal and Patreon to Github Sponsor providers
This commit is contained in:
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1 +1,3 @@
|
|||||||
github: [exelban]
|
github: [exelban]
|
||||||
|
patreon: exelban
|
||||||
|
custom: ["https://www.paypal.com/donate?hosted_button_id=3DS5JHDBATMTC"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"info" : {
|
"info" : {
|
||||||
"version" : 1,
|
"author" : "xcode",
|
||||||
"author" : "xcode"
|
"version" : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
26
Stats/Supporting Files/Assets.xcassets/donate.imageset/Contents.json
vendored
Normal file
26
Stats/Supporting Files/Assets.xcassets/donate.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "donate@1x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "donate@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "donate@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Stats/Supporting Files/Assets.xcassets/donate.imageset/donate@1x.png
vendored
Normal file
BIN
Stats/Supporting Files/Assets.xcassets/donate.imageset/donate@1x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
Stats/Supporting Files/Assets.xcassets/donate.imageset/donate@2x.png
vendored
Normal file
BIN
Stats/Supporting Files/Assets.xcassets/donate.imageset/donate@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
Stats/Supporting Files/Assets.xcassets/donate.imageset/donate@3x.png
vendored
Normal file
BIN
Stats/Supporting Files/Assets.xcassets/donate.imageset/donate@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -34,8 +34,8 @@ class SettingsWindow: NSWindow, NSWindowDelegate {
|
|||||||
self.collectionBehavior = .moveToActiveSpace
|
self.collectionBehavior = .moveToActiveSpace
|
||||||
self.titlebarAppearsTransparent = true
|
self.titlebarAppearsTransparent = true
|
||||||
self.appearance = NSAppearance(named: .darkAqua)
|
self.appearance = NSAppearance(named: .darkAqua)
|
||||||
self.center()
|
// self.center()
|
||||||
self.setIsVisible(false)
|
self.setIsVisible(true)
|
||||||
|
|
||||||
let windowController = NSWindowController()
|
let windowController = NSWindowController()
|
||||||
windowController.window = self
|
windowController.window = self
|
||||||
@@ -132,6 +132,7 @@ private class SettingsView: NSView {
|
|||||||
|
|
||||||
buttonsView.addSubview(self.makeButton(4, title: LocalizedString("Open Activity Monitor"), image: "chart", action: #selector(openActivityMonitor)))
|
buttonsView.addSubview(self.makeButton(4, title: LocalizedString("Open Activity Monitor"), image: "chart", action: #selector(openActivityMonitor)))
|
||||||
buttonsView.addSubview(self.makeButton(3, title: LocalizedString("Report a bug"), image: "bug", action: #selector(reportBug)))
|
buttonsView.addSubview(self.makeButton(3, title: LocalizedString("Report a bug"), image: "bug", action: #selector(reportBug)))
|
||||||
|
buttonsView.addSubview(self.makeButton(2, title: LocalizedString("Support app"), image: "donate", action: #selector(donate)))
|
||||||
buttonsView.addSubview(self.makeButton(1, title: LocalizedString("Close application"), image: "power", action: #selector(closeApp)))
|
buttonsView.addSubview(self.makeButton(1, title: LocalizedString("Close application"), image: "power", action: #selector(closeApp)))
|
||||||
|
|
||||||
let mainView: NSView = NSView(frame: NSRect(x: navigationWidth, y: 1, width: frame.width - navigationWidth-1, height: frame.height-1))
|
let mainView: NSView = NSView(frame: NSRect(x: navigationWidth, y: 1, width: frame.width - navigationWidth-1, height: frame.height-1))
|
||||||
@@ -280,6 +281,10 @@ private class SettingsView: NSView {
|
|||||||
NSWorkspace.shared.open(URL(string: "https://github.com/exelban/stats/issues/new")!)
|
NSWorkspace.shared.open(URL(string: "https://github.com/exelban/stats/issues/new")!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc private func donate(_ sender: Any) {
|
||||||
|
NSWorkspace.shared.open(URL(string: "https://github.com/exelban/stats")!)
|
||||||
|
}
|
||||||
|
|
||||||
@objc private func closeApp(_ sender: Any) {
|
@objc private func closeApp(_ sender: Any) {
|
||||||
NSApp.terminate(sender)
|
NSApp.terminate(sender)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user