2012-04-16 53 views
1

我们可以从系统预置 - >桌面设置中更改半透明菜单栏。检查osx菜单栏是否半透明?

有没有办法从某些API或plist文件读取此设置,并在用户从半透明菜单栏设置切换时得到通知?

如果我们这样做,

[[NSDistributedNotificationCenter defaultCenter] 
addObserver:self 
selector:@selector(dockChanges:) 
name:@"com.apple.dock.prefchanged" 
object:nil]; 

我们可以通知系统喜好进行更改。我在找同样的东西?

回答

0

这就是我们如何才能得到有关菜单透明度的信息。

NSDictionary *oldGlobalPreferences = [NSDictionary dictionaryWithContentsOfFile: 
               [@"~/Library/Preferences/.GlobalPreferences.plist" 
               stringByExpandingTildeInPath]]; 

bool bIsTransparencyEnabled = [[oldGlobalPreferences objectForKey:@"AppleEnableMenuBarTransparency"] boolValue]; 
+0

虽然这看起来不符合Mac App Store标准。 – rid 2012-04-18 21:49:52