@@ -19,11 +19,16 @@ let menubar = require('menubar');
1919
2020let server ;
2121
22+ const icons = {
23+ active : app . getAppPath ( ) + '/IconTemplate.png' ,
24+ subdued : app . getAppPath ( ) + '/IconSubduedTemplate.png'
25+ }
26+
2227let mb = menubar ( {
2328 preloadWindow : true ,
2429 width : 400 ,
2530 height : 180 ,
26- icon : app . getAppPath ( ) + '/IconTemplate.png'
31+ icon : icons . subdued
2732} ) ;
2833
2934mb . on ( 'ready' , function ready ( ) {
@@ -40,17 +45,19 @@ ipc.on('connect', function(event) {
4045} ) ;
4146
4247ipc . on ( 'start-proxy' , function ( event , port ) {
43- server = setup ( http . createServer ( ) ) ;
44- server . listen ( port , function ( ) {
48+ server = setup ( http . createServer ( ) ) ;
49+ server . listen ( port , function ( ) {
50+ mb . tray . setImage ( icons . active ) ;
4551 var port = server . address ( ) . port ;
4652 console . log ( 'HTTP(s) proxy server listening on port %d' , port ) ;
4753 } ) ;
4854} ) ;
4955
5056ipc . on ( 'stop-proxy' , function ( event , port ) {
51- server . close ( function ( ) {
52- console . log ( 'proxy stopped' )
53- } ) ;
57+ server . close ( function ( ) {
58+ mb . tray . setImage ( icons . subdued ) ;
59+ console . log ( 'proxy stopped' )
60+ } ) ;
5461} ) ;
5562
5663let options = {
0 commit comments