Cleanup things
This commit is contained in:
parent
f6b02d6f79
commit
4403fb8eca
|
@ -14,14 +14,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
// things that need to be retained to keep them from disappearing
|
||||
private var prefPanesSupport: Bundle!
|
||||
private var item: NSStatusItem!
|
||||
private var observation: NSKeyValueObservation?
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
|
||||
// this is where _setSwipeScrollDirection is defined
|
||||
prefPanesSupport = Bundle(path: "/System/Library/PrivateFrameworks/PreferencePanesSupport.framework")
|
||||
try! prefPanesSupport!.loadAndReturnError()
|
||||
|
||||
item = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength)
|
||||
item.button!.target = self
|
||||
item.button!.action = #selector(menuItemClicked)
|
||||
|
@ -84,7 +78,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
// makes system preferences update
|
||||
DistributedNotificationCenter.default().postNotificationName(.swipeScrollDirectionDidChangeNotification, object: nil, userInfo: nil, deliverImmediately: false)
|
||||
// make the actual input behavior update
|
||||
setSwipeScrollDirection(Int32(new.rawValue))
|
||||
setSwipeScrollDirection(new == .natural)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -96,7 +90,7 @@ extension AppDelegate: NSMenuDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
enum Direction: Int, Equatable {
|
||||
enum Direction: Equatable {
|
||||
case normal, natural
|
||||
|
||||
static var current: Direction {
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#ifndef ScrollSwitcher_Bridging_Header_h
|
||||
#define ScrollSwitcher_Bridging_Header_h
|
||||
|
||||
void setSwipeScrollDirection(int arg0);
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
void setSwipeScrollDirection(BOOL natural);
|
||||
|
||||
#endif /* ScrollSwitcher_Bridging_Header_h */
|
||||
|
|
Loading…
Reference in New Issue