-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tray sync indicator, minimize to tray, start minimized, local o…
…ptions saving, bump deps, misc
- Loading branch information
Showing
12 changed files
with
459 additions
and
337 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@filen/desktop", | ||
"version": "3.0.34", | ||
"buildNumber": 334, | ||
"version": "3.0.35", | ||
"buildNumber": 335, | ||
"description": "Filen Desktop Client", | ||
"author": "Filen Cloud Dienste UG (haftungsbeschränkt) <[email protected]>", | ||
"main": "dist/index.js", | ||
|
@@ -65,12 +65,12 @@ | |
"yaml": "^2.6.0" | ||
}, | ||
"dependencies": { | ||
"@filen/network-drive": "^0.9.35", | ||
"@filen/s3": "^0.2.45", | ||
"@filen/sdk": "^0.1.183", | ||
"@filen/network-drive": "^0.9.36", | ||
"@filen/s3": "^0.2.46", | ||
"@filen/sdk": "^0.1.187", | ||
"@filen/sync": "^0.1.84", | ||
"@filen/web": "^0.1.67", | ||
"@filen/webdav": "^0.2.60", | ||
"@filen/web": "^0.1.71", | ||
"@filen/webdav": "^0.2.61", | ||
"axios": "^0.28.1", | ||
"cors": "^2.8.5", | ||
"electron-updater": "^6.4.0-alpha.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,64 @@ | ||
import { nativeImage } from "electron" | ||
import { nativeImage, type NativeImage } from "electron" | ||
import pathModule from "path" | ||
import memoize from "lodash/memoize" | ||
|
||
export const getAppIcon = memoize(() => { | ||
return nativeImage.createFromPath( | ||
pathModule.join( | ||
__dirname, | ||
"..", | ||
"..", | ||
"assets", | ||
"icons", | ||
"app", | ||
`${process.platform}.${process.platform === "win32" ? "ico" : process.platform === "darwin" ? "icns" : "png"}` | ||
) | ||
import { type TrayState } from "../types" | ||
|
||
export const OVERLAY_ICON = nativeImage.createFromPath(pathModule.join(__dirname, "..", "..", "assets", "icons", "app", "overlay", "0.png")) | ||
|
||
export const APP_ICON = nativeImage.createFromPath( | ||
pathModule.join( | ||
__dirname, | ||
"..", | ||
"..", | ||
"assets", | ||
"icons", | ||
"app", | ||
`${process.platform}.${process.platform === "win32" ? "ico" : process.platform === "darwin" ? "icns" : "png"}` | ||
) | ||
}) | ||
|
||
export const getTrayIcon = memoize((notification: boolean) => { | ||
/*return nativeImage.createFromPath( | ||
pathModule.join( | ||
__dirname, | ||
"..", | ||
"..", | ||
"assets", | ||
"icons", | ||
"tray", | ||
nativeTheme.shouldUseDarkColors ? "light" : "dark", | ||
`${process.platform}${notification ? "Notification" : ""}${process.platform === "darwin" ? "Template" : ""}.${ | ||
process.platform === "win32" ? "ico" : process.platform === "darwin" ? "png" : "png" | ||
}` | ||
) | ||
)*/ | ||
|
||
return nativeImage | ||
.createFromPath( | ||
pathModule.join(__dirname, "..", "..", "assets", "icons", "tray", `${notification ? "[email protected]" : "[email protected]"}`) | ||
) | ||
.resize({ | ||
width: 16, | ||
height: 16 | ||
}) | ||
}) | ||
) | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export const getOverlayIcon = memoize((notificationCount: number) => { | ||
//const count = notificationCount > 9 ? 99 : notificationCount | ||
export const TRAY_ICON_NORMAL = nativeImage | ||
.createFromPath(pathModule.join(__dirname, "..", "..", "assets", "icons", "tray", "[email protected]")) | ||
.resize({ | ||
width: 16, | ||
height: 16 | ||
}) | ||
|
||
export const TRAY_ICON_SYNC = nativeImage | ||
.createFromPath(pathModule.join(__dirname, "..", "..", "assets", "icons", "tray", "[email protected]")) | ||
.resize({ | ||
width: 16, | ||
height: 16 | ||
}) | ||
|
||
const count = 0 | ||
export const TRAY_ICON_NOTIFICATION = nativeImage | ||
.createFromPath(pathModule.join(__dirname, "..", "..", "assets", "icons", "tray", "[email protected]")) | ||
.resize({ | ||
width: 16, | ||
height: 16 | ||
}) | ||
|
||
return nativeImage.createFromPath(pathModule.join(__dirname, "..", "..", "assets", "icons", "app", "overlay", `${count}.png`)) | ||
}) | ||
export const TRAY_ICON_WARNING = nativeImage | ||
.createFromPath(pathModule.join(__dirname, "..", "..", "assets", "icons", "tray", "[email protected]")) | ||
.resize({ | ||
width: 16, | ||
height: 16 | ||
}) | ||
|
||
export function getAppIcon(): NativeImage { | ||
return APP_ICON | ||
} | ||
|
||
export function getTrayIcon({ notificationCount, isSyncing, warningCount, errorCount }: TrayState): NativeImage { | ||
return notificationCount + errorCount > 0 | ||
? TRAY_ICON_NOTIFICATION | ||
: warningCount > 0 | ||
? TRAY_ICON_WARNING | ||
: isSyncing | ||
? TRAY_ICON_SYNC | ||
: TRAY_ICON_NORMAL | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export function getOverlayIcon(notificationCount: number): NativeImage { | ||
return OVERLAY_ICON | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.