feat: added Open Collective support option

This commit is contained in:
Serhiy Mytrovtsiy
2021-09-25 11:23:24 +02:00
parent fc741b9bbc
commit e99eea53c6
4 changed files with 28 additions and 1 deletions

1
.github/FUNDING.yml vendored
View File

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

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "open_collective.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -278,7 +278,7 @@ private class SettingsView: NSView {
private func supportView() -> NSViewController {
let vc: NSViewController = NSViewController(nibName: nil, bundle: nil)
let view: NSStackView = NSStackView(frame: NSRect(x: 0, y: 0, width: 160, height: 40))
let view: NSStackView = NSStackView(frame: NSRect(x: 0, y: 0, width: 200, height: 40))
view.spacing = 0
view.orientation = .horizontal
@@ -286,6 +286,7 @@ private class SettingsView: NSView {
view.addArrangedSubview(supportButton(name: "PayPal", image: "paypal", action: #selector(self.openPaypal)))
view.addArrangedSubview(supportButton(name: "Ko-fi", image: "ko-fi", action: #selector(self.openKofi)))
view.addArrangedSubview(supportButton(name: "Patreon", image: "patreon", action: #selector(self.openPatreon)))
view.addArrangedSubview(supportButton(name: "Open Collective", image: "open_collective", action: #selector(self.openOpencollective)))
vc.view = view
return vc
@@ -338,6 +339,10 @@ private class SettingsView: NSView {
NSWorkspace.shared.open(URL(string: "https://patreon.com/exelban")!)
}
@objc private func openOpencollective(_ sender: NSButton) {
NSWorkspace.shared.open(URL(string: "https://opencollective.com/stats")!)
}
@objc private func closeApp(_ sender: Any) {
NSApp.terminate(sender)
}