如何在 Yosemite 中检测暗模式以更改状态栏菜单图标 [英] How to detect dark mode in Yosemite to change the status bar menu icon

查看:53
本文介绍了如何在 Yosemite 中检测暗模式以更改状态栏菜单图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Yosemite 中启用暗模式时,必须更改状态栏应用程序图标.如何检测暗模式是否已启用?有相同的通知吗?

The status bar app icon has to be changed when dark mode is enabled in Yosemite. How to detect if dark mode has been enabled ? Is there any notification for the same ?

显示另一个图像或更改现有图像的 alpha 值会更好吗?需要输入哪种更好的方法??

Is it better to display another image or change the alpha value of existing Image ? Need inputs on which is the better way to go ??

推荐答案

状态栏图标需要是模板图像.只需将 setTemplate:Yes 设置为 NSImage.当切换到暗模式时,应该会产生活力.

The Status bar icon needs to be a template image. Just set the setTemplate:Yes to NSImage. And when switched to dark mode , the vibrancy should apply.

这篇关于如何在 Yosemite 中检测暗模式以更改状态栏菜单图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆