- add support button

- add Paypal and Patreon to Github Sponsor providers
This commit is contained in:
Serhiy Mytrovtsiy
2020-10-23 14:31:03 +02:00
parent 2100c0b134
commit 86aaa57a21
7 changed files with 38 additions and 5 deletions

2
.github/FUNDING.yml vendored
View File

@@ -1 +1,3 @@
github: [exelban]
patreon: exelban
custom: ["https://www.paypal.com/donate?hosted_button_id=3DS5JHDBATMTC"]

View File

@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View 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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -34,8 +34,8 @@ class SettingsWindow: NSWindow, NSWindowDelegate {
self.collectionBehavior = .moveToActiveSpace
self.titlebarAppearsTransparent = true
self.appearance = NSAppearance(named: .darkAqua)
self.center()
self.setIsVisible(false)
// self.center()
self.setIsVisible(true)
let windowController = NSWindowController()
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(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)))
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")!)
}
@objc private func donate(_ sender: Any) {
NSWorkspace.shared.open(URL(string: "https://github.com/exelban/stats")!)
}
@objc private func closeApp(_ sender: Any) {
NSApp.terminate(sender)
}