a simple web player for subsonic tinysub.devins.page
subsonic navidrome javascript
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: tauri tray icon

and no tray on macos, just close to dock icon

+116 -398
+33 -386
src-tauri/Cargo.lock
··· 9 9 checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 10 10 11 11 [[package]] 12 - name = "ahash" 13 - version = "0.7.8" 14 - source = "registry+https://github.com/rust-lang/crates.io-index" 15 - checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" 16 - dependencies = [ 17 - "getrandom 0.2.17", 18 - "once_cell", 19 - "version_check", 20 - ] 21 - 22 - [[package]] 23 12 name = "aho-corasick" 24 13 version = "1.1.4" 25 14 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 44 33 ] 45 34 46 35 [[package]] 47 - name = "android_log-sys" 48 - version = "0.3.2" 49 - source = "registry+https://github.com/rust-lang/crates.io-index" 50 - checksum = "84521a3cf562bc62942e294181d9eef17eb38ceb8c68677bc49f144e4c3d4f8d" 51 - 52 - [[package]] 53 - name = "android_logger" 54 - version = "0.15.1" 55 - source = "registry+https://github.com/rust-lang/crates.io-index" 56 - checksum = "dbb4e440d04be07da1f1bf44fb4495ebd58669372fe0cffa6e48595ac5bd88a3" 57 - dependencies = [ 58 - "android_log-sys", 59 - "env_filter", 60 - "log", 61 - ] 62 - 63 - [[package]] 64 36 name = "android_system_properties" 65 37 version = "0.1.5" 66 38 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 74 46 version = "1.0.102" 75 47 source = "registry+https://github.com/rust-lang/crates.io-index" 76 48 checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" 77 - 78 - [[package]] 79 - name = "arrayvec" 80 - version = "0.7.6" 81 - source = "registry+https://github.com/rust-lang/crates.io-index" 82 - checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" 83 49 84 50 [[package]] 85 51 name = "ascii" ··· 165 131 ] 166 132 167 133 [[package]] 168 - name = "bitvec" 169 - version = "1.0.1" 170 - source = "registry+https://github.com/rust-lang/crates.io-index" 171 - checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 172 - dependencies = [ 173 - "funty", 174 - "radium", 175 - "tap", 176 - "wyz", 177 - ] 178 - 179 - [[package]] 180 134 name = "block-buffer" 181 135 version = "0.10.4" 182 136 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 195 149 ] 196 150 197 151 [[package]] 198 - name = "borsh" 199 - version = "1.6.1" 200 - source = "registry+https://github.com/rust-lang/crates.io-index" 201 - checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" 202 - dependencies = [ 203 - "borsh-derive", 204 - "bytes", 205 - "cfg_aliases", 206 - ] 207 - 208 - [[package]] 209 - name = "borsh-derive" 210 - version = "1.6.1" 211 - source = "registry+https://github.com/rust-lang/crates.io-index" 212 - checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" 213 - dependencies = [ 214 - "once_cell", 215 - "proc-macro-crate 3.5.0", 216 - "proc-macro2", 217 - "quote", 218 - "syn 2.0.117", 219 - ] 220 - 221 - [[package]] 222 152 name = "brotli" 223 153 version = "8.0.2" 224 154 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 246 176 checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" 247 177 248 178 [[package]] 249 - name = "byte-unit" 250 - version = "5.2.0" 251 - source = "registry+https://github.com/rust-lang/crates.io-index" 252 - checksum = "8c6d47a4e2961fb8721bcfc54feae6455f2f64e7054f9bc67e875f0e77f4c58d" 253 - dependencies = [ 254 - "rust_decimal", 255 - "schemars 1.2.1", 256 - "serde", 257 - "utf8-width", 258 - ] 259 - 260 - [[package]] 261 - name = "bytecheck" 262 - version = "0.6.12" 263 - source = "registry+https://github.com/rust-lang/crates.io-index" 264 - checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" 265 - dependencies = [ 266 - "bytecheck_derive", 267 - "ptr_meta", 268 - "simdutf8", 269 - ] 270 - 271 - [[package]] 272 - name = "bytecheck_derive" 273 - version = "0.6.12" 274 - source = "registry+https://github.com/rust-lang/crates.io-index" 275 - checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" 276 - dependencies = [ 277 - "proc-macro2", 278 - "quote", 279 - "syn 1.0.109", 280 - ] 281 - 282 - [[package]] 283 179 name = "bytemuck" 284 180 version = "1.25.0" 285 181 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 292 188 checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 293 189 294 190 [[package]] 191 + name = "byteorder-lite" 192 + version = "0.1.0" 193 + source = "registry+https://github.com/rust-lang/crates.io-index" 194 + checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" 195 + 196 + [[package]] 295 197 name = "bytes" 296 198 version = "1.11.1" 297 199 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 409 311 version = "1.0.4" 410 312 source = "registry+https://github.com/rust-lang/crates.io-index" 411 313 checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 412 - 413 - [[package]] 414 - name = "cfg_aliases" 415 - version = "0.2.1" 416 - source = "registry+https://github.com/rust-lang/crates.io-index" 417 - checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 418 314 419 315 [[package]] 420 316 name = "chrono" ··· 816 712 checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" 817 713 818 714 [[package]] 819 - name = "env_filter" 820 - version = "0.1.4" 821 - source = "registry+https://github.com/rust-lang/crates.io-index" 822 - checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" 823 - dependencies = [ 824 - "log", 825 - "regex", 826 - ] 827 - 828 - [[package]] 829 715 name = "equivalent" 830 716 version = "1.0.2" 831 717 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 858 744 ] 859 745 860 746 [[package]] 861 - name = "fern" 862 - version = "0.7.1" 863 - source = "registry+https://github.com/rust-lang/crates.io-index" 864 - checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" 865 - dependencies = [ 866 - "log", 867 - ] 868 - 869 - [[package]] 870 747 name = "field-offset" 871 748 version = "0.3.6" 872 749 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 947 824 ] 948 825 949 826 [[package]] 950 - name = "funty" 951 - version = "2.0.0" 952 - source = "registry+https://github.com/rust-lang/crates.io-index" 953 - checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 954 - 955 - [[package]] 956 827 name = "futures-channel" 957 828 version = "0.3.32" 958 829 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1321 1192 version = "0.12.3" 1322 1193 source = "registry+https://github.com/rust-lang/crates.io-index" 1323 1194 checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 1324 - dependencies = [ 1325 - "ahash", 1326 - ] 1327 1195 1328 1196 [[package]] 1329 1197 name = "hashbrown" ··· 1606 1474 ] 1607 1475 1608 1476 [[package]] 1477 + name = "image" 1478 + version = "0.25.10" 1479 + source = "registry+https://github.com/rust-lang/crates.io-index" 1480 + checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" 1481 + dependencies = [ 1482 + "bytemuck", 1483 + "byteorder-lite", 1484 + "moxcms", 1485 + "num-traits", 1486 + "png 0.18.1", 1487 + ] 1488 + 1489 + [[package]] 1609 1490 name = "indexmap" 1610 1491 version = "1.9.3" 1611 1492 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1845 1726 version = "0.4.29" 1846 1727 source = "registry+https://github.com/rust-lang/crates.io-index" 1847 1728 checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 1848 - dependencies = [ 1849 - "value-bag", 1850 - ] 1851 1729 1852 1730 [[package]] 1853 1731 name = "markup5ever" ··· 1900 1778 "libc", 1901 1779 "wasi", 1902 1780 "windows-sys 0.61.2", 1781 + ] 1782 + 1783 + [[package]] 1784 + name = "moxcms" 1785 + version = "0.8.1" 1786 + source = "registry+https://github.com/rust-lang/crates.io-index" 1787 + checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" 1788 + dependencies = [ 1789 + "num-traits", 1790 + "pxfm", 1903 1791 ] 1904 1792 1905 1793 [[package]] ··· 1988 1876 "proc-macro2", 1989 1877 "quote", 1990 1878 "syn 2.0.117", 1991 - ] 1992 - 1993 - [[package]] 1994 - name = "num_threads" 1995 - version = "0.1.7" 1996 - source = "registry+https://github.com/rust-lang/crates.io-index" 1997 - checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" 1998 - dependencies = [ 1999 - "libc", 2000 1879 ] 2001 1880 2002 1881 [[package]] ··· 2380 2259 checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 2381 2260 2382 2261 [[package]] 2383 - name = "ppv-lite86" 2384 - version = "0.2.21" 2385 - source = "registry+https://github.com/rust-lang/crates.io-index" 2386 - checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" 2387 - dependencies = [ 2388 - "zerocopy", 2389 - ] 2390 - 2391 - [[package]] 2392 2262 name = "precomputed-hash" 2393 2263 version = "0.1.1" 2394 2264 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2467 2337 ] 2468 2338 2469 2339 [[package]] 2470 - name = "ptr_meta" 2471 - version = "0.1.4" 2472 - source = "registry+https://github.com/rust-lang/crates.io-index" 2473 - checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" 2474 - dependencies = [ 2475 - "ptr_meta_derive", 2476 - ] 2477 - 2478 - [[package]] 2479 - name = "ptr_meta_derive" 2480 - version = "0.1.4" 2340 + name = "pxfm" 2341 + version = "0.1.29" 2481 2342 source = "registry+https://github.com/rust-lang/crates.io-index" 2482 - checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" 2483 - dependencies = [ 2484 - "proc-macro2", 2485 - "quote", 2486 - "syn 1.0.109", 2487 - ] 2343 + checksum = "e0c5ccf5294c6ccd63a74f1565028353830a9c2f5eb0c682c355c471726a6e3f" 2488 2344 2489 2345 [[package]] 2490 2346 name = "quick-xml" ··· 2517 2373 checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" 2518 2374 2519 2375 [[package]] 2520 - name = "radium" 2521 - version = "0.7.0" 2522 - source = "registry+https://github.com/rust-lang/crates.io-index" 2523 - checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 2524 - 2525 - [[package]] 2526 - name = "rand" 2527 - version = "0.8.6" 2528 - source = "registry+https://github.com/rust-lang/crates.io-index" 2529 - checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" 2530 - dependencies = [ 2531 - "libc", 2532 - "rand_chacha", 2533 - "rand_core", 2534 - ] 2535 - 2536 - [[package]] 2537 - name = "rand_chacha" 2538 - version = "0.3.1" 2539 - source = "registry+https://github.com/rust-lang/crates.io-index" 2540 - checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 2541 - dependencies = [ 2542 - "ppv-lite86", 2543 - "rand_core", 2544 - ] 2545 - 2546 - [[package]] 2547 - name = "rand_core" 2548 - version = "0.6.4" 2549 - source = "registry+https://github.com/rust-lang/crates.io-index" 2550 - checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 2551 - dependencies = [ 2552 - "getrandom 0.2.17", 2553 - ] 2554 - 2555 - [[package]] 2556 2376 name = "raw-window-handle" 2557 2377 version = "0.6.2" 2558 2378 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2628 2448 checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" 2629 2449 2630 2450 [[package]] 2631 - name = "rend" 2632 - version = "0.4.2" 2633 - source = "registry+https://github.com/rust-lang/crates.io-index" 2634 - checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" 2635 - dependencies = [ 2636 - "bytecheck", 2637 - ] 2638 - 2639 - [[package]] 2640 2451 name = "reqwest" 2641 2452 version = "0.13.3" 2642 2453 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2671 2482 ] 2672 2483 2673 2484 [[package]] 2674 - name = "rkyv" 2675 - version = "0.7.46" 2676 - source = "registry+https://github.com/rust-lang/crates.io-index" 2677 - checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" 2678 - dependencies = [ 2679 - "bitvec", 2680 - "bytecheck", 2681 - "bytes", 2682 - "hashbrown 0.12.3", 2683 - "ptr_meta", 2684 - "rend", 2685 - "rkyv_derive", 2686 - "seahash", 2687 - "tinyvec", 2688 - "uuid", 2689 - ] 2690 - 2691 - [[package]] 2692 - name = "rkyv_derive" 2693 - version = "0.7.46" 2694 - source = "registry+https://github.com/rust-lang/crates.io-index" 2695 - checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" 2696 - dependencies = [ 2697 - "proc-macro2", 2698 - "quote", 2699 - "syn 1.0.109", 2700 - ] 2701 - 2702 - [[package]] 2703 - name = "rust_decimal" 2704 - version = "1.42.0" 2705 - source = "registry+https://github.com/rust-lang/crates.io-index" 2706 - checksum = "0c5108e3d4d903e21aac27f12ba5377b6b34f9f44b325e4894c7924169d06995" 2707 - dependencies = [ 2708 - "arrayvec", 2709 - "borsh", 2710 - "bytes", 2711 - "num-traits", 2712 - "rand", 2713 - "rkyv", 2714 - "serde", 2715 - "serde_json", 2716 - "wasm-bindgen", 2717 - ] 2718 - 2719 - [[package]] 2720 2485 name = "rustc-hash" 2721 2486 version = "2.1.2" 2722 2487 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2804 2569 checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 2805 2570 2806 2571 [[package]] 2807 - name = "seahash" 2808 - version = "4.1.0" 2809 - source = "registry+https://github.com/rust-lang/crates.io-index" 2810 - checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" 2811 - 2812 - [[package]] 2813 2572 name = "selectors" 2814 2573 version = "0.36.1" 2815 2574 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3019 2778 checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" 3020 2779 3021 2780 [[package]] 3022 - name = "simdutf8" 3023 - version = "0.1.5" 3024 - source = "registry+https://github.com/rust-lang/crates.io-index" 3025 - checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" 3026 - 3027 - [[package]] 3028 2781 name = "siphasher" 3029 2782 version = "1.0.3" 3030 2783 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3154 2907 checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 3155 2908 dependencies = [ 3156 2909 "proc-macro2", 3157 - "quote", 3158 2910 "unicode-ident", 3159 2911 ] 3160 2912 ··· 3254 3006 ] 3255 3007 3256 3008 [[package]] 3257 - name = "tap" 3258 - version = "1.0.1" 3259 - source = "registry+https://github.com/rust-lang/crates.io-index" 3260 - checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 3261 - 3262 - [[package]] 3263 3009 name = "target-lexicon" 3264 3010 version = "0.12.16" 3265 3011 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3282 3028 "gtk", 3283 3029 "heck 0.5.0", 3284 3030 "http", 3031 + "image", 3285 3032 "jni", 3286 3033 "libc", 3287 3034 "log", ··· 3379 3126 ] 3380 3127 3381 3128 [[package]] 3382 - name = "tauri-plugin" 3383 - version = "2.6.1" 3384 - source = "registry+https://github.com/rust-lang/crates.io-index" 3385 - checksum = "eefb2c18e8a605c23edb48fc56bb77381199e1a1e7f6ff0c9b970afe7b3cb8ee" 3386 - dependencies = [ 3387 - "anyhow", 3388 - "glob", 3389 - "plist", 3390 - "schemars 0.8.22", 3391 - "serde", 3392 - "serde_json", 3393 - "tauri-utils", 3394 - "walkdir", 3395 - ] 3396 - 3397 - [[package]] 3398 3129 name = "tauri-plugin-localhost" 3399 3130 version = "2.3.2" 3400 3131 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3410 3141 ] 3411 3142 3412 3143 [[package]] 3413 - name = "tauri-plugin-log" 3414 - version = "2.8.0" 3415 - source = "registry+https://github.com/rust-lang/crates.io-index" 3416 - checksum = "7545bd67f070a4500432c826e2e0682146a1d6712aee22a2786490156b574d93" 3417 - dependencies = [ 3418 - "android_logger", 3419 - "byte-unit", 3420 - "fern", 3421 - "log", 3422 - "objc2", 3423 - "objc2-foundation", 3424 - "serde", 3425 - "serde_json", 3426 - "serde_repr", 3427 - "swift-rs", 3428 - "tauri", 3429 - "tauri-plugin", 3430 - "thiserror 2.0.18", 3431 - "time", 3432 - ] 3433 - 3434 - [[package]] 3435 3144 name = "tauri-runtime" 3436 3145 version = "2.11.1" 3437 3146 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3589 3298 dependencies = [ 3590 3299 "deranged", 3591 3300 "itoa", 3592 - "libc", 3593 3301 "num-conv", 3594 - "num_threads", 3595 3302 "powerfmt", 3596 3303 "serde_core", 3597 3304 "time-core", ··· 3640 3347 name = "tinysub" 3641 3348 version = "2.7.6" 3642 3349 dependencies = [ 3643 - "log", 3644 - "serde", 3645 - "serde_json", 3646 3350 "tauri", 3647 3351 "tauri-build", 3648 3352 "tauri-plugin-localhost", 3649 - "tauri-plugin-log", 3650 3353 ] 3651 3354 3652 3355 [[package]] 3653 - name = "tinyvec" 3654 - version = "1.11.0" 3655 - source = "registry+https://github.com/rust-lang/crates.io-index" 3656 - checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" 3657 - dependencies = [ 3658 - "tinyvec_macros", 3659 - ] 3660 - 3661 - [[package]] 3662 - name = "tinyvec_macros" 3663 - version = "0.1.1" 3664 - source = "registry+https://github.com/rust-lang/crates.io-index" 3665 - checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 3666 - 3667 - [[package]] 3668 3356 name = "tokio" 3669 3357 version = "1.52.3" 3670 3358 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4006 3694 checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" 4007 3695 4008 3696 [[package]] 4009 - name = "utf8-width" 4010 - version = "0.1.8" 4011 - source = "registry+https://github.com/rust-lang/crates.io-index" 4012 - checksum = "1292c0d970b54115d14f2492fe0170adf21d68a1de108eebc51c1df4f346a091" 4013 - 4014 - [[package]] 4015 3697 name = "utf8_iter" 4016 3698 version = "1.0.4" 4017 3699 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4028 3710 "serde_core", 4029 3711 "wasm-bindgen", 4030 3712 ] 4031 - 4032 - [[package]] 4033 - name = "value-bag" 4034 - version = "1.12.0" 4035 - source = "registry+https://github.com/rust-lang/crates.io-index" 4036 - checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" 4037 3713 4038 3714 [[package]] 4039 3715 name = "version-compare" ··· 4844 4520 ] 4845 4521 4846 4522 [[package]] 4847 - name = "wyz" 4848 - version = "0.5.1" 4849 - source = "registry+https://github.com/rust-lang/crates.io-index" 4850 - checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 4851 - dependencies = [ 4852 - "tap", 4853 - ] 4854 - 4855 - [[package]] 4856 4523 name = "x11" 4857 4524 version = "2.21.0" 4858 4525 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4894 4561 "quote", 4895 4562 "syn 2.0.117", 4896 4563 "synstructure", 4897 - ] 4898 - 4899 - [[package]] 4900 - name = "zerocopy" 4901 - version = "0.8.48" 4902 - source = "registry+https://github.com/rust-lang/crates.io-index" 4903 - checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" 4904 - dependencies = [ 4905 - "zerocopy-derive", 4906 - ] 4907 - 4908 - [[package]] 4909 - name = "zerocopy-derive" 4910 - version = "0.8.48" 4911 - source = "registry+https://github.com/rust-lang/crates.io-index" 4912 - checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" 4913 - dependencies = [ 4914 - "proc-macro2", 4915 - "quote", 4916 - "syn 2.0.117", 4917 4564 ] 4918 4565 4919 4566 [[package]]
+1 -5
src-tauri/Cargo.toml
··· 16 16 tauri-build = { version = "2.6.1", features = [] } 17 17 18 18 [dependencies] 19 - serde_json = "1.0" 20 - serde = { version = "1.0", features = ["derive"] } 21 - log = "0.4" 22 - tauri = { version = "2.11.1", features = [] } 23 - tauri-plugin-log = "2" 19 + tauri = { version = "2.11.1", features = ["tray-icon", "image-png"] } 24 20 tauri-plugin-localhost = "2" 25 21 26 22 [profile.dev]
+82 -7
src-tauri/src/lib.rs
··· 1 - use tauri::{webview::WebviewWindowBuilder, WebviewUrl}; 1 + use tauri::{webview::WebviewWindowBuilder, Manager, WebviewUrl}; 2 + 3 + #[cfg(not(target_os = "macos"))] 4 + use tauri::{ 5 + menu::{Menu, MenuItem}, 6 + tray::TrayIconBuilder, 7 + }; 2 8 3 9 pub fn run() { 4 10 let port: u16 = 5173; 5 - tauri::Builder::default() 11 + let builder = tauri::Builder::default() 6 12 .plugin(tauri_plugin_localhost::Builder::new(port).build()) 7 13 .setup(move |app| { 8 14 let url = format!("http://localhost:{}", port).parse().unwrap(); 15 + let window = 9 16 WebviewWindowBuilder::new(app, "main".to_string(), WebviewUrl::External(url)) 10 17 .title("tinysub") 11 18 .inner_size(800.0, 600.0) 12 19 .disable_drag_drop_handler() // required for dragging stuff 13 20 .build()?; 14 - Ok(()) 15 - }) 16 - .run(tauri::generate_context!()) 17 - .expect("error while running tauri application"); 18 - } 21 + 22 + // prevent window from closing, hide instead 23 + let window_clone = window.clone(); 24 + window.on_window_event(move |event| { 25 + if let tauri::WindowEvent::CloseRequested { api, .. } = event { 26 + api.prevent_close(); 27 + let _ = window_clone.hide(); 28 + } 29 + }); 30 + 31 + // dont set up tray on macos since the app is in dock 32 + #[cfg(not(target_os = "macos"))] 33 + { 34 + let show_main_window = |app: &tauri::AppHandle| { 35 + if let Some(window) = app.get_webview_window("main") { 36 + let _ = window.show(); 37 + let _ = window.set_focus(); 38 + } 39 + }; 40 + 41 + let menu = Menu::with_items( 42 + app, 43 + &[ 44 + &MenuItem::with_id(app, "show", "Show", true, None::<&str>)?, 45 + &MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?, 46 + ], 47 + )?; 48 + 49 + let tray_icon = 50 + tauri::image::Image::from_bytes(include_bytes!("../icons/32x32.png"))?; 51 + 52 + let _tray = TrayIconBuilder::new() 53 + .icon(tray_icon) 54 + .menu(&menu) 55 + .on_menu_event(move |app, event| match event.id.as_ref() { 56 + "quit" => app.exit(0), 57 + "show" => show_main_window(app), 58 + _ => {} 59 + }) 60 + .on_tray_icon_event(move |tray, event| { 61 + if let tauri::tray::TrayIconEvent::Click { 62 + button: tauri::tray::MouseButton::Left, 63 + .. 64 + } = event 65 + { 66 + show_main_window(tray.app_handle()); 67 + } 68 + }) 69 + .build(app)?; 70 + } 71 + 72 + Ok(()) 73 + }); 74 + 75 + builder 76 + .build(tauri::generate_context!()) 77 + .expect("error while building tauri application") 78 + .run(|app_handle, event| match event { 79 + #[cfg(target_os = "macos")] 80 + tauri::RunEvent::Reopen { 81 + has_visible_windows, 82 + .. 83 + } => { 84 + if !has_visible_windows { 85 + if let Some(window) = app_handle.get_webview_window("main") { 86 + let _ = window.show(); 87 + let _ = window.set_focus(); 88 + } 89 + } 90 + } 91 + _ => {} 92 + }); 93 + }