mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-01 12:41:43 +08:00
Use high-resolution menu bar icon on Mac (#1795)
MenuBarIcon.png was pretty low resolution. Let's use an existing high-resolution icon and scale it on demand. Note we couldn't just use the LivebookIcon.icns directly because the system seems to pick the largest size and the icon doesn't fit.
This commit is contained in:
parent
fb9c8df7ea
commit
1bf9b8fa9c
2 changed files with 6 additions and 1 deletions
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB |
|
@ -53,7 +53,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
|
||||
statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||
let button = statusItem.button!
|
||||
button.image = NSImage(named: "MenuBarIcon")
|
||||
let icon = NSImage(named: "LivebookIcon")!
|
||||
let resizedIcon = NSImage(size: NSSize(width: 18, height: 18), flipped: false) { (dstRect) -> Bool in
|
||||
icon.draw(in: dstRect)
|
||||
return true
|
||||
}
|
||||
button.image = resizedIcon
|
||||
let menu = NSMenu()
|
||||
|
||||
let copyURLItem = NSMenuItem(title: "Copy URL", action: nil, keyEquivalent: "c")
|
||||
|
|
Loading…
Reference in a new issue