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

The icon is not Yosemite themes (Light/Dark) compatible #5

Open
munas opened this issue Mar 3, 2015 · 1 comment
Open

The icon is not Yosemite themes (Light/Dark) compatible #5

munas opened this issue Mar 3, 2015 · 1 comment

Comments

@munas
Copy link

munas commented Mar 3, 2015

I just started to learn programming for Apple devices and believe that Swift is the correct choice.
I tried to modify your code and make the icon compatible with OS X Yosemite themes. However, have no luck.
If to use black icon, after Yosemite theme switched to the Dark mode the icon gets invisible.
Adding image.setTemplate(true) has no effect.
Do you have any solution that would make your code Yosemite themes compatible?

   init(imageName: String, item: NSStatusItem)
    {

        self.image = NSImage(named: imageName)!

        self.item = item
        self.isSelected = false
    image.setTemplate(true)
        self.onMouseDown = {}


        let thickness = NSStatusBar.systemStatusBar().thickness
        let rect = CGRectMake(0, 0, thickness, thickness)

        super.init(frame: rect)
    }
@ChristianSch
Copy link

Well, I got kind of a workaround. Not as sophisticated as setTemplate, but it works. See: https://github.com/andinfinity/idrop.link-osx/blob/master/idrop.link/IconView.swift#L88

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