statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
if let button = statusItem.button {
- button.image = NSImage(named: "Idle")
+ if let image = NSImage(named: "MenuBar/Idle") {
+ image.isTemplate = true
+ image.size = NSSize(width: 18, height: 18)
+ button.image = image
+ }
}
statusItem.isVisible = true
let image: String =
switch captureState {
case .idle:
- "Idle"
+ "MenuBar/Idle"
case .selectingArea:
if recordingWindow?.recordingContentView.box != nil {
- "Ready to Record"
+ "MenuBar/Ready to Record"
} else {
- "Selecting"
+ "MenuBar/Selecting"
}
case .recording:
- "Stop Frame 1"
+ "MenuBar/Stop Frame 1"
case .uploading:
- "Upload Frame 1"
+ "MenuBar/Upload Frame 1"
case .uploaded:
- "OK"
+ "MenuBar/OK"
case .error:
- "ERR"
+ "MenuBar/ERR"
}
- button.image = NSImage(named: image)
+ if let image = NSImage(named: image) {
+ image.isTemplate = true
+ image.size = NSSize(width: 18, height: 18)
+ button.image = image
+ }
}
}