Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Custom System Tray Icons #12

Open
ColeTownsend opened this issue Nov 7, 2024 · 1 comment
Open

Feature Request: Custom System Tray Icons #12

ColeTownsend opened this issue Nov 7, 2024 · 1 comment

Comments

@ColeTownsend
Copy link

ColeTownsend commented Nov 7, 2024

Perhaps out of scope for this package, but it would be cool to support custom icon implementations. While currently possible on macOS using custom NSViews, this approach requires manual setup.

In Swift you can do it roughly like below, which I based on this blog

let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
let customView = NSView(frame: NSRect(x: 0, y: 0, width: 30, height: 30))
let arcPath = NSBezierPath()
arcPath.appendArc(withCenter: NSPoint(x: 15, y: 15), radius: 10, startAngle: 90, endAngle: 90 - 270, clockwise: true)
NSColor.systemBlue.setStroke()
arcPath.lineWidth = 3
arcPath.stroke()
statusItem.button?.addSubview(customView)
@freethinkel
Copy link
Owner

I think it has more to do with the tray-icon library that Tauri uses or Tauri itself. In the second version of the plugin I put a lot of effort to re-use the tauri api to work with the statusbar, in the first version it would have been more possible than now. But you can fork it and implement any feature you want, you can create a PR, if you have a chance - I will be happy to look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants