-
Notifications
You must be signed in to change notification settings - Fork 16
/
Menu.swift
63 lines (52 loc) · 1.58 KB
/
Menu.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import Cocoa
import Foundation
let feedbackURL = URL(string: "https://github.com/chamburr/glance/issues")!
let licenseURL = URL(string: "https://github.com/chamburr/glance/blob/main/LICENSE.md")!
let privacyPolicyURL = URL(string: "https://github.com/chamburr/glance/blob/main/PRIVACY.md")!
let websiteURL = URL(string: "https://github.com/chamburr/glance")!
/// Used as a subclass for the menu item in Interface Builder
final class SupportedFilesMenuItem: NSMenuItem {
required init(coder decoder: NSCoder) {
super.init(coder: decoder)
onAction = { _ in
let supportedFilesWC = SupportedFilesWC(windowNibName: NSNib.Name("SupportedFilesWC"))
supportedFilesWC.showWindow(nil)
}
}
}
/// Used as a subclass for the menu item in Interface Builder
final class FeedbackMenuItem: NSMenuItem {
required init(coder decoder: NSCoder) {
super.init(coder: decoder)
onAction = { _ in
feedbackURL.open()
}
}
}
/// Used as a subclass for the menu item in Interface Builder
final class LicenseMenuItem: NSMenuItem {
required init(coder decoder: NSCoder) {
super.init(coder: decoder)
onAction = { _ in
licenseURL.open()
}
}
}
/// Used as a subclass for the menu item in Interface Builder
final class PrivacyPolicyMenuItem: NSMenuItem {
required init(coder decoder: NSCoder) {
super.init(coder: decoder)
onAction = { _ in
privacyPolicyURL.open()
}
}
}
/// Used as a subclass for the menu item in Interface Builder
final class WebsiteMenuItem: NSMenuItem {
required init(coder decoder: NSCoder) {
super.init(coder: decoder)
onAction = { _ in
websiteURL.open()
}
}
}