Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed Nov 3, 2022
1 parent a5d3b72 commit e2f0a1d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/SwiftKeys/KeyRecorder/KeyRecorder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,13 @@ extension KeyRecorder {
}
}

let imageDelete: NSImage = {
let deleteImage: NSImage = {
let image = NSImage(named: NSImage.stopProgressFreestandingTemplateName)!
image.isTemplate = true
return image
}()

let imageEscape: NSImage = {
let escapeImage: NSImage = {
let escapeKeyCode = 0x238B
let string = NSString(format: "%C", escapeKeyCode)
var attributes: [NSAttributedString.Key: Any] = [.foregroundColor: NSColor.white]
Expand All @@ -447,7 +447,7 @@ extension KeyRecorder {
return image
}()

var imageRecord: NSImage {
var recordImage: NSImage {
let size = NSSize(width: 13, height: 13)
let image = NSImage(size: size, flipped: false) {
NSBezierPath(ovalIn: $0.insetBy(dx: 2.5, dy: 2.5)).fill()
Expand Down Expand Up @@ -613,12 +613,12 @@ extension KeyRecorder {
func setImage(forState state: RecordingState) {
switch state {
case .recording:
setImage(imageEscape, forSegment: 1)
setImage(escapeImage, forSegment: 1)
case .idle:
if proxy.isRegistered {
setImage(imageDelete, forSegment: 1)
setImage(deleteImage, forSegment: 1)
} else {
setImage(imageRecord, forSegment: 1)
setImage(recordImage, forSegment: 1)
}
}
}
Expand Down

0 comments on commit e2f0a1d

Please sign in to comment.