misc: swiftlint auto fix
This commit is contained in:
parent
209c1db1fa
commit
f266dbf8b7
|
@ -21,7 +21,7 @@ extension NSView {
|
||||||
$0.leftAnchor.constraint(equalTo: $0.superview!.leftAnchor, constant: inset.left),
|
$0.leftAnchor.constraint(equalTo: $0.superview!.leftAnchor, constant: inset.left),
|
||||||
$0.rightAnchor.constraint(equalTo: $0.superview!.rightAnchor, constant: -inset.right),
|
$0.rightAnchor.constraint(equalTo: $0.superview!.rightAnchor, constant: -inset.right),
|
||||||
$0.topAnchor.constraint(equalTo: $0.superview!.topAnchor, constant: inset.top),
|
$0.topAnchor.constraint(equalTo: $0.superview!.topAnchor, constant: inset.top),
|
||||||
$0.bottomAnchor.constraint(equalTo: $0.superview!.bottomAnchor, constant: -inset.bottom),
|
$0.bottomAnchor.constraint(equalTo: $0.superview!.bottomAnchor, constant: -inset.bottom)
|
||||||
] }
|
] }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ extension NSView {
|
||||||
func makeConstraintsBindToCenterOfSuperview() -> Self {
|
func makeConstraintsBindToCenterOfSuperview() -> Self {
|
||||||
return makeConstraints { [
|
return makeConstraints { [
|
||||||
$0.centerXAnchor.constraint(equalTo: $0.superview!.centerXAnchor),
|
$0.centerXAnchor.constraint(equalTo: $0.superview!.centerXAnchor),
|
||||||
$0.centerYAnchor.constraint(equalTo: $0.superview!.centerYAnchor),
|
$0.centerYAnchor.constraint(equalTo: $0.superview!.centerYAnchor)
|
||||||
] }
|
] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ class SSIDSuspendTool {
|
||||||
self?.update()
|
self?.update()
|
||||||
}.disposed(by: disposeBag)
|
}.disposed(by: disposeBag)
|
||||||
|
|
||||||
|
|
||||||
ConfigManager.shared
|
ConfigManager.shared
|
||||||
.proxyShouldPaused
|
.proxyShouldPaused
|
||||||
.asObservable()
|
.asObservable()
|
||||||
|
|
|
@ -28,7 +28,6 @@ class DebugSettingViewController: NSViewController {
|
||||||
@IBAction func actionOpenLocalConfig(_ sender: Any) {
|
@IBAction func actionOpenLocalConfig(_ sender: Any) {
|
||||||
NSWorkspace.shared.openFile(kConfigFolderPath)
|
NSWorkspace.shared.openFile(kConfigFolderPath)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@IBAction func actionOpenIcloudConfig(_ sender: Any) {
|
@IBAction func actionOpenIcloudConfig(_ sender: Any) {
|
||||||
if ICloudManager.shared.icloudAvailable {
|
if ICloudManager.shared.icloudAvailable {
|
||||||
|
|
|
@ -25,7 +25,6 @@ class GeneralSettingViewController: NSViewController {
|
||||||
|
|
||||||
@IBOutlet weak var apiSecretOverrideButton: NSButton!
|
@IBOutlet weak var apiSecretOverrideButton: NSButton!
|
||||||
|
|
||||||
|
|
||||||
var disposeBag = DisposeBag()
|
var disposeBag = DisposeBag()
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
@ -37,7 +36,6 @@ class GeneralSettingViewController: NSViewController {
|
||||||
Settings.proxyIgnoreList = arr
|
Settings.proxyIgnoreList = arr
|
||||||
}.disposed(by: disposeBag)
|
}.disposed(by: disposeBag)
|
||||||
|
|
||||||
|
|
||||||
ssidSuspendTextField.string = Settings.disableSSIDList.joined(separator: ",")
|
ssidSuspendTextField.string = Settings.disableSSIDList.joined(separator: ",")
|
||||||
ssidSuspendTextField.rx
|
ssidSuspendTextField.rx
|
||||||
.string.debounce(.milliseconds(500), scheduler: MainScheduler.instance)
|
.string.debounce(.milliseconds(500), scheduler: MainScheduler.instance)
|
||||||
|
|
|
@ -24,7 +24,6 @@ extension KeyboardShortcuts.Name {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum KeyboardShortCutManager {
|
enum KeyboardShortCutManager {
|
||||||
static func setup() {
|
static func setup() {
|
||||||
KeyboardShortcuts.onKeyUp(for: .toggleSystemProxyMode) {
|
KeyboardShortcuts.onKeyUp(for: .toggleSystemProxyMode) {
|
||||||
|
@ -80,24 +79,22 @@ class GlobalShortCutViewController: NSViewController {
|
||||||
addGridView(in: proxyBox.contentView!, with: [
|
addGridView(in: proxyBox.contentView!, with: [
|
||||||
[NSTextField(labelWithString: NSLocalizedString("System Proxy", comment: "")), systemProxy],
|
[NSTextField(labelWithString: NSLocalizedString("System Proxy", comment: "")), systemProxy],
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Copy Shell Command", comment: "")), copyShellCommand],
|
[NSTextField(labelWithString: NSLocalizedString("Copy Shell Command", comment: "")), copyShellCommand],
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Copy Shell Command (External)", comment: "")),copyShellCommandExternal],
|
[NSTextField(labelWithString: NSLocalizedString("Copy Shell Command (External)", comment: "")), copyShellCommandExternal]
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
addGridView(in: modeBoxView, with: [
|
addGridView(in: modeBoxView, with: [
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Direct Mode", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .modeDirect)],
|
[NSTextField(labelWithString: NSLocalizedString("Direct Mode", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .modeDirect)],
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Rule Mode", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .modeRule)],
|
[NSTextField(labelWithString: NSLocalizedString("Rule Mode", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .modeRule)],
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Global Mode", comment: "")),KeyboardShortcuts.RecorderCocoa(for: .modeGlobal)],
|
[NSTextField(labelWithString: NSLocalizedString("Global Mode", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .modeGlobal)]
|
||||||
])
|
])
|
||||||
|
|
||||||
addGridView(in: otherBoxView, with: [
|
addGridView(in: otherBoxView, with: [
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Open Menu", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .openMenu)],
|
[NSTextField(labelWithString: NSLocalizedString("Open Menu", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .openMenu)],
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Open Log", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .log)],
|
[NSTextField(labelWithString: NSLocalizedString("Open Log", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .log)],
|
||||||
[NSTextField(labelWithString: NSLocalizedString("Open Dashboard", comment: "")),KeyboardShortcuts.RecorderCocoa(for: .dashboard)],
|
[NSTextField(labelWithString: NSLocalizedString("Open Dashboard", comment: "")), KeyboardShortcuts.RecorderCocoa(for: .dashboard)]
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func addGridView(in superView: NSView, with views: [[NSView]]) {
|
func addGridView(in superView: NSView, with views: [[NSView]]) {
|
||||||
let gridView = NSGridView(views: views)
|
let gridView = NSGridView(views: views)
|
||||||
gridView.rowSpacing = 10
|
gridView.rowSpacing = 10
|
||||||
|
|
Loading…
Reference in New Issue