Minor tweaks

This commit is contained in:
Sindre Sorhus 2017-06-25 06:53:37 +02:00
parent a09b1d48ae
commit 69a4b503ef
3 changed files with 8 additions and 10 deletions

View file

@ -6,8 +6,6 @@
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>

View file

@ -10,7 +10,7 @@ import Cocoa
private final class ToolbarSliderCell: NSSliderCell {
private static let knob: NSImage = {
let frame = NSRect(x: 0, y: 0, width: 32, height: 32)
let frame = CGRect(x: 0, y: 0, width: 32, height: 32)
let image = NSImage(size: frame.size)
image.lockFocus()
@ -29,7 +29,7 @@ private final class ToolbarSliderCell: NSSliderCell {
return image
}()
override func drawKnob(_ knobRect: NSRect) {
override func drawKnob(_ knobRect: CGRect) {
ToolbarSliderCell.knob.draw(in: knobRect.insetBy(dx: 0, dy: 6.5))
}
}
@ -41,7 +41,7 @@ final class ToolbarSlider: NSSlider {
}
convenience init() {
self.init(frame: CGRect.zero)
self.init(frame: .zero)
}
required init?(coder: NSCoder) {

View file

@ -15,7 +15,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
NSApp.servicesProvider = self
_ = SUUpdater()
controller.window?.delegate = self
@ -69,10 +69,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
controller.window!.alphaValue = CGFloat(sender.doubleValue)
UserDefaults.standard.set(sender.doubleValue, forKey: "windowTransparency")
}
@objc func toggleView(_ pboard: NSPasteboard, userData: String, error: NSErrorPointer) {
let a = controller.window!.isVisible
controller.window!.setIsVisible(!a)
@objc
func toggleView(_ pboard: NSPasteboard, userData: String, error: NSErrorPointer) {
controller.window!.setIsVisible(!controller.window!.isVisible)
}
}