mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-30 05:13:46 +00:00
add whitelist mode switch icon
This commit is contained in:
@@ -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.
Reference in New Issue
Block a user