From 8d98e05a4d2c9834e52b4d54ce60922e44155d66 Mon Sep 17 00:00:00 2001 From: Charlie Qiu Date: Fri, 10 Jun 2016 21:25:17 +0800 Subject: [PATCH] Update status bar icon when toggle running. --- ShadowsocksX-NG/AppDelegate.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ShadowsocksX-NG/AppDelegate.swift b/ShadowsocksX-NG/AppDelegate.swift index db9e756..2a53dfb 100644 --- a/ShadowsocksX-NG/AppDelegate.swift +++ b/ShadowsocksX-NG/AppDelegate.swift @@ -273,13 +273,14 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele if isOn { runningStatusMenuItem.title = "Shadowsocks: On".localized toggleRunningMenuItem.title = "Close Shadowsocks".localized + let image = NSImage(named: "menu_icon") + statusItem.image = image } else { runningStatusMenuItem.title = "Shadowsocks: Off".localized toggleRunningMenuItem.title = "Open Shadowsocks".localized + let image = NSImage(named: "menu_icon_disabled") + statusItem.image = image } - - - } func updateServersMenu() {