]> git.r.bdr.sh - rbdr/captura/blobdiff - Captura/CapturaApp.swift
Use tinted PDF for Icon
[rbdr/captura] / Captura / CapturaApp.swift
index 5fe88584b7c48d74a06c79294353b477c9abc719..deb1e0775da472cb25c6d464d4380769ad00fa9f 100644 (file)
@@ -82,7 +82,11 @@ struct CapturaApp: App {
     statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
 
     if let button = statusItem.button {
     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
     }
 
     statusItem.isVisible = true
@@ -457,23 +461,27 @@ struct CapturaApp: App {
       let image: String =
         switch captureState {
         case .idle:
       let image: String =
         switch captureState {
         case .idle:
-          "Idle"
+          "MenuBar/Idle"
         case .selectingArea:
           if recordingWindow?.recordingContentView.box != nil {
         case .selectingArea:
           if recordingWindow?.recordingContentView.box != nil {
-            "Ready to Record"
+            "MenuBar/Ready to Record"
           } else {
           } else {
-            "Selecting"
+            "MenuBar/Selecting"
           }
         case .recording:
           }
         case .recording:
-          "Stop Frame 1"
+          "MenuBar/Stop Frame 1"
         case .uploading:
         case .uploading:
-          "Upload Frame 1"
+          "MenuBar/Upload Frame 1"
         case .uploaded:
         case .uploaded:
-          "OK"
+          "MenuBar/OK"
         case .error:
         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
+      }
     }
   }
 
     }
   }