diff --git a/Cargo.lock b/Cargo.lock index bbe5941..fce56d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -372,7 +372,7 @@ dependencies = [ "enumflags2", "futures-channel", "futures-util", - "rand 0.9.2", + "rand 0.9.3", "raw-window-handle", "serde", "serde_repr", @@ -390,7 +390,7 @@ dependencies = [ "enumflags2", "futures-channel", "futures-util", - "rand 0.9.2", + "rand 0.9.3", "serde", "serde_repr", "tokio", @@ -965,9 +965,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.59" +version = "1.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7a4d3ec6524d28a329fc53654bbadc9bdd7b0431f5d65f1a56ffb28a1ee5283" +checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" dependencies = [ "find-msvc-tools", "jobserver", @@ -1333,7 +1333,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1354,7 +1354,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "quote", "syn", @@ -1412,7 +1412,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.18.2" -source = "git+https://github.com/pop-os/cosmic-text.git#9a2ab09f06905e91f41d64ac6eee887726e7fd76" +source = "git+https://github.com/pop-os/cosmic-text.git#4d74f795cc771fdcc7ea0f9cacba63fcf036fad6" dependencies = [ "bitflags 2.11.0", "fontdb", @@ -1435,7 +1435,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "almost", "configparser", @@ -2692,9 +2692,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5df2ba84018d80c213569363bdcd0c64e6933c67fe4c1d60ecf822971a3c35e" +checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159" dependencies = [ "color_quant", "weezl", @@ -3080,7 +3080,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.13.1", + "indexmap 2.14.0", "slab", "tokio", "tokio-util", @@ -3138,6 +3138,12 @@ dependencies = [ "foldhash 0.2.0", ] +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + [[package]] name = "hashlink" version = "0.10.0" @@ -3418,7 +3424,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "dnd", "iced_accessibility", @@ -3440,7 +3446,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "accesskit", "accesskit_winit", @@ -3449,7 +3455,7 @@ dependencies = [ [[package]] name = "iced_beacon" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "bincode", "futures", @@ -3464,7 +3470,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "bitflags 2.11.0", "bytes", @@ -3489,7 +3495,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "iced_beacon", "iced_core", @@ -3500,7 +3506,7 @@ dependencies = [ [[package]] name = "iced_devtools" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "iced_debug", "iced_program", @@ -3511,7 +3517,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "futures", "iced_core", @@ -3525,7 +3531,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "bitflags 2.11.0", "bytemuck", @@ -3546,7 +3552,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "iced_graphics", "iced_runtime", @@ -3555,7 +3561,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -3567,7 +3573,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "bytes", "cosmic-client-toolkit", @@ -3583,7 +3589,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "bytemuck", "cosmic-text", @@ -3600,7 +3606,7 @@ dependencies = [ [[package]] name = "iced_video_player" version = "0.6.0" -source = "git+https://github.com/wash2/iced_video_player.git?branch=iced-rebase#7f6b4233a8ba6527290a82979d925242479ceea5" +source = "git+https://github.com/wash2/iced_video_player.git?branch=iced-rebase#8ba65f2b95f9d69f06bfc821a0f4b6c4eac6091d" dependencies = [ "glib", "gstreamer", @@ -3608,6 +3614,7 @@ dependencies = [ "gstreamer-base", "gstreamer-pbutils", "html-escape", + "iced_wgpu", "libcosmic", "log", "thiserror 1.0.69", @@ -3617,7 +3624,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", @@ -3648,7 +3655,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -3667,7 +3674,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "cosmic-client-toolkit", "cursor-icon", @@ -3822,7 +3829,7 @@ dependencies = [ "byteorder-lite", "color_quant", "exr", - "gif 0.14.1", + "gif 0.14.2", "image-webp", "moxcms", "num-traits", @@ -3877,12 +3884,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", + "hashbrown 0.17.0", "serde", "serde_core", ] @@ -4116,9 +4123,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.94" +version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" +checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" dependencies = [ "cfg-if", "futures-util", @@ -4253,7 +4260,7 @@ checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#b963fbfea9a94316dd1a0d99e84a5116cf696853" +source = "git+https://github.com/pop-os/libcosmic#1d7113a2446ef11e57f2782ff3487a4975c6da90" dependencies = [ "apply", "ashpd 0.12.3", @@ -4331,14 +4338,14 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" +checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" dependencies = [ "bitflags 2.11.0", "libc", "plain", - "redox_syscall 0.7.3", + "redox_syscall 0.7.4", ] [[package]] @@ -4455,6 +4462,7 @@ dependencies = [ "derive_more", "dirs", "fastrand", + "fontdb", "gstreamer", "gstreamer-app", "iced_video_player", @@ -4787,7 +4795,7 @@ dependencies = [ "half", "hashbrown 0.16.1", "hexf-parse", - "indexmap 2.13.1", + "indexmap 2.14.0", "libm", "log", "num-traits", @@ -5948,7 +5956,7 @@ dependencies = [ "bytes", "getrandom 0.3.4", "lru-slab", - "rand 0.9.2", + "rand 0.9.3", "ring", "rustc-hash 2.1.2", "rustls", @@ -6018,9 +6026,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "7ec095654a25171c2124e9e3393a930bddbffdc939556c914957a4c3e0a87166" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -6118,7 +6126,7 @@ dependencies = [ "num-traits", "paste", "profiling", - "rand 0.9.2", + "rand 0.9.3", "rand_chacha 0.9.0", "simd_helpers", "thiserror 2.0.18", @@ -6189,9 +6197,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" +checksum = "f450ad9c3b1da563fb6948a8e0fb0fb9269711c9c73d9ea1de5058c79c8d643a" dependencies = [ "bitflags 2.11.0", ] @@ -6323,7 +6331,7 @@ version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9be183ad6a216aa96f33e4c8033b0988b8b3ea6fd2359d19af5bac4643fd8e81" dependencies = [ - "gif 0.14.1", + "gif 0.14.2", "image-webp", "log", "pico-args", @@ -6620,9 +6628,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.103.10" +version = "0.103.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +checksum = "20a6af516fea4b20eccceaf166e8aa666ac996208e8a644ce3ef5aa783bc7cd4" dependencies = [ "aws-lc-rs", "ring", @@ -6858,7 +6866,7 @@ version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ - "indexmap 2.13.1", + "indexmap 2.14.0", "itoa", "memchr", "serde", @@ -6908,7 +6916,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.13.1", + "indexmap 2.14.0", "schemars 0.9.0", "schemars 1.2.1", "serde_core", @@ -7225,7 +7233,7 @@ dependencies = [ "futures-util", "hashbrown 0.15.5", "hashlink", - "indexmap 2.13.1", + "indexmap 2.14.0", "log", "memchr", "once_cell", @@ -8073,9 +8081,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.51.0" +version = "1.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd1c4c0fc4a7ab90fc15ef6daaa3ec3b893f004f915f2392557ed23237820cd" +checksum = "f66bf9585cda4b724d3e78ab34b73fb2bbaba9011b9bfdf69dc836382ea13b8c" dependencies = [ "bytes", "libc", @@ -8160,7 +8168,7 @@ version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" dependencies = [ - "indexmap 2.13.1", + "indexmap 2.14.0", "serde_core", "serde_spanned", "toml_datetime", @@ -8180,11 +8188,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.10+spec-1.1.0" +version = "0.25.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82418ca169e235e6c399a84e395ab6debeb3bc90edc959bf0f48647c6a32d1b" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" dependencies = [ - "indexmap 2.13.1", + "indexmap 2.14.0", "toml_datetime", "toml_parser", "winnow 1.0.1", @@ -8340,7 +8348,7 @@ dependencies = [ "http", "httparse", "log", - "rand 0.9.2", + "rand 0.9.3", "sha1", "thiserror 2.0.18", "utf-8", @@ -8694,9 +8702,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" +checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" dependencies = [ "cfg-if", "once_cell", @@ -8707,9 +8715,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.67" +version = "0.4.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e" +checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" dependencies = [ "js-sys", "wasm-bindgen", @@ -8717,9 +8725,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" +checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8727,9 +8735,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" +checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" dependencies = [ "bumpalo", "proc-macro2", @@ -8740,9 +8748,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.117" +version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" +checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" dependencies = [ "unicode-ident", ] @@ -8764,7 +8772,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", - "indexmap 2.13.1", + "indexmap 2.14.0", "wasm-encoder", "wasmparser", ] @@ -8777,7 +8785,7 @@ checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", - "indexmap 2.13.1", + "indexmap 2.14.0", "semver", ] @@ -8947,9 +8955,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.94" +version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" +checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" dependencies = [ "js-sys", "wasm-bindgen", @@ -9035,7 +9043,7 @@ dependencies = [ "cfg_aliases 0.2.1", "document-features", "hashbrown 0.16.1", - "indexmap 2.13.1", + "indexmap 2.14.0", "log", "naga", "once_cell", @@ -9850,7 +9858,7 @@ dependencies = [ "libredox", "orbclient", "raw-window-handle", - "redox_syscall 0.7.3", + "redox_syscall 0.7.4", "smol_str", "tracing", "winit-core", @@ -10018,7 +10026,7 @@ checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", "heck 0.5.0", - "indexmap 2.13.1", + "indexmap 2.14.0", "prettyplease", "syn", "wasm-metadata", @@ -10049,7 +10057,7 @@ checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", "bitflags 2.11.0", - "indexmap 2.13.1", + "indexmap 2.14.0", "log", "serde", "serde_derive", @@ -10068,7 +10076,7 @@ checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", - "indexmap 2.13.1", + "indexmap 2.14.0", "log", "semver", "serde", diff --git a/Cargo.toml b/Cargo.toml index 642f13a..5e38d19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,7 @@ itertools = "0.14.0" serde_json = "1.0.149" nom = "8.0.0" tokio-stream = "0.1.18" +fontdb = "0.23.0" # rfd = { version = "0.15.4", default-features = false, features = ["xdg-portal"] } diff --git a/TODO.org b/TODO.org index d5f2ce7..242b036 100644 --- a/TODO.org +++ b/TODO.org @@ -16,7 +16,7 @@ Let's build some tests that ensure that these functions are working for the mode By making the db functions take the vector of items in the model, we can drain the model, pass an owned version of those items to the async db function(adding, updating, deleting, etc) and then return an updated list of the items back in the Result. -We should probably return a tuple with the original vector of items in case the db function fails somehow. +We should probably return a tuple with the original vector of items in case the db function fails somehow. This would be extremely important if we eventually create a server/client architecture and for whatever reason the server fails to respond with an answer, we'd lose all our items. ** TODO [#A] Need to test the library ** DONE Move to new design diff --git a/src/core/songs.rs b/src/core/songs.rs index 30fde37..4f50942 100644 --- a/src/core/songs.rs +++ b/src/core/songs.rs @@ -1185,7 +1185,7 @@ impl Song { } #[cfg(test)] -mod test { +pub mod test { use std::{str::FromStr, sync::Arc}; use crate::ui::text_svg::text_svg_generator_with_cache; @@ -1338,7 +1338,7 @@ You saved my soul" song_model } - async fn add_db() -> Result { + pub async fn add_db() -> Result { let db_url = String::from("sqlite::memory:"); let pool = SqlitePool::connect(&db_url).await.into_diagnostic()?; @@ -1350,7 +1350,7 @@ You saved my soul" Ok(pool) } - async fn fill_db(db: Arc) -> Result<()> { + pub async fn fill_db(db: Arc) -> Result<()> { let mut songs = Vec::new(); for _ in 0..20 { songs = add_song(songs, db.clone()).await?; diff --git a/src/main.rs b/src/main.rs index 520c57d..6cea584 100755 --- a/src/main.rs +++ b/src/main.rs @@ -8,16 +8,16 @@ use core::slide::{ use cosmic::app::{Core, Settings, Task}; use cosmic::cosmic_config::{Config, CosmicConfigEntry}; use cosmic::dialog::file_chooser::{open, save}; +use cosmic::iced::Subscription; use cosmic::iced::alignment::Vertical; +use cosmic::iced::core::text::Wrapping; use cosmic::iced::keyboard::{Key, Modifiers}; +use cosmic::iced::widget::{column, row, stack}; use cosmic::iced::window::Position; use cosmic::iced::{ self, Background as IcedBackground, Border, Color, Length, event, window, }; -use cosmic::iced_core::text::Wrapping; -use cosmic::iced_futures::Subscription; -use cosmic::iced_widget::{column, row, stack}; use cosmic::widget::dnd_destination::dnd_destination; use cosmic::widget::menu::key_bind::Modifier; use cosmic::widget::menu::{ItemWidth, KeyBind}; @@ -1940,11 +1940,11 @@ where let visual_item = if self.hovered_dnd.is_some_and(|h| h == index) { let divider = divider::horizontal::default().class(theme::Rule::custom(|t| { let color = t.cosmic().accent_color(); - cosmic::iced_widget::rule::Style { + cosmic::iced::widget::rule::Style { color: color.into(), snap: true, radius: t.cosmic().corner_radii.radius_xs.into(), - fill_mode: cosmic::iced_widget::rule::FillMode::Full, + fill_mode: cosmic::iced::widget::rule::FillMode::Full, } } )).width(2); Container::new(column![divider, container].spacing(theme::spacing().space_s)) @@ -2150,8 +2150,11 @@ where } fn add_library() -> Task { - Task::perform(async move { Library::new().await }, |x| { - cosmic::Action::App(Message::AddLibrary(x)) + cosmic::Task::future(library::add_db()).then(|res| { + Task::perform( + Library::new(Arc::new(res.expect("probs"))), + |x| cosmic::Action::App(Message::AddLibrary(x)), + ) }) } diff --git a/src/ui/image_editor.rs b/src/ui/image_editor.rs index faa4a16..1c1e4dc 100644 --- a/src/ui/image_editor.rs +++ b/src/ui/image_editor.rs @@ -4,8 +4,8 @@ use crate::core::images::Image; use cosmic::{ Apply, Element, Task, dialog::file_chooser::{FileFilter, open::Dialog}, + iced::widget::{column, row}, iced::{Length, alignment::Vertical}, - iced_widget::{column, row}, theme, widget::{ self, Space, button, container, icon, space::horizontal, diff --git a/src/ui/library.rs b/src/ui/library.rs index 2215aa7..a983f13 100644 --- a/src/ui/library.rs +++ b/src/ui/library.rs @@ -3,12 +3,12 @@ use std::{collections::HashMap, sync::Arc}; use cosmic::{ Element, Task, dialog::file_chooser::open::Dialog, + iced::core::widget::tree::State, + iced::widget::{column, row as rowm, text as textm}, iced::{ Background, Border, Color, Length, alignment::Vertical, clipboard::dnd::DndAction, keyboard::Modifiers, }, - iced_core::widget::tree::State, - iced_widget::{column, row as rowm, text as textm}, theme, widget::{ Container, DndSource, Space, button, container, context_menu, @@ -115,12 +115,11 @@ pub enum Message { } impl<'a> Library { - pub async fn new() -> Self { - let db = add_db().await.expect("probs"); - if let Err(e) = migrate!().run(&db).await { + pub async fn new(db: Arc) -> Self { + // let db = add_db().await.expect("probs"); + if let Err(e) = migrate!().run(&*db).await { error!(?e); } - let db = Arc::new(db); Self { song_library: Model::new_song_model(Arc::clone(&db)) .await, @@ -1420,7 +1419,7 @@ async fn add_presentations() -> Option> { ) } -async fn add_db() -> Result { +pub async fn add_db() -> Result { let mut data = dirs::data_local_dir() .expect("Should always find a data dir"); data.push("lumina"); @@ -1466,3 +1465,30 @@ pub fn elide_text(text: impl AsRef, width: f32) -> String { text } } + +#[cfg(test)] +mod test { + use super::*; + use crate::core::songs::test::add_db; + use crate::core::songs::test::fill_db; + use crate::core::songs::test::test_song; + use pretty_assertions::assert_eq; + + #[tokio::test] + async fn test_library_add() -> Result<()> { + let db = Arc::new(add_db().await?); + fill_db(db.clone()).await?; + let mut library = Library::new(db).await; + let pre_length = library.song_library.items.len(); + library.selected_items = Some(vec![(LibraryKind::Song, 5)]); + library.update(Message::DeleteItem); + let post_length = library.song_library.items.len(); + assert!(pre_length > post_length); + assert_eq!(pre_length, post_length); + // let song = + // library.get_song(5).expect("Should be here").clone(); + // let test_song = test_song(); + + Ok(()) + } +} diff --git a/src/ui/presentation_editor.rs b/src/ui/presentation_editor.rs index 218a133..d3b8cb4 100644 --- a/src/ui/presentation_editor.rs +++ b/src/ui/presentation_editor.rs @@ -9,8 +9,8 @@ use crate::core::presentations::{PresKind, Presentation}; use cosmic::{ Element, Task, dialog::file_chooser::{FileFilter, open::Dialog}, + iced::widget::{column, row}, iced::{Background, ContentFit, Length, alignment::Vertical}, - iced_widget::{column, row}, theme, widget::{ self, Space, button, container, context_menu, icon, diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index 72f0bd5..d6157c9 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -9,17 +9,17 @@ use std::{ use cosmic::{ Task, - iced::{ - Background, Border, Color, ContentFit, Font, Length, Shadow, - Vector, - font::{Family, Stretch, Style, Weight}, - }, - iced_widget::{ + iced::widget::{ scrollable::{ AbsoluteOffset, Direction, Scrollbar, scroll_to, }, stack, }, + iced::{ + Background, Border, Color, ContentFit, Font, Length, Shadow, + Vector, + font::{Family, Stretch, Style, Weight}, + }, prelude::*, widget::{ Container, Id, Row, Space, container, context_menu, diff --git a/src/ui/service.rs b/src/ui/service.rs index 3fbaa10..1120968 100644 --- a/src/ui/service.rs +++ b/src/ui/service.rs @@ -3,14 +3,14 @@ use cosmic::iced::Size; use cosmic::iced_core::widget::tree; use cosmic::{ Element, + iced::core::{ + self, Clipboard, Shell, layout, renderer, widget::Tree, + }, iced::{ Event, Length, Point, Rectangle, Vector, clipboard::dnd::{DndEvent, SourceEvent}, event, mouse, }, - iced_core::{ - self, Clipboard, Shell, layout, renderer, widget::Tree, - }, widget::Widget, }; use tracing::debug; diff --git a/src/ui/slide_editor.rs b/src/ui/slide_editor.rs index 8024484..15b8827 100644 --- a/src/ui/slide_editor.rs +++ b/src/ui/slide_editor.rs @@ -86,7 +86,7 @@ impl<'a> Program renderer: &Renderer, _theme: &cosmic::Theme, bounds: cosmic::iced::Rectangle, - _cursor: cosmic::iced_core::mouse::Cursor, + _cursor: cosmic::iced::core::mouse::Cursor, ) -> Vec> { // We prepare a new `Frame` let mut frame = canvas::Frame::new(renderer, bounds.size()); @@ -123,8 +123,8 @@ impl<'a> Program _state: &mut Self::State, event: &canvas::Event, bounds: cosmic::iced::Rectangle, - _cursor: cosmic::iced_core::mouse::Cursor, - ) -> Option> { + _cursor: cosmic::iced::core::mouse::Cursor, + ) -> Option> { match event { canvas::Event::Mouse(event) => match event { cosmic::iced::mouse::Event::CursorEntered => { @@ -172,8 +172,8 @@ impl<'a> Program &self, _state: &Self::State, _bounds: cosmic::iced::Rectangle, - _cursor: cosmic::iced_core::mouse::Cursor, - ) -> cosmic::iced_core::mouse::Interaction { - cosmic::iced_core::mouse::Interaction::default() + _cursor: cosmic::iced::core::mouse::Cursor, + ) -> cosmic::iced::core::mouse::Interaction { + cosmic::iced::core::mouse::Interaction::default() } } diff --git a/src/ui/song_editor.rs b/src/ui/song_editor.rs index 734b8f1..2abe4dc 100755 --- a/src/ui/song_editor.rs +++ b/src/ui/song_editor.rs @@ -10,6 +10,16 @@ use std::{ use cosmic::{ Apply, Element, Task, dialog::file_chooser::{FileFilter, open::Dialog}, + iced::core::widget::tree, + iced::futures, + iced::widget::{ + column, row, + scrollable::{ + self as iced_scrollable, AbsoluteOffset, Direction, + Scrollbar, + }, + stack, + }, iced::{ Background as ContainerBackground, Border, Color, Length, Padding, Shadow, Vector, @@ -22,17 +32,6 @@ use cosmic::{ }, task, }, - iced_core::widget::tree, - iced_futures, - iced_wgpu::graphics::text::cosmic_text::fontdb, - iced_widget::{ - column, row, - scrollable::{ - self as iced_scrollable, AbsoluteOffset, Direction, - Scrollbar, - }, - stack, - }, theme, widget::{ ColorPickerModel, Id, RcElementWrapper, button, @@ -47,6 +46,7 @@ use cosmic::{ }; use derive_more::Debug; use dirs::font_dir; +use fontdb; use iced_video_player::Video; use itertools::Itertools; use rayon::iter::{IntoParallelIterator, ParallelIterator}; @@ -949,7 +949,7 @@ impl SongEditor { .on_press(Message::PauseVideo); let video_track = - cosmic::iced_widget::progress_bar( + cosmic::iced::widget::progress_bar( 0.0..=video.duration().as_secs_f32(), video.position().as_secs_f32(), ) diff --git a/src/ui/video_editor.rs b/src/ui/video_editor.rs index b1755d0..c20d16e 100644 --- a/src/ui/video_editor.rs +++ b/src/ui/video_editor.rs @@ -3,8 +3,8 @@ use std::{io, path::PathBuf}; use cosmic::{ Element, Task, dialog::file_chooser::{FileFilter, open::Dialog}, + iced::widget::{column, row}, iced::{Length, alignment::Vertical}, - iced_widget::{column, row}, theme, widget::{ Space, button, container, icon, slider, diff --git a/src/ui/widgets/draggable/column.rs b/src/ui/widgets/draggable/column.rs index 36bfbed..37c0830 100644 --- a/src/ui/widgets/draggable/column.rs +++ b/src/ui/widgets/draggable/column.rs @@ -817,7 +817,7 @@ where state: &Tree, layout: Layout<'_>, renderer: &Renderer, - dnd_rectangles: &mut cosmic::iced_core::clipboard::DndDestinationRectangles, + dnd_rectangles: &mut cosmic::iced::core::clipboard::DndDestinationRectangles, ) { for ((e, c_layout), state) in self .children diff --git a/src/ui/widgets/slide_text.rs b/src/ui/widgets/slide_text.rs index 308b54b..faefa22 100644 --- a/src/ui/widgets/slide_text.rs +++ b/src/ui/widgets/slide_text.rs @@ -3,9 +3,9 @@ use cosmic::iced::advanced::renderer; use cosmic::iced::advanced::widget::{self, Widget}; use cosmic::iced::border; use cosmic::iced::mouse; +use cosmic::iced::wgpu::Primitive; +use cosmic::iced::wgpu::primitive::Renderer as PrimitiveRenderer; use cosmic::iced::{Color, Element, Length, Rectangle, Size}; -use cosmic::iced_wgpu::Primitive; -use cosmic::iced_wgpu::primitive::Renderer as PrimitiveRenderer; pub struct SlideText { _text: String, diff --git a/src/ui/widgets/verse_editor.rs b/src/ui/widgets/verse_editor.rs index bb7917e..3e22733 100644 --- a/src/ui/widgets/verse_editor.rs +++ b/src/ui/widgets/verse_editor.rs @@ -1,8 +1,8 @@ use cosmic::{ Element, Task, cosmic_theme::palette::WithAlpha, + iced::widget::{column, row}, iced::{Background, Border}, - iced_widget::{column, row}, theme, widget::{ button, combo_box, container, icon, space, text_editor,