diff --git a/ShadowsocksX-NG/AppDelegate.swift b/ShadowsocksX-NG/AppDelegate.swift index e835ccb..d350d92 100644 --- a/ShadowsocksX-NG/AppDelegate.swift +++ b/ShadowsocksX-NG/AppDelegate.swift @@ -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() { diff --git a/ShadowsocksX-NG/Assets.xcassets/menu_icon.psd b/ShadowsocksX-NG/Assets.xcassets/menu_icon.psd new file mode 100644 index 0000000..f187f69 Binary files /dev/null and b/ShadowsocksX-NG/Assets.xcassets/menu_icon.psd differ diff --git a/ShadowsocksX-NG/Assets.xcassets/menu_icon@2x.psd b/ShadowsocksX-NG/Assets.xcassets/menu_icon@2x.psd new file mode 100644 index 0000000..1ad0082 Binary files /dev/null and b/ShadowsocksX-NG/Assets.xcassets/menu_icon@2x.psd differ