new icon & resource handling
@@ -1,4 +1,3 @@
|
|||||||
import { defaultWindowIcon } from '@tauri-apps/api/app'
|
|
||||||
import { Menu } from '@tauri-apps/api/menu'
|
import { Menu } from '@tauri-apps/api/menu'
|
||||||
import { MenuItem } from '@tauri-apps/api/menu'
|
import { MenuItem } from '@tauri-apps/api/menu'
|
||||||
import { resolveResource } from '@tauri-apps/api/path'
|
import { resolveResource } from '@tauri-apps/api/path'
|
||||||
@@ -72,7 +71,7 @@ export async function initTray(): Promise<void> {
|
|||||||
|
|
||||||
await TrayIcon.new({
|
await TrayIcon.new({
|
||||||
id: 'main-tray',
|
id: 'main-tray',
|
||||||
icon: (await defaultWindowIcon())!,
|
icon: (await resolveResource('icons/favicon/icon.png'))!,
|
||||||
tooltip: 'Rclone',
|
tooltip: 'Rclone',
|
||||||
menu,
|
menu,
|
||||||
menuOnLeftClick: true,
|
menuOnLeftClick: true,
|
||||||
@@ -85,7 +84,7 @@ export async function initTray(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function initLoadingTray() {
|
export async function initLoadingTray() {
|
||||||
const iconPath = await resolveResource('icons/favicon/frame_00_delay-0.1s.png')
|
const globeIconPath = await resolveResource('icons/favicon/frame_00_delay-0.1s.png')
|
||||||
|
|
||||||
const quitItem = await MenuItem.new({
|
const quitItem = await MenuItem.new({
|
||||||
id: 'quit-loading',
|
id: 'quit-loading',
|
||||||
@@ -106,7 +105,7 @@ export async function initLoadingTray() {
|
|||||||
|
|
||||||
const loadingTray = await TrayIcon.new({
|
const loadingTray = await TrayIcon.new({
|
||||||
id: 'loading-tray',
|
id: 'loading-tray',
|
||||||
icon: iconPath,
|
icon: globeIconPath,
|
||||||
menu: loadingMenu,
|
menu: loadingMenu,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -116,10 +115,10 @@ export async function initLoadingTray() {
|
|||||||
if (currentIcon > 17) {
|
if (currentIcon > 17) {
|
||||||
currentIcon = 1
|
currentIcon = 1
|
||||||
}
|
}
|
||||||
const iconPath = await resolveResource(
|
const globeIconPath = await resolveResource(
|
||||||
`icons/favicon/frame_${currentIcon < 10 ? '0' : ''}${currentIcon}_delay-0.1s.png`
|
`icons/favicon/frame_${currentIcon < 10 ? '0' : ''}${currentIcon}_delay-0.1s.png`
|
||||||
)
|
)
|
||||||
await loadingTray?.setIcon(iconPath)
|
await loadingTray?.setIcon(globeIconPath)
|
||||||
currentIcon = currentIcon + 1
|
currentIcon = currentIcon + 1
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 96 KiB |
@@ -41,6 +41,7 @@
|
|||||||
"icons/icon.ico"
|
"icons/icon.ico"
|
||||||
],
|
],
|
||||||
"resources": [
|
"resources": [
|
||||||
|
"icons/favicon/icon.png",
|
||||||
"icons/favicon/frame_00_delay-0.1s.png",
|
"icons/favicon/frame_00_delay-0.1s.png",
|
||||||
"icons/favicon/frame_01_delay-0.1s.png",
|
"icons/favicon/frame_01_delay-0.1s.png",
|
||||||
"icons/favicon/frame_02_delay-0.1s.png",
|
"icons/favicon/frame_02_delay-0.1s.png",
|
||||||
|
|||||||