macOS menu bar app to quickly toggle the scroll direction
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

33 lines
719 B

//
// Direction.swift
// ScrollSwitcher
//
// Created by Shadowfacts on 9/12/21.
//
import AppKit
let defaultsKey = "com.apple.swipescrolldirection"
enum Direction: Equatable {
case normal, natural
static var current: Direction {
let value = UserDefaults.standard.bool(forKey: defaultsKey)
if value {
return .natural
} else {
return .normal
}
}
var image: NSImage {
switch self {
case .normal:
return NSImage(systemSymbolName: "scroll", accessibilityDescription: nil)!
case .natural:
return NSImage(systemSymbolName: "scroll.fill", accessibilityDescription: nil)!
}
}
}