Skip to content

Commit

Permalink
feat: add support for Vision Pro (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski authored Jun 23, 2023
1 parent a6b26b9 commit d85483c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
21 changes: 21 additions & 0 deletions MiniSim/Assets.xcassets/vision_os.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "vision_os.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions MiniSim/Extensions/NSMenuItem+ImageInit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ extension NSMenuItem {
if let image {
self.image = image
} else {
let imageName = self.getSystemImageFromName(name: title)
self.image = NSImage(systemSymbolName: imageName, accessibilityDescription: title)
if title.contains("Vision") {
self.image = NSImage(named: "vision_os")
self.image?.isTemplate = true
self.image?.size = NSSize(width: 15, height: 8.5)
} else {
let imageName = self.getSystemImageFromName(name: title)
self.image = NSImage(systemSymbolName: imageName, accessibilityDescription: title)
}

}

self.tag = type.rawValue
Expand Down

0 comments on commit d85483c

Please sign in to comment.