Updating presence icons for Windows

This commit is contained in:
sbenmoussati 2023-03-01 19:44:14 +01:00 committed by Salah Benmoussati
parent c1acb81c5b
commit 1f074ce3a1
53 changed files with 66 additions and 60 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 279 KiB

View File

@ -116,43 +116,47 @@ class PresenceStatus {
const isMana = !!windowHandler.isMana;
const contextMenu = Menu.buildFromTemplate([
{
label: i18n.t('My presence')(),
label: i18n.t('Status')(),
visible: isMana,
submenu: [
{
label: i18n.t(EPresenceStatus.AVAILABLE, presenceNamespace)(),
type: 'checkbox',
checked: currentStatus === EPresenceStatus.AVAILABLE,
click: () => {
this.handlePresenceChange(EPresenceStatus.AVAILABLE);
},
},
{
label: i18n.t(EPresenceStatus.BUSY, presenceNamespace)(),
type: 'checkbox',
checked: currentStatus === EPresenceStatus.BUSY,
click: () => {
this.handlePresenceChange(EPresenceStatus.BUSY);
},
},
{
label: i18n.t(EPresenceStatus.BE_RIGHT_BACK, presenceNamespace)(),
type: 'checkbox',
checked: currentStatus === EPresenceStatus.BE_RIGHT_BACK,
click: () => {
this.handlePresenceChange(EPresenceStatus.BE_RIGHT_BACK);
},
},
{
label: i18n.t(EPresenceStatus.OUT_OF_OFFICE, presenceNamespace)(),
type: 'checkbox',
checked: currentStatus === EPresenceStatus.OUT_OF_OFFICE,
click: () => {
this.handlePresenceChange(EPresenceStatus.OUT_OF_OFFICE);
},
},
],
enabled: false,
},
{
label: i18n.t(EPresenceStatus.AVAILABLE, presenceNamespace)(),
type: 'checkbox',
visible: isMana,
checked: currentStatus === EPresenceStatus.AVAILABLE,
click: () => {
this.handlePresenceChange(EPresenceStatus.AVAILABLE);
},
},
{
label: i18n.t(EPresenceStatus.BUSY, presenceNamespace)(),
type: 'checkbox',
visible: isMana,
checked: currentStatus === EPresenceStatus.BUSY,
click: () => {
this.handlePresenceChange(EPresenceStatus.BUSY);
},
},
{
label: i18n.t(EPresenceStatus.BE_RIGHT_BACK, presenceNamespace)(),
type: 'checkbox',
visible: isMana,
checked: currentStatus === EPresenceStatus.BE_RIGHT_BACK,
click: () => {
this.handlePresenceChange(EPresenceStatus.BE_RIGHT_BACK);
},
},
{
label: i18n.t(EPresenceStatus.OUT_OF_OFFICE, presenceNamespace)(),
type: 'checkbox',
visible: isMana,
checked: currentStatus === EPresenceStatus.OUT_OF_OFFICE,
click: () => {
this.handlePresenceChange(EPresenceStatus.OUT_OF_OFFICE);
},
},
{ type: 'separator', visible: isMana },
{
label: i18n.t('Quit Symphony')(),
click: () => app.quit(),

View File

@ -51,45 +51,45 @@ export class PresenceStatus {
const os = isWindowsOS ? 'windows' : isMac ? 'macOS' : 'linux';
const theme = nativeTheme.shouldUseDarkColors ? 'light' : 'dark';
const assetsPath = `src/renderer/assets/presence-status/${os}/${theme}`;
let fileExtension = 'png';
let iconPlace = '';
switch (place) {
case 'tray':
iconPlace = '-tray';
fileExtension = isWindowsOS ? 'ico' : isMac ? 'png' : 'png';
break;
case 'thumbnail':
iconPlace = '-thumbnail';
fileExtension = 'ico';
break;
default:
break;
}
switch (status) {
case EPresenceStatus.AVAILABLE:
backgroundImage = `../../../${assetsPath}/${
place === 'tray' ? 'online-tray.png' : 'online.png'
}`;
backgroundImage = `../../../${assetsPath}/${`available${iconPlace}.${fileExtension}`}`;
break;
case EPresenceStatus.BUSY:
backgroundImage = `../../../${assetsPath}/${
place === 'tray' ? 'busy-tray.png' : 'busy.png'
}`;
backgroundImage = `../../../${assetsPath}/busy${iconPlace}.${fileExtension}`;
break;
case EPresenceStatus.BE_RIGHT_BACK || EPresenceStatus.AWAY:
backgroundImage = `../../../${assetsPath}/${
place === 'tray' ? 'brb-tray.png' : 'brb.png'
}`;
backgroundImage = `../../../${assetsPath}/brb${iconPlace}.${fileExtension}`;
break;
case EPresenceStatus.OFFLINE:
backgroundImage = `../../../${assetsPath}/${
place === 'tray' ? 'offline-tray.png' : 'offline.png'
}`;
backgroundImage = `../../../${assetsPath}/offline${iconPlace}.${fileExtension}`;
break;
case EPresenceStatus.OUT_OF_OFFICE:
backgroundImage = `../../../${assetsPath}/${
place === 'tray' ? 'out-of-office-tray.png' : 'out-of-office.png'
}`;
backgroundImage = `../../../${assetsPath}/out-of-office${iconPlace}.${fileExtension}`;
break;
case EPresenceStatus.IN_A_MEETING:
backgroundImage = `../../../${assetsPath}/${
place === 'tray' ? 'in-a-meeting-tray.png' : 'in-a-meeting.png'
}`;
backgroundImage = `../../../${assetsPath}/in-a-meeting${iconPlace}.${fileExtension}`;
break;
case EPresenceStatus.NO_PRESENCE:
backgroundImage =
place === 'tray' ? `../../../${assetsPath}/no-status-tray.png` : '';
backgroundImage = `../../../${assetsPath}/no-status${iconPlace}.${fileExtension}`;
break;
default:
break;

View File

@ -9,6 +9,7 @@ import {
dialog,
Event,
ipcMain,
nativeImage,
nativeTheme,
RenderProcessGoneDetails,
screen,

View File

@ -304,14 +304,15 @@ export const showBadgeCount = (count: number): void => {
* Creates sys tray
*/
export const initSysTray = () => {
const defaultSysTrayIcon = 'no-status-tray.png';
const defaultSysTrayIcon = 'no-status-tray';
const defaultSysTrayIconExtension = isWindowsOS ? 'ico' : 'png';
const os = isWindowsOS ? 'windows' : isMac ? 'macOS' : 'linux';
const theme = nativeTheme.shouldUseDarkColors ? 'light' : 'dark';
logger.info('theme: ', theme, nativeTheme.themeSource);
const assetsPath = `renderer/assets/presence-status/${os}/${theme}`;
const defaultSysTrayIconPath = path.join(
__dirname,
`../${assetsPath}/${defaultSysTrayIcon}`,
`../${assetsPath}/${defaultSysTrayIcon}.${defaultSysTrayIconExtension}`,
);
const backgroundImage = nativeImage.createFromPath(defaultSysTrayIconPath);
const tray = new Tray(backgroundImage);

View File

@ -251,5 +251,5 @@
"OUT_OF_OFFICE": "Out of office",
"BE_RIGHT_BACK": "Be right back"
},
"My presence": "My presence"
"Status": "Status"
}

View File

@ -251,5 +251,5 @@
"OUT_OF_OFFICE": "Out of office",
"BE_RIGHT_BACK": "Be right back"
},
"My presence": "My presence"
"Status": "Status"
}

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

View File

Before

Width:  |  Height:  |  Size: 527 B

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

View File

Before

Width:  |  Height:  |  Size: 527 B

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB