Commit 0130e362 authored by Stavros Sachtouris's avatar Stavros Sachtouris Committed by Giorgos Korfiatis
Browse files

Gray out tray icon when agkyra is inactive

parent 9771ef9d
...@@ -38,9 +38,12 @@ function closeWindows() { ...@@ -38,9 +38,12 @@ function closeWindows() {
} }
// GUI components // GUI components
var tray_icon = {
on: 'static/images/tray.png',
off: 'static/images/tray_off.png'}
var tray = new gui.Tray({ var tray = new gui.Tray({
tooltip: COMMON.MENU.TITLE, tooltip: COMMON.MENU.TITLE,
icon: 'static/images/tray.png', icon: tray_icon.off,
iconsAreTemplates: false iconsAreTemplates: false
}); });
...@@ -217,6 +220,7 @@ window.setInterval(function() { ...@@ -217,6 +220,7 @@ window.setInterval(function() {
check_menu_lang(); check_menu_lang();
var new_progress = COMMON.NOTIFICATION[globals.status.code]; var new_progress = COMMON.NOTIFICATION[globals.status.code];
var new_pause = ''; var new_pause = '';
var tray_icon_off = false;
switch(globals.status.code) { switch(globals.status.code) {
case STATUS['UNINITIALIZED']: case STATUS['UNINITIALIZED']:
case STATUS['INITIALIZING']: case STATUS['INITIALIZING']:
...@@ -224,6 +228,7 @@ window.setInterval(function() { ...@@ -224,6 +228,7 @@ window.setInterval(function() {
notify('info'); notify('info');
deactivate_menu(); deactivate_menu();
new_pause = COMMON.MENU.INACTIVE; new_pause = COMMON.MENU.INACTIVE;
tray_icon_off = true;
break; break;
case STATUS['SYNCING']: case STATUS['SYNCING']:
notify('info'); notify('info');
...@@ -273,6 +278,10 @@ window.setInterval(function() { ...@@ -273,6 +278,10 @@ window.setInterval(function() {
pause_item.label = new_pause; pause_item.label = new_pause;
tray.menu = menu; tray.menu = menu;
} }
if (tray_icon_off && tray.icon !== tray_icon.off)
tray.icon = tray_icon.off;
else if (!(tray_icon_off || tray.icon === tray_icon.on))
tray.icon = tray_icon.on;
get_status(socket); get_status(socket);
}, 1500); }, 1500);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment