add whitelist mode switch icon

This commit is contained in:
秦宇航
2017-04-02 20:39:24 +08:00
parent ead8ef5a74
commit 7f56383286
3 changed files with 7 additions and 4 deletions
+7 -4
View File
@@ -559,6 +559,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
} else if mode == "manual" {
image = NSImage(named: "menu_icon_manual")!
//statusItem?.title = "Manual".localized
} else if mode == "whiteListDomain" || mode == "whiteListIP" {
image = NSImage(named: "menu_icon_white")!
}
let titleWidth:CGFloat = 0//statusItem?.title!.size(withAttributes: [NSFontAttributeName: statusItem?.button!.font!]).width//这里不包含IP白名单模式等等,需要重新调整//PS还是给上游加上白名单模式?
let imageWidth:CGFloat = 22
@@ -574,18 +576,19 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
if isOn {
runningStatusMenuItem.title = "Shadowsocks: On".localized
toggleRunningMenuItem.title = "Turn Shadowsocks Off".localized
image = NSImage(named: "menu_icon")!
//image = NSImage(named: "menu_icon")!
updateStatusItemUI()
} else {
runningStatusMenuItem.title = "Shadowsocks: Off".localized
toggleRunningMenuItem.title = "Turn Shadowsocks On".localized
image = NSImage(named: "menu_icon_disabled")!
image.isTemplate = true
statusItem!.image = image
}
image.isTemplate = true
statusItem!.image = image
ShowNetworkSpeedItem.state = defaults.bool(forKey: "enable_showSpeed") ? 1 : 0
connectAtLaunchMenuItem.state = defaults.bool(forKey: "ConnectAtLaunch") ? 1 : 0
checkUpdateAtLaunchMenuItem.state = defaults.bool(forKey: "AutoCheckUpdate") ? 1 : 0
updateStatusItemUI()
}
func updateServersMenu() {
Binary file not shown.
Binary file not shown.