From 65964661ecc6de6ca6b1223e03951505c34d6621 Mon Sep 17 00:00:00 2001 From: Clark Moody Date: Wed, 5 Apr 2023 22:46:00 -0500 Subject: [PATCH] Use Iced `advanced_text` branch --- Cargo.lock | 2282 +++++++++++++++++--------------- Cargo.toml | 22 +- src/data.rs | 4 +- src/data/dictionary.rs | 6 +- src/data/keyboard.rs | 11 +- src/data/profile.rs | 6 +- src/data/random.rs | 2 +- src/data/theme.rs | 25 +- src/data/training.rs | 27 +- src/data/zipper_list.rs | 11 +- src/font.rs | 51 +- src/lib.rs | 6 + src/main.rs | 118 +- src/screen.rs | 121 +- src/screen/loading.rs | 9 +- src/screen/settings.rs | 66 +- src/screen/settings/profile.rs | 230 ++-- src/screen/settings/theme.rs | 84 +- src/screen/training.rs | 78 +- src/style.rs | 459 ++++++- src/style/button.rs | 341 ----- src/style/container.rs | 50 - src/style/pick_list.rs | 58 - src/style/rule.rs | 26 - src/style/text_input.rs | 61 - 25 files changed, 2101 insertions(+), 2053 deletions(-) create mode 100644 src/lib.rs delete mode 100644 src/style/button.rs delete mode 100644 src/style/container.rs delete mode 100644 src/style/pick_list.rs delete mode 100644 src/style/rule.rs delete mode 100644 src/style/text_input.rs diff --git a/Cargo.lock b/Cargo.lock index 72718aa..e9608a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,20 +3,16 @@ version = 3 [[package]] -name = "ab_glyph" -version = "0.2.13" +name = "Inflector" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61caed9aec6daeee1ea38ccf5fb225e4f96c1eeead1b4a5c267324a63cf02326" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser", -] +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] -name = "ab_glyph_rasterizer" -version = "0.1.5" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" @@ -24,24 +20,44 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.4", + "getrandom", "once_cell", "version_check", ] [[package]] -name = "android_glue" -version = "0.2.3" +name = "ahash" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", +] [[package]] -name = "approx" -version = "0.3.2" +name = "aho-corasick" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ - "num-traits", + "memchr", +] + +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", ] [[package]] @@ -53,6 +69,18 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "arrayvec" version = "0.7.2" @@ -61,36 +89,30 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "ash" -version = "0.34.0+1.2.203" +version = "0.37.1+1.3.235" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f780da53d0063880d45554306489f09dd8d1bda47688b4a57bc579119356df" +checksum = "911015c962d56e2e4052f40182ca5462ba60a3d2ff04e827c365a0ab3d65726d" dependencies = [ "libloading", ] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base-x" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" - -[[package]] -name = "base64" -version = "0.13.0" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] name = "bit-set" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ "bit-vec", ] @@ -115,30 +137,24 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bumpalo" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" - -[[package]] -name = "bumpalo" -version = "3.9.1" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytemuck" -version = "1.7.3" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" +checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.0.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" +checksum = "5fe233b960f12f8007e3db2d136e3cb1c291bfd7396e384ee76025fc1a3932b4" dependencies = [ "proc-macro2", "quote", @@ -153,25 +169,22 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "calloop" -version = "0.9.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" +checksum = "19457a0da465234abd76134a5c2a910c14bd3c5558463e4396ab9a37a328e465" dependencies = [ "log", - "nix 0.22.3", + "nix 0.25.1", + "slotmap", + "thiserror", + "vec_map", ] [[package]] name = "cc" -version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" - -[[package]] -name = "cfg-if" -version = "0.1.10" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" [[package]] name = "cfg-if" @@ -185,20 +198,11 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "cgl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" -dependencies = [ - "libc", -] - [[package]] name = "clipboard-win" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d3d118de1bf9678546f65e12f749b46abb5a56129d435af21fc7e42768f974" +checksum = "c4ab1b92798304eedc095b53942963240037c0516452cb11aeba709d420b2219" dependencies = [ "error-code", "str-buf", @@ -227,35 +231,35 @@ dependencies = [ [[package]] name = "clipboard_x11" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64240d63f1883d87e5637bfcaf9d77e5c8bd24e30fd440ea2dff5c48c0bf0b7a" +checksum = "983a7010836ecd04dde2c6d27a0cb56ec5d21572177e782bdcb24a600124e921" dependencies = [ "thiserror", - "x11rb", + "x11rb 0.9.0", ] [[package]] name = "cmake" -version = "0.1.48" +version = "0.1.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" dependencies = [ "cc", ] [[package]] name = "cocoa" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" dependencies = [ "bitflags", "block", "cocoa-foundation", - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "foreign-types", + "core-foundation", + "core-graphics", + "foreign-types 0.3.2", "libc", "objc", ] @@ -268,9 +272,9 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", - "core-foundation 0.9.2", + "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", "objc", ] @@ -292,55 +296,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" [[package]] -name = "copyless" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - -[[package]] -name = "core-foundation" -version = "0.7.0" +name = "const_panic" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] +checksum = "58baae561b85ca19b3122a9ddd35c8ec40c3bcd14fe89921824eae73f7baffbf" [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ - "core-foundation-sys 0.8.3", + "core-foundation-sys", "libc", ] -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - [[package]] name = "core-foundation-sys" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "core-graphics" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - [[package]] name = "core-graphics" version = "0.22.3" @@ -348,9 +324,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags", - "core-foundation 0.9.2", + "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -361,8 +337,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", - "core-foundation 0.9.2", - "foreign-types", + "core-foundation", + "foreign-types 0.3.2", "libc", ] @@ -372,67 +348,61 @@ version = "19.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" dependencies = [ - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "foreign-types", - "libc", -] - -[[package]] -name = "core-video-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" -dependencies = [ - "cfg-if 0.1.10", - "core-foundation-sys 0.7.0", - "core-graphics 0.19.2", + "core-foundation", + "core-graphics", + "foreign-types 0.3.2", "libc", - "objc", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", ] [[package]] -name = "crossbeam-deque" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +name = "cosmic-text" +version = "0.7.0" +source = "git+https://github.com/pop-os/cosmic-text?rev=e788c175ec31094b04dcacbc0537dba4433afcfc#e788c175ec31094b04dcacbc0537dba4433afcfc" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", + "fontdb", + "libm", + "log", + "ouroboros", + "rangemap", + "rustybuzz", + "swash", + "sys-locale", + "unicode-bidi", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.6" +name = "crc32fast" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", + "cfg-if", ] [[package]] -name = "crossbeam-utils" -version = "0.8.6" +name = "crossfont" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" +checksum = "21fd3add36ea31aba1520aa5288714dd63be506106753226d0eb387a93bc9c45" dependencies = [ - "cfg-if 1.0.0", - "lazy_static", + "cocoa", + "core-foundation", + "core-foundation-sys", + "core-graphics", + "core-text", + "dwrote", + "foreign-types 0.5.0", + "freetype-rs", + "libc", + "log", + "objc", + "once_cell", + "pkg-config", + "servo-fontconfig", + "winapi", ] [[package]] @@ -443,9 +413,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "d3d12" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" +checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759" dependencies = [ "bitflags", "libloading", @@ -454,9 +424,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ "darling_core", "darling_macro", @@ -464,9 +434,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", @@ -478,9 +448,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", @@ -493,7 +463,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -529,22 +499,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "dodrio" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7593dfc68e57dc1d058ada0f151ba07f4b05183c4da4c4df8ff651a81ef0fab" -dependencies = [ - "bumpalo 2.6.0", - "cfg-if 0.1.10", - "fxhash", - "js-sys", - "longest-increasing-subsequence", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "downcast-rs" version = "1.2.0" @@ -559,15 +513,49 @@ checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" dependencies = [ "lazy_static", "libc", + "serde", + "serde_derive", "winapi", "wio", ] [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "encase" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a516181e9a36e8982cb37933c5e7dba638c42938cacde46ee4e5b4156f881b9" +dependencies = [ + "const_panic", + "encase_derive", + "glam", + "thiserror", +] + +[[package]] +name = "encase_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5b802412eea315f29f2bb2da3a5963cd6121f56eaa06aebcdc0c54eea578f22" +dependencies = [ + "encase_derive_impl", +] + +[[package]] +name = "encase_derive_impl" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "0f2f4de457d974f548d2c2a16f709ebd81013579e543bd1a9b19ced88132c2cf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "error-code" @@ -579,11 +567,21 @@ dependencies = [ "str-buf", ] +[[package]] +name = "etagere" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6301151a318f367f392c31395beb1cfba5ccd9abc44d1db0db3a4b27b9601c89" +dependencies = [ + "euclid", + "svg_fmt", +] + [[package]] name = "euclid" -version = "0.22.6" +version = "0.22.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da96828553a086d7b18dcebfc579bd9628b016f86590d7453c115e490fa74b80" +checksum = "b52c2ef4a78da0ba68fbe1fd920627411096d2ac478f7f4c9f3a54ba6705bade" dependencies = [ "num-traits", ] @@ -599,10 +597,32 @@ dependencies = [ ] [[package]] -name = "float-ord" -version = "0.2.0" +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "find-crate" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a98bbaacea1c0eb6a0876280051b892eb73594fd90cf3b20e9c817029c57d2" +dependencies = [ + "toml", +] + +[[package]] +name = "flate2" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide", +] [[package]] name = "fnv" @@ -611,28 +631,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "font-kit" -version = "0.10.1" +name = "fontdb" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c9a156ec38864999bc9c4156e5f3b50224d4a5578028a64e5a3875caa9ee28" +checksum = "bfec8f19f9b89b2901219cc62604810d2bfef15dc1182e95320f57e7cbbe041a" dependencies = [ - "bitflags", - "byteorder", - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "core-text", - "dirs-next", - "dwrote", - "float-ord", - "freetype", - "lazy_static", - "libc", "log", - "pathfinder_geometry", - "pathfinder_simd", - "servo-fontconfig", - "walkdir", - "winapi", + "memmap2", + "slotmap", + "ttf-parser", ] [[package]] @@ -641,7 +648,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8469d0d40519bc608ec6863f1cc88f3f1deee15913f2f3b3e573d81ed38cccc" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -651,21 +679,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "form_urlencoded" -version = "1.0.1" +name = "foreign-types-shared" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" -dependencies = [ - "matches", - "percent-encoding", -] +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] -name = "freetype" -version = "0.7.0" +name = "freetype-rs" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6" +checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" dependencies = [ + "bitflags", "freetype-sys", "libc", ] @@ -683,9 +708,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -698,9 +723,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -708,15 +733,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -726,15 +751,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -743,21 +768,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.19" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -782,9 +807,9 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4addc164932852d066774c405dbbdb7914742d2b39e39e1a7ca949c856d054d1" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" dependencies = [ "libc", "winapi", @@ -792,185 +817,42 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.4" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", -] - -[[package]] -name = "gl_generator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" -dependencies = [ - "khronos_api", - "log", - "xml-rs", + "wasi", ] [[package]] name = "glam" -version = "0.10.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579160312273c954cc51bd440f059dde741029ac8daf8c84fece76cb77f62c15" -dependencies = [ - "version_check", -] +checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" [[package]] name = "glow" -version = "0.6.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1625b792e2f9267116dd41eb7d325e0ea2572ceba5069451906745e04f852f33" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" dependencies = [ "js-sys", - "slotmap 0.4.3", + "slotmap", "wasm-bindgen", "web-sys", ] [[package]] -name = "glow" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" -dependencies = [ - "js-sys", - "slotmap 1.0.6", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "glow_glyph" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0510450eb46dd2b8e3284b50b08bfd870f1ef93a55045f54d7376fbcb63b1cb" -dependencies = [ - "bytemuck", - "glow 0.6.1", - "glyph_brush", - "log", -] - -[[package]] -name = "glutin" -version = "0.28.0" -source = "git+https://github.com/iced-rs/glutin?rev=7a0ee02782eb2bf059095e0c953c4bb53f1eef0e#7a0ee02782eb2bf059095e0c953c4bb53f1eef0e" -dependencies = [ - "android_glue", - "cgl", - "cocoa", - "core-foundation 0.9.2", - "glutin_egl_sys", - "glutin_emscripten_sys", - "glutin_gles2_sys", - "glutin_glx_sys", - "glutin_wgl_sys", - "lazy_static", - "libloading", - "log", - "objc", - "osmesa-sys", - "parking_lot", - "wayland-client", - "wayland-egl", - "winapi", - "winit", -] - -[[package]] -name = "glutin_egl_sys" -version = "0.1.5" -source = "git+https://github.com/iced-rs/glutin?rev=7a0ee02782eb2bf059095e0c953c4bb53f1eef0e#7a0ee02782eb2bf059095e0c953c4bb53f1eef0e" -dependencies = [ - "gl_generator", - "winapi", -] - -[[package]] -name = "glutin_emscripten_sys" -version = "0.1.1" -source = "git+https://github.com/iced-rs/glutin?rev=7a0ee02782eb2bf059095e0c953c4bb53f1eef0e#7a0ee02782eb2bf059095e0c953c4bb53f1eef0e" - -[[package]] -name = "glutin_gles2_sys" -version = "0.1.5" -source = "git+https://github.com/iced-rs/glutin?rev=7a0ee02782eb2bf059095e0c953c4bb53f1eef0e#7a0ee02782eb2bf059095e0c953c4bb53f1eef0e" -dependencies = [ - "gl_generator", - "objc", -] - -[[package]] -name = "glutin_glx_sys" -version = "0.1.7" -source = "git+https://github.com/iced-rs/glutin?rev=7a0ee02782eb2bf059095e0c953c4bb53f1eef0e#7a0ee02782eb2bf059095e0c953c4bb53f1eef0e" -dependencies = [ - "gl_generator", - "x11-dl", -] - -[[package]] -name = "glutin_wgl_sys" -version = "0.1.5" -source = "git+https://github.com/iced-rs/glutin?rev=7a0ee02782eb2bf059095e0c953c4bb53f1eef0e#7a0ee02782eb2bf059095e0c953c4bb53f1eef0e" -dependencies = [ - "gl_generator", -] - -[[package]] -name = "glyph_brush" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21932fbf719272848eec4583740d978203c6e7da4c4e203358f5b95946c97409" -dependencies = [ - "glyph_brush_draw_cache", - "glyph_brush_layout", - "log", - "ordered-float", - "rustc-hash", - "twox-hash", -] - -[[package]] -name = "glyph_brush_draw_cache" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6010675390f6889e09a21e2c8b575b3ee25667ea8237a8d59423f73cb8c28610" -dependencies = [ - "ab_glyph", - "crossbeam-channel", - "crossbeam-deque", - "linked-hash-map", - "rayon", - "rustc-hash", -] - -[[package]] -name = "glyph_brush_layout" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc32c2334f00ca5ac3695c5009ae35da21da8c62d255b5b96d56e2597a637a38" +name = "glyphon" +version = "0.2.0" +source = "git+https://github.com/hecrj/glyphon.git?rev=47050174841a4f58fc8d85c943a2117f72f19e8e#47050174841a4f58fc8d85c943a2117f72f19e8e" dependencies = [ - "ab_glyph", - "approx 0.5.1", - "xi-unicode", + "cosmic-text", + "etagere", + "lru", + "wgpu", ] [[package]] @@ -994,13 +876,13 @@ dependencies = [ [[package]] name = "gpu-descriptor" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a538f217be4d405ff4719a283ca68323cc2384003eca5baaa87501e821c81dda" +checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" dependencies = [ "bitflags", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1024,11 +906,20 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash", + "ahash 0.8.3", ] [[package]] @@ -1040,6 +931,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hexf-parse" version = "0.2.1" @@ -1048,146 +945,150 @@ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] name = "iced" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +version = "0.8.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ "iced_core", "iced_futures", - "iced_glow", - "iced_glutin", - "iced_web", - "iced_wgpu", + "iced_renderer", + "iced_widget", "iced_winit", "thiserror", ] [[package]] name = "iced_core" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +version = "0.8.1" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ "bitflags", + "instant", "palette", + "thiserror", + "twox-hash", ] [[package]] name = "iced_futures" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +version = "0.6.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ "futures", + "iced_core", "log", "tokio", "wasm-bindgen-futures", + "wasm-timer", ] [[package]] -name = "iced_glow" -version = "0.2.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +name = "iced_graphics" +version = "0.7.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ + "bitflags", "bytemuck", - "euclid", - "glow 0.6.1", - "glow_glyph", - "glyph_brush", - "iced_graphics", - "iced_native", + "glam", + "iced_core", "log", + "raw-window-handle 0.5.0", + "thiserror", + "tiny-skia 0.8.3", ] [[package]] -name = "iced_glutin" -version = "0.2.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +name = "iced_renderer" +version = "0.1.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ - "glutin", "iced_graphics", - "iced_native", - "iced_winit", -] - -[[package]] -name = "iced_graphics" -version = "0.2.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" -dependencies = [ - "bytemuck", - "font-kit", - "glam", - "iced_native", - "iced_style", - "raw-window-handle 0.4.2", + "iced_tiny_skia", + "iced_wgpu", + "raw-window-handle 0.5.0", "thiserror", ] [[package]] -name = "iced_native" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +name = "iced_runtime" +version = "0.9.1" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ "iced_core", "iced_futures", - "iced_style", - "num-traits", - "twox-hash", - "unicode-segmentation", + "thiserror", ] [[package]] name = "iced_style" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +version = "0.7.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ "iced_core", + "once_cell", + "palette", ] [[package]] -name = "iced_web" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +name = "iced_tiny_skia" +version = "0.1.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ - "base64", - "dodrio", - "iced_core", - "iced_futures", - "iced_style", - "num-traits", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", + "bytemuck", + "cosmic-text", + "iced_graphics", + "kurbo", + "raw-window-handle 0.5.0", + "rustc-hash", + "softbuffer", + "tiny-skia 0.8.3", + "twox-hash", ] [[package]] name = "iced_wgpu" -version = "0.4.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +version = "0.9.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ "bitflags", "bytemuck", + "encase", "futures", - "glyph_brush", + "glam", + "glyphon", "guillotiere", "iced_graphics", - "iced_native", - "kamadak-exif", "log", - "raw-window-handle 0.4.2", + "once_cell", + "raw-window-handle 0.5.0", + "rustc-hash", + "twox-hash", "wgpu", - "wgpu_glyph", +] + +[[package]] +name = "iced_widget" +version = "0.1.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" +dependencies = [ + "iced_renderer", + "iced_runtime", + "iced_style", + "num-traits", + "thiserror", + "unicode-segmentation", ] [[package]] name = "iced_winit" -version = "0.3.0" -source = "git+https://github.com/hecrj/iced.git?rev=4aa943cbc63230dfcb995c469ceec9f74e6132e1#4aa943cbc63230dfcb995c469ceec9f74e6132e1" +version = "0.8.0" +source = "git+https://github.com/hecrj/iced.git?rev=0b459c8e240abf83bb62902a504c018194acdbb6#0b459c8e240abf83bb62902a504c018194acdbb6" dependencies = [ - "iced_futures", "iced_graphics", - "iced_native", + "iced_runtime", + "iced_style", "log", "thiserror", + "web-sys", "winapi", "window_clipboard", "winit", @@ -1199,59 +1100,53 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "indexmap" -version = "1.8.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] -[[package]] -name = "inplace_it" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" - [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", ] +[[package]] +name = "io-lifetimes" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd6da19f25979c7270e70fa95ab371ec3b701cd0eefc47667a09785b3c59155" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jni-sys" @@ -1261,22 +1156,13 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.56" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kamadak-exif" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70494964492bf8e491eb3951c5d70c9627eb7100ede6cc56d748b9a3f302cfb6" -dependencies = [ - "mutate_once", -] - [[package]] name = "khronos-egl" version = "4.1.0" @@ -1285,13 +1171,17 @@ checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" dependencies = [ "libc", "libloading", + "pkg-config", ] [[package]] -name = "khronos_api" -version = "3.1.0" +name = "kurbo" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +checksum = "db8c31eaef73f18e0d938785e01ab471ec73e3f90c3389e84335ade689ba953b" +dependencies = [ + "arrayvec 0.7.2", +] [[package]] name = "lazy_static" @@ -1301,25 +1191,25 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.113" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] [[package]] name = "libm" -version = "0.2.1" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "linkage" @@ -1327,12 +1217,9 @@ version = "0.1.0" dependencies = [ "dirs-next", "iced", - "iced_futures", - "iced_graphics", - "iced_native", "itertools", "palette", - "rand 0.8.4", + "rand", "serde", "serde_json", "statrs", @@ -1340,35 +1227,33 @@ dependencies = [ "tokio", ] -[[package]] -name = "linked-hash-map" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" - [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] -name = "longest-increasing-subsequence" -version = "0.1.0" +name = "lru" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" +checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +dependencies = [ + "hashbrown 0.13.2", +] [[package]] name = "malloc_buf" @@ -1379,12 +1264,6 @@ dependencies = [ "libc", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "matrixmultiply" version = "0.3.2" @@ -1396,15 +1275,15 @@ dependencies = [ [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.3.1" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" +checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" dependencies = [ "libc", ] @@ -1418,16 +1297,25 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "metal" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084" +checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" dependencies = [ "bitflags", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "log", "objc", ] @@ -1439,38 +1327,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "mio" -version = "0.8.0" +name = "miniz_oxide" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", + "adler", ] [[package]] -name = "miow" -version = "0.3.7" +name = "mio" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ - "winapi", + "libc", + "log", + "wasi", + "windows-sys 0.42.0", ] -[[package]] -name = "mutate_once" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" - [[package]] name = "naga" -version = "0.8.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22c5cfe6dbc4ae14962316265a931fbb89b892c5ed6a4a61d7fe4e9f58c0bf94" +checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707" dependencies = [ "bit-set", "bitflags", @@ -1481,7 +1362,9 @@ dependencies = [ "num-traits", "rustc-hash", "spirv", + "termcolor", "thiserror", + "unicode-xid", ] [[package]] @@ -1490,13 +1373,13 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" dependencies = [ - "approx 0.5.1", + "approx", "matrixmultiply", "nalgebra-macros", "num-complex", "num-rational", "num-traits", - "rand 0.8.4", + "rand", "rand_distr", "simba", "typenum", @@ -1515,29 +1398,38 @@ dependencies = [ [[package]] name = "ndk" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags", "jni-sys", "ndk-sys", "num_enum", + "raw-window-handle 0.5.0", "thiserror", ] +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + [[package]] name = "ndk-glue" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc291b8de2095cba8dab7cf381bf582ff4c17a09acf854c32e46545b08085d28" +checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" dependencies = [ - "lazy_static", "libc", "log", "ndk", + "ndk-context", "ndk-macro", "ndk-sys", + "once_cell", + "parking_lot 0.12.1", ] [[package]] @@ -1555,69 +1447,89 @@ dependencies = [ [[package]] name = "ndk-sys" -version = "0.2.2" +version = "0.4.1+23.1.7779620" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] [[package]] name = "nix" -version = "0.20.0" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" dependencies = [ "bitflags", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", + "memoffset 0.6.5", ] [[package]] name = "nix" -version = "0.22.3" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", - "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] -name = "nom" -version = "7.1.0" +name = "nix" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ - "memchr", - "minimal-lexical", - "version_check", + "autocfg", + "bitflags", + "cfg-if", + "libc", + "memoffset 0.6.5", ] [[package]] -name = "ntapi" -version = "0.3.6" +name = "nix" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "winapi", + "bitflags", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", + "static_assertions", +] + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", ] [[package]] name = "num-complex" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" +checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" dependencies = [ "num-traits", ] [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -1625,9 +1537,9 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", "num-integer", @@ -1636,9 +1548,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", "libm", @@ -1646,28 +1558,28 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] [[package]] name = "num_enum" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1716,56 +1628,52 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "ordered-float" -version = "2.10.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" -dependencies = [ - "num-traits", -] +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] -name = "osmesa-sys" -version = "0.1.2" +name = "ouroboros" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" +checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" dependencies = [ - "shared_library", + "aliasable", + "ouroboros_macro", ] [[package]] -name = "owned_ttf_parser" -version = "0.14.0" +name = "ouroboros_macro" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef05f2882a8b3e7acc10c153ade2631f7bfc8ce00d2bf3fb8f4e9d2ae6ea5c3" +checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" dependencies = [ - "ttf-parser", + "Inflector", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "palette" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05c0334468e62a4dfbda34b29110aa7d70d58c7fdb2c9857b5874dd9827cc59" +checksum = "8f9cd68f7112581033f157e56c77ac4a5538ec5836a2e39284e65bd7d7275e49" dependencies = [ - "approx 0.3.2", + "approx", "num-traits", "palette_derive", "phf", - "phf_codegen", ] [[package]] name = "palette_derive" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b4b5f600e60dd3a147fb57b4547033d382d1979eb087af310e91cb45a63b1f4" +checksum = "05eedf46a8e7c27f74af0c9cfcdb004ceca158cb1b918c6f68f8d7a549b3e427" dependencies = [ + "find-crate", "proc-macro2", "quote", "syn", @@ -1779,106 +1687,105 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.5", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] [[package]] -name = "paste" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" - -[[package]] -name = "pathfinder_geometry" -version = "0.5.1" +name = "parking_lot_core" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ - "log", - "pathfinder_simd", + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "windows-sys 0.42.0", ] [[package]] -name = "pathfinder_simd" -version = "0.5.1" +name = "paste" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff" -dependencies = [ - "rustc_version 0.3.3", -] +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "phf" -version = "0.8.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" dependencies = [ + "phf_macros", "phf_shared", ] [[package]] -name = "phf_codegen" -version = "0.8.0" +name = "phf_generator" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" dependencies = [ - "phf_generator", "phf_shared", + "rand", ] [[package]] -name = "phf_generator" -version = "0.8.0" +name = "phf_macros" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" dependencies = [ + "phf_generator", "phf_shared", - "rand 0.7.3", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "phf_shared" -version = "0.8.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" dependencies = [ "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1888,26 +1795,63 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.24" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "png" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +dependencies = [ + "bitflags", + "crc32fast", + "flate2", + "miniz_oxide", +] [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -1916,62 +1860,46 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987" +checksum = "74605f360ce573babfe43964cbe520294dcb081afbf8c108fc6e23036b4da2df" [[package]] -name = "quote" -version = "1.0.15" +name = "quick-xml" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" dependencies = [ - "proc-macro2", + "memchr", ] [[package]] -name = "rand" -version = "0.7.3" +name = "quote" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", - "rand_pcg", + "proc-macro2", ] [[package]] name = "rand" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -1981,25 +1909,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.4", + "getrandom", ] [[package]] @@ -2009,57 +1928,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand 0.8.4", + "rand", ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "range-alloc" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] +checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rangemap" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", -] +checksum = "8b9283c6b06096b47afc7109834fdedab891175bb5241ee5d4f7d2546549f263" [[package]] -name = "rand_pcg" -version = "0.2.1" +name = "raw-window-handle" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" dependencies = [ - "rand_core 0.5.1", + "libc", + "raw-window-handle 0.4.3", ] -[[package]] -name = "range-alloc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" - [[package]] name = "raw-window-handle" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" dependencies = [ - "libc", - "raw-window-handle 0.4.2", + "cty", ] [[package]] name = "raw-window-handle" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba75eee94a9d5273a68c9e1e105d9cffe1ef700532325788389e5a83e2522b7" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" dependencies = [ "cty", ] @@ -2071,49 +1978,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] -name = "rayon" -version = "1.5.1" +name = "redox_syscall" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", + "bitflags", ] [[package]] -name = "rayon-core" -version = "1.9.1" +name = "redox_syscall" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "bitflags", ] [[package]] -name = "redox_syscall" -version = "0.2.10" +name = "redox_users" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "bitflags", + "getrandom", + "redox_syscall 0.2.16", + "thiserror", ] [[package]] -name = "redox_users" -version = "0.4.0" +name = "regex" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ - "getrandom 0.2.4", - "redox_syscall", + "aho-corasick", + "memchr", + "regex-syntax", ] +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + [[package]] name = "renderdoc-sys" version = "0.7.1" @@ -2132,38 +2041,46 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver 0.9.0", + "semver", ] [[package]] -name = "rustc_version" -version = "0.3.3" +name = "rustybuzz" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "162bdf42e261bee271b3957691018634488084ef577dddeb6420a9684cab2a6a" dependencies = [ - "semver 0.11.0", + "bitflags", + "bytemuck", + "libm", + "smallvec", + "ttf-parser", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-general-category", + "unicode-script", ] [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] -name = "same-file" -version = "1.0.6" +name = "safe_arch" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" dependencies = [ - "winapi-util", + "bytemuck", ] [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" @@ -2172,21 +2089,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "semver" -version = "0.9.0" +name = "sctk-adwaita" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +checksum = "61270629cc6b4d77ec1907db1033d5c2e1a404c412743621981a871dc9c12339" dependencies = [ - "semver-parser 0.7.0", + "crossfont", + "log", + "smithay-client-toolkit", + "tiny-skia 0.7.0", ] [[package]] name = "semver" -version = "0.11.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.10.2", + "semver-parser", ] [[package]] @@ -2195,29 +2115,20 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - [[package]] name = "serde" -version = "1.0.135" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf9235533494ea2ddcdb794665461814781c53f19d87b76e571a1c35acbad2b" +checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.135" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dcde03d87d4c973c04be249e7d8f0b35db1c848c487bd43032808e59dd8328d" +checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" dependencies = [ "proc-macro2", "quote", @@ -2226,9 +2137,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.78" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", @@ -2271,23 +2182,13 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" -[[package]] -name = "shared_library" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" -dependencies = [ - "lazy_static", - "libc", -] - [[package]] name = "simba" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" dependencies = [ - "approx 0.5.1", + "approx", "num-complex", "num-traits", "paste", @@ -2295,21 +2196,18 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86232ab60fa71287d7f2ddae4a7073f6b7aac33631c3015abb556f08c6d0a3e" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" - -[[package]] -name = "slotmap" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf34684c5767b87de9119790e92e9a1d60056be2ceeaf16a8e6ef13082aeab1" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "slotmap" @@ -2322,15 +2220,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smithay-client-toolkit" -version = "0.15.3" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1325f292209cee78d5035530932422a30aa4c8fda1a16593ac083c1de211e68a" +checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" dependencies = [ "bitflags", "calloop", @@ -2338,21 +2236,49 @@ dependencies = [ "lazy_static", "log", "memmap2", - "nix 0.22.3", + "nix 0.24.3", "pkg-config", - "wayland-client", + "wayland-client 0.29.5", "wayland-cursor", "wayland-protocols", ] [[package]] name = "smithay-clipboard" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" +checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" dependencies = [ "smithay-client-toolkit", - "wayland-client", + "wayland-client 0.29.5", +] + +[[package]] +name = "softbuffer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3177eca2c15033e254b9b70c4915150200b1cf6fa777de18be9977ae5850077f" +dependencies = [ + "bytemuck", + "cfg_aliases", + "cocoa", + "core-graphics", + "fastrand", + "foreign-types 0.3.2", + "log", + "nix 0.26.2", + "objc", + "raw-window-handle 0.5.0", + "redox_syscall 0.3.5", + "thiserror", + "wasm-bindgen", + "wayland-backend", + "wayland-client 0.30.1", + "wayland-sys 0.30.1", + "web-sys", + "windows-sys 0.42.0", + "x11-dl", + "x11rb 0.11.1", ] [[package]] @@ -2386,11 +2312,11 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" dependencies = [ - "approx 0.5.1", + "approx", "lazy_static", "nalgebra", "num-traits", - "rand 0.8.4", + "rand", ] [[package]] @@ -2400,7 +2326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" dependencies = [ "discard", - "rustc_version 0.2.3", + "rustc_version", "stdweb-derive", "stdweb-internal-macros", "stdweb-internal-runtime", @@ -2444,9 +2370,15 @@ checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "str-buf" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d44a3643b4ff9caf57abcee9c2c621d6c03d9135e0d8b589bd9afb5992cb176a" +checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" + +[[package]] +name = "strict-num" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df65f20698aeed245efdde3628a6b559ea1239bbb871af1b6e3b58c413b2bd1" [[package]] name = "strsim" @@ -2460,40 +2392,63 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" +[[package]] +name = "swash" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb18e5888a9b5f0a89ea3ebdf6883dc479347ca9183b6c51a8f9cf2041f23a0" +dependencies = [ + "yazi", + "zeno", +] + [[package]] name = "syn" -version = "1.0.86" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" +dependencies = [ + "js-sys", + "libc", + "wasm-bindgen", + "web-sys", + "windows-sys 0.45.0", ] [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -2540,112 +2495,168 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.5.1" +name = "tiny-skia" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" dependencies = [ - "tinyvec_macros", + "arrayref", + "arrayvec 0.5.2", + "bytemuck", + "cfg-if", + "png", + "safe_arch", + "tiny-skia-path 0.7.0", ] [[package]] -name = "tinyvec_macros" -version = "0.1.0" +name = "tiny-skia" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfef3412c6975196fdfac41ef232f910be2bb37b9dd3313a49a1a6bc815a5bdb" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "bytemuck", + "cfg-if", + "png", + "tiny-skia-path 0.8.3", +] + +[[package]] +name = "tiny-skia-path" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" +dependencies = [ + "arrayref", + "bytemuck", +] + +[[package]] +name = "tiny-skia-path" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b5edac058fc98f51c935daea4d805b695b38e2f151241cad125ade2a2ac20d" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] [[package]] name = "tokio" -version = "1.15.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ + "autocfg", "num_cpus", "pin-project-lite", + "windows-sys 0.42.0", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" dependencies = [ "serde", ] [[package]] name = "ttf-parser" -version = "0.14.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ccbe8381883510b6a2d8f1e32905bddd178c11caef8083086d0c0c9ab0ac281" +checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" [[package]] name = "twox-hash" -version = "1.6.2" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", - "rand 0.8.4", + "cfg-if", + "rand", "static_assertions", ] [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] -name = "ucd-trie" -version = "0.1.3" +name = "unicode-bidi" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "7d502c968c6a838ead8e69b2ee18ec708802f99db92a0d156705ec9ef801993b" [[package]] -name = "unicode-bidi" -version = "0.3.7" +name = "unicode-bidi-mirroring" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" [[package]] -name = "unicode-normalization" -version = "0.1.19" +name = "unicode-ccc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" + +[[package]] +name = "unicode-general-category" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-linebreak" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" dependencies = [ - "tinyvec", + "hashbrown 0.12.3", + "regex", ] +[[package]] +name = "unicode-script" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" + [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "url" -version = "2.2.2" +name = "vec_map" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" -dependencies = [ - "form_urlencoded", - "idna", - "matches", - "percent-encoding", -] +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" @@ -2653,48 +2664,31 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ - "bumpalo 3.9.1", - "lazy_static", + "bumpalo", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -2703,11 +2697,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2715,9 +2709,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2725,9 +2719,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.79" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -2738,98 +2732,153 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.79" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wayland-backend" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" +checksum = "79ebd48bfc1178c9190c7ff80cc822b3335ffc83141e9aa723168f377257623e" +dependencies = [ + "cc", + "downcast-rs", + "io-lifetimes", + "nix 0.26.2", + "scoped-tls", + "smallvec", + "wayland-sys 0.30.1", +] [[package]] name = "wayland-client" -version = "0.29.4" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91223460e73257f697d9e23d401279123d36039a3f7a449e983f123292d4458f" +checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" dependencies = [ "bitflags", "downcast-rs", "libc", - "nix 0.22.3", + "nix 0.24.3", "scoped-tls", "wayland-commons", - "wayland-scanner", - "wayland-sys", + "wayland-scanner 0.29.5", + "wayland-sys 0.29.5", +] + +[[package]] +name = "wayland-client" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bde68449abab1a808e5227b6e295f4ae3680911eb7711b4a2cb90141edb780" +dependencies = [ + "bitflags", + "nix 0.26.2", + "wayland-backend", + "wayland-scanner 0.30.0", ] [[package]] name = "wayland-commons" -version = "0.29.4" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e" +checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" dependencies = [ - "nix 0.22.3", + "nix 0.24.3", "once_cell", "smallvec", - "wayland-sys", + "wayland-sys 0.29.5", ] [[package]] name = "wayland-cursor" -version = "0.29.4" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" +checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" dependencies = [ - "nix 0.22.3", - "wayland-client", + "nix 0.24.3", + "wayland-client 0.29.5", "xcursor", ] [[package]] -name = "wayland-egl" -version = "0.29.4" +name = "wayland-protocols" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83281d69ee162b59031c666385e93bde4039ec553b90c4191cdb128ceea29a3a" +checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" dependencies = [ - "wayland-client", - "wayland-sys", + "bitflags", + "wayland-client 0.29.5", + "wayland-commons", + "wayland-scanner 0.29.5", ] [[package]] -name = "wayland-protocols" -version = "0.29.4" +name = "wayland-scanner" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60147ae23303402e41fe034f74fb2c35ad0780ee88a1c40ac09a3be1e7465741" +checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" dependencies = [ - "bitflags", - "wayland-client", - "wayland-commons", - "wayland-scanner", + "proc-macro2", + "quote", + "xml-rs", ] [[package]] name = "wayland-scanner" -version = "0.29.4" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a1ed3143f7a143187156a2ab52742e89dac33245ba505c17224df48939f9e0" +checksum = "4834c14b3edf1d9986c83ca79b1e7e3afbe9874c7c144702f6467063259ce45d" dependencies = [ "proc-macro2", + "quick-xml", "quote", - "xml-rs", ] [[package]] name = "wayland-sys" -version = "0.29.4" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + +[[package]] +name = "wayland-sys" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4" +checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" dependencies = [ "dlib", "lazy_static", + "log", "pkg-config", ] [[package]] name = "web-sys" -version = "0.3.56" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -2837,17 +2886,18 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.12.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97cd781ff044d6d697b632a2e212032c2e957d1afaa21dbf58069cbb8f78567" +checksum = "81f643110d228fd62a60c5ed2ab56c4d5b3704520bd50561174ec4ec74932937" dependencies = [ - "arrayvec", + "arrayvec 0.7.2", "js-sys", "log", "naga", - "parking_lot", - "raw-window-handle 0.4.2", + "parking_lot 0.12.1", + "raw-window-handle 0.5.0", "smallvec", + "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -2858,46 +2908,47 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.12.2" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4688c000eb841ca55f7b35db659b78d6e1cd77d7caf8fb929f4e181f754047d" +checksum = "6000d1284ef8eec6076fd5544a73125fd7eb9b635f18dceeb829d826f41724ca" dependencies = [ - "arrayvec", + "arrayvec 0.7.2", + "bit-vec", "bitflags", "cfg_aliases", "codespan-reporting", - "copyless", "fxhash", "log", "naga", - "parking_lot", + "parking_lot 0.12.1", "profiling", - "raw-window-handle 0.4.2", + "raw-window-handle 0.5.0", "smallvec", "thiserror", + "web-sys", "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-hal" -version = "0.12.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62fa524903bf336b51a399f0d586f3c30af94101149588678ef147c30be89e53" +checksum = "3cc320a61acb26be4f549c9b1b53405c10a223fbfea363ec39474c32c348d12f" dependencies = [ - "arrayvec", + "android_system_properties", + "arrayvec 0.7.2", "ash", "bit-set", "bitflags", "block", "core-graphics-types", "d3d12", - "foreign-types", + "foreign-types 0.3.2", "fxhash", - "glow 0.11.2", + "glow", "gpu-alloc", "gpu-descriptor", - "inplace_it", "js-sys", "khronos-egl", "libloading", @@ -2905,11 +2956,12 @@ dependencies = [ "metal", "naga", "objc", - "parking_lot", + "parking_lot 0.12.1", "profiling", "range-alloc", - "raw-window-handle 0.4.2", + "raw-window-handle 0.5.0", "renderdoc-sys", + "smallvec", "thiserror", "wasm-bindgen", "web-sys", @@ -2919,25 +2971,13 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.12.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549533d9e1cdd4b4cda7718d33ff500fc4c34b5467b71d76b547ae0324f3b2a2" +checksum = "fb6b28ef22cac17b9109b25b3bf8c9a103eeb293d7c5f78653979b09140375f6" dependencies = [ "bitflags", ] -[[package]] -name = "wgpu_glyph" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8134edb15ae465caf308125646c9e98bdef7398cdefc69227ac77a5eb795e7fe" -dependencies = [ - "bytemuck", - "glyph_brush", - "log", - "wgpu", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2980,46 +3020,171 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a4518b538a45ad39d138a8c3bea8f6b4452174aeb38143d1dd643a3a838ccc" +checksum = "b47d7fb4df5cd1fea61e5ee3841380f54359bac814e227d8f72709f4f193f8cf" dependencies = [ "clipboard-win", "clipboard_macos", "clipboard_wayland", "clipboard_x11", "raw-window-handle 0.3.4", + "thiserror", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "winit" -version = "0.26.0" -source = "git+https://github.com/iced-rs/winit?rev=02a12380960cec2f351c09a33d6a7cc2789d96a6#02a12380960cec2f351c09a33d6a7cc2789d96a6" +version = "0.27.2" +source = "git+https://github.com/iced-rs/winit.git?rev=940457522e9fb9f5dac228b0ecfafe0138b4048c#940457522e9fb9f5dac228b0ecfafe0138b4048c" dependencies = [ "bitflags", "cocoa", - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "core-video-sys", + "core-foundation", + "core-graphics", "dispatch", "instant", - "lazy_static", "libc", "log", "mio", "ndk", "ndk-glue", - "ndk-sys", "objc", - "parking_lot", + "once_cell", + "parking_lot 0.12.1", "percent-encoding", - "raw-window-handle 0.4.2", + "raw-window-handle 0.4.3", + "raw-window-handle 0.5.0", + "sctk-adwaita", "smithay-client-toolkit", "wasm-bindgen", - "wayland-client", + "wayland-client 0.29.5", "wayland-protocols", "web-sys", - "winapi", + "windows-sys 0.36.1", "x11-dl", ] @@ -3034,9 +3199,9 @@ dependencies = [ [[package]] name = "x11-dl" -version = "2.19.1" +version = "2.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" +checksum = "b1536d6965a5d4e573c7ef73a2c15ebcd0b2de3347bdf526c34c297c00ac40f0" dependencies = [ "lazy_static", "libc", @@ -3045,14 +3210,39 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffb080b3f2f616242a4eb8e7d325035312127901025b0052bc3154a282d0f19" +checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" dependencies = [ "gethostname", - "nix 0.20.0", + "nix 0.22.3", + "winapi", + "winapi-wsapoll", +] + +[[package]] +name = "x11rb" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" +dependencies = [ + "gethostname", + "libc", + "libloading", + "nix 0.25.1", + "once_cell", "winapi", "winapi-wsapoll", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" +dependencies = [ + "nix 0.25.1", ] [[package]] @@ -3064,14 +3254,20 @@ dependencies = [ "nom", ] -[[package]] -name = "xi-unicode" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" - [[package]] name = "xml-rs" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + +[[package]] +name = "yazi" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03b3e19c937b5b9bd8e52b1c88f30cce5c0d33d676cf174866175bb794ff658" + +[[package]] +name = "zeno" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c110ba09c9b3a43edd4803d570df0da2414fed6e822e22b976a4e3ef50860701" diff --git a/Cargo.toml b/Cargo.toml index 96fce30..1f59ee7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] dirs-next = "2.0" itertools = "0.10" -palette = "0.5" +palette = "0.6" rand = "0.8" serde_json = "1.0" statrs = "0.15" @@ -25,20 +25,6 @@ version = "1.0" features = ["fs"] [dependencies.iced] -version = "0.3" -features = ["glow", "palette", "tokio"] - -[dependencies.iced_native] -version = "0.4" - -[dependencies.iced_graphics] -version = "0.2" - -[dependencies.iced_futures] -version = "0.3" - -[patch.crates-io] -iced = { git = "https://github.com/hecrj/iced.git", rev = "4aa943cbc63230dfcb995c469ceec9f74e6132e1"} -iced_native = { git = "https://github.com/hecrj/iced.git", rev = "4aa943cbc63230dfcb995c469ceec9f74e6132e1"} -iced_graphics = { git = "https://github.com/hecrj/iced.git", rev = "4aa943cbc63230dfcb995c469ceec9f74e6132e1"} -iced_futures = { git = "https://github.com/hecrj/iced.git", rev = "4aa943cbc63230dfcb995c469ceec9f74e6132e1"} +features = ["palette", "tokio", "wgpu", "tiny-skia"] +git = "https://github.com/hecrj/iced.git" +rev = "0b459c8e240abf83bb62902a504c018194acdbb6" diff --git a/src/data.rs b/src/data.rs index b76319d..92827c5 100644 --- a/src/data.rs +++ b/src/data.rs @@ -26,11 +26,11 @@ pub struct Saved { } impl Saved { - pub fn new(profiles: profile::List, theme: &Theme) -> Self { + pub fn new(profiles: profile::List, theme_name: &str) -> Self { Self { version: VERSION, profiles: profiles.into(), - theme_name: theme.name.clone(), + theme_name: theme_name.to_string(), } } diff --git a/src/data/dictionary.rs b/src/data/dictionary.rs index 4c980bd..f89c745 100644 --- a/src/data/dictionary.rs +++ b/src/data/dictionary.rs @@ -45,7 +45,7 @@ impl Dictionary { words, dist, rng: rand::thread_rng(), - unit_dist: self.unit_dist.clone(), + unit_dist: self.unit_dist, } } @@ -64,7 +64,7 @@ impl Dictionary { words, dist, rng: rand::thread_rng(), - unit_dist: self.unit_dist.clone(), + unit_dist: self.unit_dist, } }) } @@ -84,7 +84,7 @@ impl Dictionary { words, dist, rng: rand::thread_rng(), - unit_dist: self.unit_dist.clone(), + unit_dist: self.unit_dist, } }) } diff --git a/src/data/keyboard.rs b/src/data/keyboard.rs index d909878..6b5e9ce 100644 --- a/src/data/keyboard.rs +++ b/src/data/keyboard.rs @@ -1,7 +1,7 @@ use super::CharSet; use serde::{Deserialize, Serialize}; -#[derive(Debug, Clone, Copy, Eq, PartialEq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Deserialize, Serialize)] pub enum Layout { Colemak, ColemakDH, @@ -9,18 +9,13 @@ pub enum Layout { ColemakOrtholinear, Dvorak, DvorakOrtholinear, + #[default] Qwerty, QwertyOrtholinear, Workman, WorkmanOrtholinear, } -impl Default for Layout { - fn default() -> Self { - Layout::Qwerty - } -} - impl std::fmt::Display for Layout { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let s = match self { @@ -62,7 +57,7 @@ impl Layout { pub fn next_char(&self, char_set: &CharSet) -> Option { self.letter_order() .iter() - .filter(|&letter| !char_set.contains(&letter)) + .filter(|&letter| !char_set.contains(letter)) .cloned() .next() } diff --git a/src/data/profile.rs b/src/data/profile.rs index 3217505..522d4c5 100644 --- a/src/data/profile.rs +++ b/src/data/profile.rs @@ -98,6 +98,10 @@ impl List { self.zipper.len() } + pub fn is_empty(&self) -> bool { + self.zipper.is_empty() + } + fn iter(&self) -> impl Iterator> { self.zipper.iter() } @@ -158,7 +162,7 @@ impl From for Profile { layout: active.layout, difficulty: active.difficulty, state: active.state, - words: active.session.words_setting().clone(), + words: active.session.words_setting(), } } } diff --git a/src/data/random.rs b/src/data/random.rs index 8c5bcd1..246c788 100644 --- a/src/data/random.rs +++ b/src/data/random.rs @@ -122,7 +122,7 @@ fn cumulative(mapping: HashMap) -> Vec<(u16, char)> { .iter() .map(|(letter, ratio)| ((s32 * ratio).round() as u16, letter.chars().next().unwrap())) .collect(); - cumulative.sort_by(|(a, _), (b, _)| b.cmp(&a)); + cumulative.sort_by(|(a, _), (b, _)| b.cmp(a)); let mut c = 0; cumulative .into_iter() diff --git a/src/data/theme.rs b/src/data/theme.rs index 914d039..2006ffd 100644 --- a/src/data/theme.rs +++ b/src/data/theme.rs @@ -3,7 +3,7 @@ use palette::{Mix, Srgb}; #[derive(Debug, Clone)] pub struct Theme { - pub name: String, + pub name: &'static str, pub bg: Color, pub text: Color, pub target: Color, @@ -14,7 +14,12 @@ pub struct Theme { impl Theme { pub fn all() -> Vec { - vec![Self::ayu(), Self::monokai(), Self::tokyo_night(), Self::one_dark()] + vec![ + Self::ayu(), + Self::monokai(), + Self::tokyo_night(), + Self::one_dark(), + ] } pub fn from_name(name: &str) -> Option { @@ -23,7 +28,7 @@ impl Theme { pub fn monokai() -> Self { Self { - name: "Monokai".to_string(), + name: "Monokai", bg: Color::from_rgba8(0x27, 0x28, 0x22, 1.0), text: Color::from_rgba8(0xf8, 0xf8, 0xf2, 1.0), target: Color::from_rgba8(0xa6, 0xe2, 0x2e, 1.0), @@ -35,7 +40,7 @@ impl Theme { pub fn ayu() -> Self { Self { - name: "Ayu".to_string(), + name: "Ayu", bg: Color::from_rgba8(0x0A, 0x0E, 0x14, 1.0), text: Color::from_rgba8(0xB3, 0xB1, 0xAD, 1.0), target: Color::from_rgba8(0xc2, 0xd9, 0x4c, 1.0), @@ -47,7 +52,7 @@ impl Theme { pub fn tokyo_night() -> Self { Self { - name: "Tokyo Night".to_string(), + name: "Tokyo Night", bg: Color::from_rgba8(0x1A, 0x1B, 0x26, 1.0), text: Color::from_rgba8(0xC0, 0xCA, 0xF5, 1.0), target: Color::from_rgba8(0x9E, 0xCE, 0x6A, 1.0), @@ -59,7 +64,7 @@ impl Theme { pub fn one_dark() -> Self { Self { - name: "One Dark".to_string(), + name: "One Dark", bg: Color::from_rgba8(0x28, 0x2C, 0x34, 1.0), text: Color::from_rgba8(0xAB, 0xB2, 0xBF, 1.0), target: Color::from_rgba8(0x98, 0xC3, 0x79, 1.0), @@ -77,15 +82,19 @@ impl Theme { if value < 0.5 { let pct = value / 0.5; let error = Srgb::from(self.error).into_linear(); - return Srgb::from_linear(error.mix(&text, pct)).into(); + Srgb::from_linear(error.mix(&text, pct)).into() } else { let pct = (value - 0.5) / 0.5; let target = Srgb::from(self.target).into_linear(); - return Srgb::from_linear(text.mix(&target, pct)).into(); + Srgb::from_linear(text.mix(&target, pct)).into() } } } +pub fn alpha(color: Color, alpha: f32) -> Color { + Color { a: alpha, ..color } +} + impl Default for Theme { fn default() -> Self { Theme::monokai() diff --git a/src/data/training.rs b/src/data/training.rs index cd1d7f5..2895b5b 100644 --- a/src/data/training.rs +++ b/src/data/training.rs @@ -15,7 +15,7 @@ pub const CLEAN_ALPHA_COEFF: f32 = 1.0 / (1.0 + 10.0); pub const MIN_CLEAN_PCT: f32 = 0.75; const CHARACTERS_PER_WORD: f64 = 5.0; -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct State { /// Which characters are in our set char_set: CharSet, @@ -30,15 +30,16 @@ pub struct State { #[derive(Debug, Clone, Copy, Default, PartialEq, PartialOrd, Deserialize, Serialize)] pub struct WordsPerMinute(f64); -#[derive(Debug, Clone, Copy, Eq, PartialEq, PartialOrd, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, PartialOrd, Deserialize, Serialize)] pub enum Difficulty { Easy, Casual, + #[default] Normal, Strict, } -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, Deserialize, Serialize)] pub struct Stats { raw: Vec, pub wpm_mean: WordsPerMinute, @@ -86,6 +87,7 @@ pub struct Session { #[derive(Debug, Clone)] pub struct Line { hits: Vec, + #[allow(dead_code)] time: OffsetDateTime, } @@ -95,6 +97,7 @@ pub struct Hit { /// The character to type target: char, /// The previous character typed + #[allow(dead_code)] prev: char, /// Incorrect keys hit instead of the target misses: CharSet, @@ -255,12 +258,6 @@ impl Difficulty { } } -impl Default for Difficulty { - fn default() -> Self { - Self::Normal - } -} - impl std::fmt::Display for Difficulty { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let s = match self { @@ -290,16 +287,6 @@ impl Stats { } } -impl Default for Stats { - fn default() -> Self { - Self { - raw: Vec::new(), - wpm_mean: WordsPerMinute::default(), - wpm_harmonic_mean: WordsPerMinute::default(), - } - } -} - impl Event { fn unlock(letter: char) -> Self { Self::Unlock { @@ -439,7 +426,7 @@ pub struct TriplePoint { impl TriplePoint { pub fn new(lower: f32, mid: f32, upper: f32) -> Option { - (lower < mid && mid < upper).then(|| Self { lower, mid, upper }) + (lower < mid && mid < upper).then_some(Self { lower, mid, upper }) } /// Map values on two linear scales between [lower, mid] and [mid, upper] diff --git a/src/data/zipper_list.rs b/src/data/zipper_list.rs index 472437f..927eb8d 100644 --- a/src/data/zipper_list.rs +++ b/src/data/zipper_list.rs @@ -24,12 +24,17 @@ impl ZipperList { self.prev.len() + 1 + self.next.len() } + pub fn is_empty(&self) -> bool { + // Zipper List cannot be empty, by definition + false + } + pub fn iter(&self) -> impl Iterator> { self.prev .iter() - .map(|item| Item::Other(item)) + .map(Item::Other) .chain(std::iter::once(Item::Current(&self.current))) - .chain(self.next.iter().map(|item| Item::Other(item))) + .chain(self.next.iter().map(Item::Other)) } pub fn push(&mut self, item: T) { @@ -51,7 +56,7 @@ where next.append(&mut self.next); self.next = next; true - } else if index >= self.prev.len() + 1 && index < self.len() { + } else if index > self.prev.len() && index < self.len() { let index = index - self.prev.len() - 1; let next_current = self.next.remove(index); let old_current = std::mem::replace(&mut self.current, next_current.into()); diff --git a/src/font.rs b/src/font.rs index a5e22d1..1c509c9 100644 --- a/src/font.rs +++ b/src/font.rs @@ -1,19 +1,42 @@ -use iced::Font; - /// Iosevka Fixed Extended Thin - Weight 100 -pub const THIN: Font = Font::External { - name: "Iosevka Extended Thin", - bytes: include_bytes!("../fonts/iosevka-fixed-extendedthin.ttf"), -}; +// name: "Iosevka Extended Thin", +pub const THIN: &[u8] = include_bytes!("../fonts/iosevka-fixed-extendedthin.ttf"); /// Iosevka Fixed Extended Light - Weight 300 -pub const LIGHT: Font = Font::External { - name: "Iosevka Extended Light", - bytes: include_bytes!("../fonts/iosevka-fixed-extendedlight.ttf"), -}; +// name: "Iosevka Extended Light", +pub const LIGHT: &[u8] = include_bytes!("../fonts/iosevka-fixed-extendedlight.ttf"); /// Iosevka Fixed Extended Medium - Weight 500 -pub const MEDIUM: Font = Font::External { - name: "Iosevka Extended Medium", - bytes: include_bytes!("../fonts/iosevka-fixed-extendedmedium.ttf"), -}; +// name: "Iosevka Extended Medium", +pub const MEDIUM: &[u8] = include_bytes!("../fonts/iosevka-fixed-extendedmedium.ttf"); + +pub enum Font { + Thin, + Light, + Medium, +} + +impl Font { + fn name(&self) -> &'static str { + "Iosevka Fixed" + } + + fn weight(&self) -> iced::font::Weight { + match self { + Font::Thin => iced::font::Weight::Thin, + Font::Light => iced::font::Weight::Light, + Font::Medium => iced::font::Weight::Medium, + } + } +} + +impl From for iced::Font { + fn from(font: Font) -> Self { + iced::Font { + family: iced::font::Family::Name(font.name()), + weight: font.weight(), + stretch: iced::font::Stretch::Expanded, + monospaced: true, + } + } +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..d9c62bb --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,6 @@ +pub mod data; +pub mod font; +pub mod screen; +pub mod style; + +pub type Element<'a, Message> = iced::Element<'a, Message, iced::Renderer>; diff --git a/src/main.rs b/src/main.rs index e853d5c..6e9ee5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,26 +1,15 @@ use iced::executor; -use iced::{self, Application, Command, Container, Element, Length, Settings, Subscription}; -use iced_native; -use iced_native::window; +use iced::widget::Container; +use iced::window; +use iced::{self, Application, Command, Element, Length, Settings, Subscription}; -mod data; -mod font; -mod screen; -mod style; - -use data::profile; -use data::Theme; -use screen::Screen; +use linkage::data::{self, profile}; +use linkage::screen::{self, Screen}; +use linkage::{font, style}; pub fn main() -> iced::Result { - let default_font = if let iced::Font::External { bytes, .. } = font::LIGHT { - Some(bytes) - } else { - None - }; - Linkage::run(Settings { - default_font, + default_font: font::Font::Light.into(), exit_on_close_request: false, window: iced::window::Settings { min_size: Some((screen::training::OVERALL_WIDTH as u32, 256)), @@ -32,15 +21,16 @@ pub fn main() -> iced::Result { #[derive(Debug)] struct Linkage { - should_exit: bool, screen: Screen, - theme: Theme, + theme: style::Theme, profiles: profile::List, } #[derive(Debug, Clone)] +#[allow(clippy::large_enum_variant)] enum Message { - Event(iced_native::Event), + Event(iced::Event), + FontLoaded(Result<(), iced::font::Error>), Saved, Screen(screen::Message), } @@ -48,20 +38,25 @@ enum Message { impl Application for Linkage { type Executor = executor::Default; type Message = Message; + type Theme = style::Theme; type Flags = (); fn new(_: ()) -> (Linkage, Command) { let linkage = Linkage { - should_exit: false, screen: Screen::new(), - theme: Theme::monokai(), + theme: Default::default(), profiles: profile::List::default(), }; ( linkage, - Command::perform(screen::loading::load(), |message| { - Message::Screen(screen::Message::Loading(message)) - }), + Command::batch(vec![ + iced::font::load(font::THIN).map(Message::FontLoaded), + iced::font::load(font::LIGHT).map(Message::FontLoaded), + iced::font::load(font::MEDIUM).map(Message::FontLoaded), + Command::perform(screen::loading::load(), |message| { + Message::Screen(screen::Message::Loading(message)) + }), + ]), ) } @@ -72,6 +67,11 @@ impl Application for Linkage { fn update(&mut self, message: Message) -> Command { match message { Message::Event(event) => self.handle_event(event), + Message::FontLoaded(Ok(_)) => Command::none(), + Message::FontLoaded(Err(_)) => { + eprintln!("Could not load font."); + Command::none() + } Message::Saved => Command::none(), Message::Screen(message) => { let Linkage { @@ -80,15 +80,12 @@ impl Application for Linkage { profiles, .. } = self; - if let Some(event) = screen.update(profiles, message) { + if let Some(event) = screen.update(profiles, message, theme.name()) { match event { - screen::Event::ExitRequested => { - self.prepare_close(); - Command::none() - } + screen::Event::ExitRequested => self.prepare_close(), screen::Event::Save => self.save(), screen::Event::SelectTheme(new_theme) => { - *theme = new_theme; + *theme = style::Theme::new(new_theme); self.save() } } @@ -102,56 +99,50 @@ impl Application for Linkage { fn subscription(&self) -> Subscription { Subscription::batch(vec![ self.screen.subscription().map(Message::Screen), - iced_native::subscription::events().map(Message::Event), + iced::subscription::events().map(Message::Event), ]) } - fn should_exit(&self) -> bool { - self.should_exit - } - - fn view(&mut self) -> Element { + fn view(&self) -> Element> { let Linkage { - screen, - theme, - profiles, - .. + screen, profiles, .. } = self; - let content = screen.view(profiles, theme).map(Message::Screen); + let content = screen.view(profiles).map(Message::Screen); Container::new(content) .width(Length::Fill) .height(Length::Fill) .center_x() .center_y() - .style(style::container::primary(&self.theme)) + .style(style::Container::Primary) .into() } + + fn theme(&self) -> Self::Theme { + self.theme.clone() + } } impl Linkage { - fn handle_event(&mut self, event: iced_native::Event) -> Command { + fn handle_event(&mut self, event: iced::Event) -> Command { use iced::keyboard::{self, KeyCode}; - use iced_native::event::Event; + use iced::Event; match event { Event::Window(window::Event::CloseRequested) => { return self.prepare_close(); } - Event::Keyboard(keyboard_event) => match keyboard_event { - keyboard::Event::KeyPressed { - key_code, - modifiers, - } => match key_code { - KeyCode::Escape => { - return self.go_back(); - } - #[cfg(target_os = "macos")] - KeyCode::Q if modifiers.command() => { - return self.prepare_close(); - } - _ => {} - }, + Event::Keyboard(keyboard::Event::KeyPressed { + key_code, + modifiers, + }) => match key_code { + KeyCode::Escape => { + return self.go_back(); + } + #[cfg(target_os = "macos")] + KeyCode::Q if modifiers.command() => { + return self.prepare_close(); + } _ => {} }, _ => {} @@ -161,9 +152,10 @@ impl Linkage { } fn prepare_close(&mut self) -> Command { + use iced::widget::runtime::command; + println!("Preparing to close."); - self.should_exit = true; - Command::none() + Command::single(command::Action::Window(window::Action::Close)) } fn go_back(&mut self) -> Command { @@ -172,7 +164,7 @@ impl Linkage { } fn save(&self) -> Command { - let saved = data::Saved::new(self.profiles.clone(), &self.theme); + let saved = data::Saved::new(self.profiles.clone(), self.theme.name()); Command::perform(save(saved), |_| Message::Saved) } } diff --git a/src/screen.rs b/src/screen.rs index e6ab7fb..530df98 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -1,6 +1,8 @@ use crate::data::profile; use crate::data::Theme; -use iced::{Element, Subscription}; +use crate::Element; + +use iced::Subscription; pub mod loading; mod settings; @@ -19,6 +21,7 @@ pub enum Screen { } #[derive(Debug, Clone)] +#[allow(clippy::large_enum_variant)] pub enum Message { Loading(loading::Message), Settings(settings::Message), @@ -45,72 +48,74 @@ impl Screen { } pub fn go_back(&mut self, profiles: &profile::List) { - match self { - Screen::Settings(..) => { - *self = Screen::training(profiles); - } - _ => {} + if let Screen::Settings(_) = self { + *self = Screen::training(profiles); } } - pub fn update(&mut self, profiles: &mut profile::List, message: Message) -> Option { + pub fn update( + &mut self, + profiles: &mut profile::List, + message: Message, + active: &'static str, + ) -> Option { match self { - Screen::Loading(state) => match message { - Message::Loading(message) => match state.update(message) { - Some(event) => match event { - loading::Event::Load { - profiles: loaded, - theme, - } => { - *profiles = loaded; - *self = Screen::training(&profiles); - return Some(Event::SelectTheme(theme)); - } - }, - None => {} - }, - _ => {} - }, - Screen::Training(state) => match message { - Message::Training(message) => match state.update(profiles, message) { - Some((_command, event)) => match event { - training::Event::Save => { - return Some(Event::Save); - } - training::Event::Settings => { - *self = Screen::settings(); - } - }, - None => {} - }, - _ => {} - }, - Screen::Settings(state) => match message { - Message::Settings(message) => match state.update(profiles, message) { - Some(event) => match event { - settings::Event::Exit => { - *self = Screen::training(&profiles); + Screen::Loading(state) => { + if let Message::Loading(message) = message { + if let Some(event) = state.update(message) { + match event { + loading::Event::Load { + profiles: loaded, + theme, + } => { + *profiles = loaded; + *self = Screen::training(profiles); + return Some(Event::SelectTheme(theme)); + } } - settings::Event::Save => { - return Some(Event::Save); + } + } + } + Screen::Training(state) => { + if let Message::Training(message) = message { + if let Some((_command, event)) = state.update(profiles, message) { + match event { + training::Event::Save => { + return Some(Event::Save); + } + training::Event::Settings => { + *self = Screen::settings(); + } } - settings::Event::SelectTheme(theme) => { - return Some(Event::SelectTheme(theme)); + } + } + } + Screen::Settings(state) => { + if let Message::Settings(message) = message { + if let Some(event) = state.update(profiles, message, active) { + match event { + settings::Event::Exit => { + *self = Screen::training(profiles); + } + settings::Event::Save => { + return Some(Event::Save); + } + settings::Event::SelectTheme(theme) => { + return Some(Event::SelectTheme(theme)); + } } - }, - None => {} - }, - _ => {} - }, + } + } + } } None } - pub fn view(&mut self, profiles: &profile::List, theme: &Theme) -> Element { + pub fn view(&self, profiles: &profile::List) -> Element { match self { - Screen::Loading(loading) => loading.view(theme).map(Message::Loading), - Screen::Settings(state) => state.view(profiles, theme).map(Message::Settings), - Screen::Training(state) => state.view(profiles, theme).map(Message::Training), + Screen::Loading(loading) => loading.view().map(Message::Loading), + Screen::Settings(state) => state.view(profiles).map(Message::Settings), + Screen::Training(state) => state.view(profiles).map(Message::Training), } } @@ -121,3 +126,9 @@ impl Screen { } } } + +impl Default for Screen { + fn default() -> Self { + Screen::new() + } +} diff --git a/src/screen/loading.rs b/src/screen/loading.rs index 1b50036..3bde465 100644 --- a/src/screen/loading.rs +++ b/src/screen/loading.rs @@ -1,10 +1,11 @@ use crate::data; use crate::data::profile; use crate::data::Theme; +use crate::Element; -use iced::{Element, Text}; +use iced::widget::text; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct State {} #[derive(Debug, Clone)] @@ -29,8 +30,8 @@ impl State { Self {} } - pub fn view(&mut self, _theme: &Theme) -> Element { - Text::new("Loading").into() + pub fn view(&self) -> Element { + text("Loading").into() } pub fn update(&mut self, message: Message) -> Option { diff --git a/src/screen/settings.rs b/src/screen/settings.rs index 51b2270..aae9646 100644 --- a/src/screen/settings.rs +++ b/src/screen/settings.rs @@ -1,9 +1,9 @@ use crate::data::{self, Theme}; use crate::style; +use crate::Element; -use iced::button::{self, Button}; -use iced::scrollable::{self, Scrollable}; -use iced::{Column, Container, Element, Length, Row, Rule, Text}; +use iced::widget::{container, Button, Column, Container, Row, Rule, Scrollable, Text}; +use iced::Length; mod profile; mod theme; @@ -11,9 +11,6 @@ mod theme; #[derive(Debug)] pub struct State { screen: Screen, - back_button: button::State, - menu_buttons: Vec, - menu_scroll: scrollable::State, } #[derive(Debug)] @@ -41,9 +38,6 @@ impl State { pub fn new() -> Self { Self { screen: Screen::profile(), - back_button: button::State::new(), - menu_buttons: Vec::new(), - menu_scroll: scrollable::State::new(), } } @@ -51,6 +45,7 @@ impl State { &mut self, profiles: &mut data::profile::List, message: Message, + active: &'static str, ) -> Option { let State { ref mut screen, .. } = self; match message { @@ -79,23 +74,18 @@ impl State { } } Message::ThemesPressed => { - *screen = Screen::theme(); + *screen = Screen::theme(active); } } None } - pub fn view(&mut self, profiles: &data::profile::List, theme: &Theme) -> Element { - let State { - screen, - back_button, - menu_buttons, - menu_scroll, - } = self; + pub fn view(&self, profiles: &data::profile::List) -> Element { + let State { screen } = self; - let back_button = Button::new(back_button, Text::new("\u{2190} Back").size(14)) + let back_button = Button::new(Text::new("\u{2190} Back").size(14)) .on_press(Message::BackButtonPressed) - .style(style::button::text(theme)) + .style(style::Button::Text) .padding(10); let menu_items = vec![ @@ -111,13 +101,10 @@ impl State { }, ]; - menu_buttons.resize(menu_items.len(), button::State::new()); - let menu = Column::with_children( menu_items .into_iter() - .zip(menu_buttons) - .map(|(item, state)| { + .map(|item| { let MenuItem { label, message, @@ -129,12 +116,12 @@ impl State { .center_y(); if is_active { Container::new(text) - .style(style::container::menu_selected(theme)) + .style(style::Container::MenuSelected) .width(Length::Fill) .into() } else { - Button::new(state, text) - .style(style::button::menu(theme, is_active)) + Button::new(text) + .style(style::Button::Menu { selected: false }) .width(Length::Fill) .on_press(message) .padding(0) @@ -143,21 +130,18 @@ impl State { }) .collect(), ); - let menu = Scrollable::new(menu_scroll) - .push(menu) - .height(Length::Fill) - .width(Length::Units(125)); + let menu = container(Scrollable::new(menu).height(Length::Fill)).width(125); let content = Row::new() .push(menu) - .push(Rule::vertical(0).style(style::rule::divider(theme))) - .push(screen.view(profiles, theme)) + .push(Rule::vertical(1).style(style::Rule::Divider)) + .push(screen.view(profiles)) .height(Length::Fill) .width(Length::Fill); Column::new() .push(back_button) - .push(Rule::horizontal(0).style(style::rule::divider(theme))) + .push(Rule::horizontal(1).style(style::Rule::Divider)) .push(content) .width(Length::Fill) .height(Length::Fill) @@ -165,6 +149,12 @@ impl State { } } +impl Default for State { + fn default() -> Self { + State::new() + } +} + struct MenuItem { pub label: &'static str, pub message: Message, @@ -176,14 +166,14 @@ impl Screen { Screen::Profile(profile::State::new()) } - fn theme() -> Self { - Screen::Theme(theme::State::new()) + fn theme(active: &'static str) -> Self { + Screen::Theme(theme::State::new(active)) } - fn view(&mut self, profiles: &data::profile::List, theme: &Theme) -> Element { + fn view(&self, profiles: &data::profile::List) -> Element { match self { - Screen::Profile(state) => state.view(profiles, theme).map(Message::Profile), - Screen::Theme(state) => state.view(theme).map(Message::Theme), + Screen::Profile(state) => state.view(profiles).map(Message::Profile), + Screen::Theme(state) => state.view().map(Message::Theme), } } } diff --git a/src/screen/settings/profile.rs b/src/screen/settings/profile.rs index dc0bd08..7393743 100644 --- a/src/screen/settings/profile.rs +++ b/src/screen/settings/profile.rs @@ -1,53 +1,37 @@ use crate::data::keyboard::{self, Layout}; +use crate::data::profile; use crate::data::training::Difficulty; -use crate::data::{self, Theme}; use crate::font; use crate::style; -use iced::button::{self, Button}; -use iced::pick_list::{self, PickList}; -use iced::scrollable::{self, Scrollable}; -use iced::text_input::{self, TextInput}; -use iced::{Column, Container, Element, Length, Row, Rule, Text}; +use crate::Element; + +use iced::widget::{ + container, Button, Column, Container, PickList, Row, Rule, Scrollable, Text, TextInput, +}; +use iced::Length; #[derive(Debug)] pub struct State { menu: Menu, - content_scroll: scrollable::State, screen: Screen, } #[derive(Debug)] -pub struct Menu { - buttons: Vec, - new_button: button::State, - scroll: scrollable::State, -} +pub struct Menu {} #[derive(Debug)] pub enum Screen { Create { - accept: button::State, - cancel: button::State, difficulty: Option, - difficulty_pick_list: pick_list::State, layout: Option, - layout_pick_list: pick_list::State, - name_input: text_input::State, - name_parsed: Option, + name_parsed: Option, name_value: String, }, Rename { - accept: button::State, - cancel: button::State, - name_input: text_input::State, - name_parsed: Option, + name_parsed: Option, name_value: String, }, - View { - difficulty_pick_list: pick_list::State, - rename_button: button::State, - // delete_button - }, + View, } #[derive(Debug, Clone)] @@ -68,12 +52,11 @@ impl State { pub fn new() -> Self { Self { menu: Menu::new(), - content_scroll: scrollable::State::new(), screen: Screen::viewing(), } } - pub fn update(&mut self, profiles: &mut data::profile::List, message: Message) -> bool { + pub fn update(&mut self, profiles: &mut profile::List, message: Message) -> bool { match message { Message::CreateAccept => { if let Screen::Create { @@ -83,8 +66,7 @@ impl State { .. } = &self.screen { - let profile = - data::profile::Profile::new(name_parsed.clone(), *layout, *difficulty); + let profile = profile::Profile::new(name_parsed.clone(), *layout, *difficulty); profiles.insert_active(profile); self.screen = Screen::viewing(); @@ -125,7 +107,7 @@ impl State { .. } => { *name_parsed = None; - if let Some(name) = data::profile::Name::parse(&new_name) { + if let Some(name) = profile::Name::parse(&new_name) { if !profiles.contains_name(&name) { *name_parsed = Some(name); } @@ -164,24 +146,21 @@ impl State { false } - pub fn view(&mut self, profiles: &data::profile::List, theme: &Theme) -> Element { - let State { - menu, - content_scroll, - screen, - } = self; + pub fn view(&self, profiles: &profile::List) -> Element { + let State { menu, screen } = self; - let menu = menu.view(profiles, theme); + let menu = menu.view(profiles); - let content = Scrollable::new(content_scroll) - .width(Length::Fill) - .height(Length::Fill) - .padding(10) - .push(screen.view(profiles, theme)); + let content = Scrollable::new( + container(screen.view(profiles)) + .width(Length::Fill) + .padding(10), + ) + .height(Length::Fill); Row::new() .push(menu) - .push(Rule::vertical(0).style(style::rule::divider(theme))) + .push(Rule::vertical(0).style(style::Rule::Divider)) .push(content) .height(Length::Fill) .width(Length::Fill) @@ -191,40 +170,29 @@ impl State { impl Menu { fn new() -> Self { - Self { - buttons: Vec::new(), - new_button: button::State::new(), - scroll: scrollable::State::new(), - } + Self {} } - fn view(&mut self, profiles: &data::profile::List, theme: &Theme) -> Element { - let Menu { - buttons, - new_button, - scroll, - } = self; - - buttons.resize(profiles.len(), button::State::new()); - + fn view(&self, profiles: &profile::List) -> Element { let menu = Column::with_children( profiles .names() - .zip(buttons.iter_mut()) .enumerate() - .map(|(i, ((name, is_active), state))| { - let text = Container::new(Text::new(name).size(14)) + .map(|(i, (name, is_active))| { + let text = Container::new(Text::new(name.to_string()).size(14)) .padding(6) .center_x() .center_y(); if is_active { Container::new(text) - .style(style::container::menu_selected(theme)) + .style(style::Container::MenuSelected) .width(Length::Fill) .into() } else { - Button::new(state, text) - .style(style::button::menu(theme, is_active)) + Button::new(text) + .style(style::Button::Menu { + selected: is_active, + }) .on_press(Message::ProfilePressed(i)) .width(Length::Fill) .padding(0) @@ -235,16 +203,13 @@ impl Menu { ) .width(Length::Fill); - let new_button = Button::new(new_button, Text::new("+ New Profile").size(14)) - .style(style::button::menu(theme, false)) + let new_button = Button::new(Text::new("+ New Profile").size(14)) + .style(style::Button::Menu { selected: false }) .on_press(Message::NewProfilePressed) .width(Length::Fill); - Scrollable::new(scroll) - .push(menu) - .push(new_button) + Scrollable::new(Column::new().push(menu).push(new_button).width(175)) .height(Length::Fill) - .width(Length::Units(175)) .into() } } @@ -252,13 +217,10 @@ impl Menu { impl Screen { fn creating() -> Self { Self::Create { - accept: button::State::new(), - cancel: button::State::new(), difficulty: Some(Difficulty::default()), - difficulty_pick_list: pick_list::State::default(), + layout: None, - layout_pick_list: pick_list::State::default(), - name_input: text_input::State::new(), + name_parsed: None, name_value: String::new(), } @@ -266,79 +228,55 @@ impl Screen { fn renaming(name_value: String) -> Self { Self::Rename { - accept: button::State::new(), - cancel: button::State::new(), - name_input: text_input::State::new(), name_parsed: None, name_value, } } fn viewing() -> Self { - Self::View { - difficulty_pick_list: pick_list::State::default(), - rename_button: button::State::new(), - } + Self::View } - fn view(&mut self, profiles: &data::profile::List, theme: &Theme) -> Element { + fn view(&self, profiles: &profile::List) -> Element { let mut content = Column::new().width(Length::Fill).spacing(20); match self { Screen::Create { - accept, - cancel, difficulty, - difficulty_pick_list, layout, - layout_pick_list, - name_input, name_parsed, name_value, } => { - let name_input = - TextInput::new(name_input, "Profile Name", name_value, Message::NameInput) - .style(style::text_input::themed(theme)) - .width(Length::Fill) - .padding(6) - .size(18); - - let layout_title = Text::new("Keyboard Layout").size(14).font(font::THIN); - let layout_pick_list = PickList::new( - layout_pick_list, - keyboard::ALL, - *layout, - Message::LayoutChanged, - ) - .text_size(15) - .style(style::pick_list::themed(theme)); + let name_input = TextInput::new("Profile Name", name_value, Message::NameInput) + .width(Length::Fill) + .padding(6) + .size(18); + + let layout_title = Text::new("Keyboard Layout").size(14).font(font::Font::Thin); + let layout_pick_list = + PickList::new(keyboard::ALL, *layout, Message::LayoutChanged).text_size(15); let layout_section = Column::new() .spacing(5) .push(layout_title) .push(layout_pick_list); - let difficulty_title = Text::new("Difficulty").size(14).font(font::THIN); - let difficulty_pick_list = PickList::new( - difficulty_pick_list, - Difficulty::ALL, - *difficulty, - Message::DifficultyChanged, - ) - .text_size(15) - .style(style::pick_list::themed(theme)); + let difficulty_title = Text::new("Difficulty").size(14).font(font::Font::Thin); + let difficulty_pick_list = + PickList::new(Difficulty::ALL, *difficulty, Message::DifficultyChanged) + .text_size(15); let difficulty_section = Column::new() .spacing(5) .push(difficulty_title) .push(difficulty_pick_list); - let mut accept = Button::new(accept, centered_text("\u{2714}", 20, 20)) - .style(style::button::accept(theme)); + let mut accept = + Button::new(centered_text("\u{2714}", 24, 20)).style(style::Button::Accept); if name_parsed.is_some() && layout.is_some() { accept = accept.on_press(Message::CreateAccept); } - let cancel = Button::new(cancel, centered_text("\u{2716}", 20, 20)) - .style(style::button::reject(theme)) + let cancel = Button::new(centered_text("\u{2716}", 24, 20)) + .style(style::Button::Reject) .on_press(Message::CreateCancel); let button_row = Row::new().push(accept).push(cancel).spacing(5); @@ -350,29 +288,24 @@ impl Screen { .push(button_row); } Screen::Rename { - accept, - cancel, - name_input, name_parsed, name_value, } => { - let mut name_input = - TextInput::new(name_input, "Profile Name", name_value, Message::NameInput) - .style(style::text_input::themed(theme)) - .width(Length::Fill) - .padding(6) - .size(18); + let mut name_input = TextInput::new("Profile Name", name_value, Message::NameInput) + .width(Length::Fill) + .padding(6) + .size(18); - let mut accept = Button::new(accept, centered_text("\u{2714}", 20, 20)) - .style(style::button::accept(theme)); + let mut accept = + Button::new(centered_text("\u{2714}", 24, 20)).style(style::Button::Accept); if name_parsed.is_some() { name_input = name_input.on_submit(Message::RenameAccept); accept = accept.on_press(Message::RenameAccept); } - let cancel = Button::new(cancel, centered_text("\u{2716}", 20, 20)) - .style(style::button::reject(theme)) + let cancel = Button::new(centered_text("\u{2716}", 24, 20)) + .style(style::Button::Reject) .on_press(Message::RenameCancel); let name_row = Row::new() @@ -383,19 +316,14 @@ impl Screen { content = content.push(name_row); } - Screen::View { - difficulty_pick_list, - rename_button, - } => { - let rename_button = Button::new( - rename_button, - Text::new(profiles.active().name.to_string()).size(18), - ) - .style(style::button::text(theme)) - .on_press(Message::RenamePressed) - .padding(6); - - let layout_title = Text::new("Keyboard Layout").size(14).font(font::THIN); + Screen::View => { + let rename_button = + Button::new(Text::new(profiles.active().name.to_string()).size(18)) + .style(style::Button::Text) + .on_press(Message::RenamePressed) + .padding(6); + + let layout_title = Text::new("Keyboard Layout").size(14).font(font::Font::Thin); let layout_name = Text::new(profiles.active().layout.to_string()).size(16); let layout_section = Column::new() .padding([0, 0, 0, 6]) @@ -403,16 +331,15 @@ impl Screen { .push(layout_title) .push(layout_name); - let difficulty_title = Text::new("Difficulty").size(14).font(font::THIN); + let difficulty_title = Text::new("Difficulty").size(14).font(font::Font::Thin); let difficulty_pick_list = PickList::new( - difficulty_pick_list, Difficulty::ALL, Some(profiles.active().difficulty), Message::DifficultyChanged, ) - .text_size(15) - .style(style::pick_list::themed(theme)); + .text_size(15); let difficulty_section = Column::new() + .padding([0, 0, 0, 6]) .spacing(5) .push(difficulty_title) .push(difficulty_pick_list); @@ -428,10 +355,11 @@ impl Screen { } } -fn centered_text(s: &str, size: u16, side: u16) -> Container { +fn centered_text(s: &str, size: u16, side: u16) -> Element { Container::new(Text::new(s).size(size)) - .width(Length::Units(side)) - .height(Length::Units(side)) + .width(side) + .height(side) .center_x() .center_y() + .into() } diff --git a/src/screen/settings/theme.rs b/src/screen/settings/theme.rs index d101543..0a03af0 100644 --- a/src/screen/settings/theme.rs +++ b/src/screen/settings/theme.rs @@ -1,14 +1,13 @@ use crate::data::Theme; -use crate::style; -use iced::button::{self, Button}; -use iced::scrollable::{self, Scrollable}; -use iced::{Alignment, Column, Container, Element, Length, Row, Space, Text}; +use crate::{style, Element}; + +use iced::widget::{Button, Column, Container, Row, Scrollable, Space, Text}; +use iced::{Alignment, Length}; #[derive(Debug)] pub struct State { - buttons: Vec, - scroll: scrollable::State, themes: Vec, + active: &'static str, } #[derive(Debug, Clone)] @@ -21,21 +20,17 @@ pub enum Event { } impl State { - pub fn new() -> Self { + pub fn new(active: &'static str) -> Self { let themes = Theme::all(); - let buttons = vec![button::State::new(); themes.len()]; - Self { - buttons, - scroll: scrollable::State::new(), - themes, - } + Self { themes, active } } pub fn update(&mut self, message: Message) -> Option { match message { Message::ThemePressed(index) => { if let Some(theme) = self.themes.get(index) { + self.active = theme.name; return Some(Event::SelectTheme(theme.clone())); } } @@ -43,53 +38,70 @@ impl State { None } - pub fn view(&mut self, theme: &Theme) -> Element { + pub fn view(&self) -> Element { let title = Container::new(Text::new("Theme").size(18)).padding(6); let buttons = Column::with_children( self.themes .iter() .enumerate() - .zip(self.buttons.iter_mut()) - .map(|((i, th), state)| { - let mut text = Row::new() - .push(Text::new("\u{25a0}").size(18).color(th.target)) - .push(Text::new("\u{25a0}").size(18).color(th.miss)) - .push(Text::new("\u{25a0}").size(18).color(th.error)) - .push(Text::new(th.name.clone()).size(16)) + .map(|(i, th)| { + let mut content = Row::new() + .push( + Text::new("\u{25a0}") + .size(18) + .style(style::Text::Override(th.target)), + ) + .push( + Text::new("\u{25a0}") + .size(18) + .style(style::Text::Override(th.miss)), + ) + .push( + Text::new("\u{25a0}") + .size(18) + .style(style::Text::Override(th.error)), + ) + .push( + Text::new(th.name) + .size(16) + .style(style::Text::Override(th.text)), + ) .spacing(5) .align_items(Alignment::Center); - if theme.name == th.name { - text = text + if self.active == th.name { + content = content .push(Space::with_width(Length::Fill)) - .push(Text::new("\u{25cf}").size(18).color(th.text)); + .push(Text::new("\u{25cf}").size(18)); } Container::new( - Button::new(state, text) + Button::new(content) .on_press(Message::ThemePressed(i)) - .style(style::button::basic(th)) + .style(style::Button::ThemePreview(th.clone())) .width(Length::Fill) .padding([3, 7, 3, 7]), ) - .style(style::container::primary(th)) + .style(style::Container::theme_preview(th)) .width(Length::Fill) .into() }) .collect(), ) - .width(Length::Units(175)) + .width(225) .spacing(7) .padding([0, 0, 0, 6]); - Scrollable::new(&mut self.scroll) - .push(title) - .push(buttons) - .height(Length::Fill) - .width(Length::Fill) - .spacing(20) - .padding(10) - .into() + Scrollable::new( + Column::new() + .push(title) + .push(buttons) + .width(Length::Fill) + .spacing(20) + .padding(10), + ) + .height(Length::Fill) + .into() } } diff --git a/src/screen/training.rs b/src/screen/training.rs index e6f1fd4..116ff08 100644 --- a/src/screen/training.rs +++ b/src/screen/training.rs @@ -1,18 +1,18 @@ use crate::data::profile; use crate::data::training::{Difficulty, TriplePoint, CHARS_PER_LINE, MAX_ERRORS, MIN_CLEAN_PCT}; -use crate::data::Theme; use crate::font; use crate::style; +use crate::Element; + use iced::alignment::{self, Alignment}; -use iced::button::{self, Button}; use iced::keyboard::{self, KeyCode}; -use iced::{Column, Command, Container, Element, Length, Row, Space, Subscription, Text}; +use iced::widget::{Button, Column, Container, Row, Space, Text}; +use iced::{Command, Length, Subscription}; use itertools::{EitherOrBoth, Itertools}; #[derive(Debug)] pub struct State { modifiers: keyboard::Modifiers, - settings_button: button::State, accuracy_metric: TriplePoint, wpm_metric: TriplePoint, } @@ -42,7 +42,6 @@ impl State { pub fn new(difficulty: &Difficulty) -> Self { Self { modifiers: keyboard::Modifiers::default(), - settings_button: button::State::new(), accuracy_metric: TriplePoint::new(0.5, MIN_CLEAN_PCT, 0.975).unwrap_or_default(), wpm_metric: TriplePoint::new( 10.0, @@ -67,7 +66,7 @@ impl State { } } - pub fn view(&mut self, profiles: &profile::List, theme: &Theme) -> Element { + pub fn view(&self, profiles: &profile::List) -> Element { let active_line = Row::with_children( profiles .session() @@ -75,12 +74,12 @@ impl State { .iter() .map(|hit| { Text::new(hit.target().to_string()) - .width(Length::Units(CHAR_WIDTH)) - .font(font::THIN) - .color(if hit.is_dirty() { - theme.miss + .width(CHAR_WIDTH) + .font(font::Font::Thin) + .style(if hit.is_dirty() { + style::Text::Miss } else { - theme.text + style::Text::Default }) }) .chain( @@ -96,13 +95,11 @@ impl State { EitherOrBoth::Left(e) | EitherOrBoth::Both(e, _) => { let c = if *e == ' ' { '\u{2591}' } else { *e }; Text::new(c.to_string()) - .width(Length::Units(CHAR_WIDTH)) - .font(font::MEDIUM) - .color(theme.error) - } - EitherOrBoth::Right(t) => { - Text::new(t.to_string()).width(Length::Units(CHAR_WIDTH)) + .width(CHAR_WIDTH) + .font(font::Font::Medium) + .style(style::Text::Error) } + EitherOrBoth::Right(t) => Text::new(t.to_string()).width(CHAR_WIDTH), }), ) .map(|text| text.into()) @@ -111,24 +108,21 @@ impl State { let target_indicator: Element<_> = if profiles.session().errors.is_empty() { Row::with_children(vec![ - Space::with_width(Length::Units( - profiles.session().hits.len() as u16 * CHAR_WIDTH, - )) - .into(), + Space::with_width(profiles.session().hits.len() as u16 * CHAR_WIDTH).into(), Text::new("\u{2015}") - .width(Length::Units(CHAR_WIDTH)) - .height(Length::Units(LINE_SPACE)) + .width(CHAR_WIDTH) + .height(LINE_SPACE) .vertical_alignment(alignment::Vertical::Center) - .color(theme.target) + .style(style::Text::Target) .into(), ]) .into() } else { - Space::with_height(Length::Units(LINE_SPACE)).into() + Space::with_height(LINE_SPACE).into() }; let content_active = Column::new() - .width(Length::Units(ROW_WIDTH)) + .width(ROW_WIDTH) .push(active_line) .push(target_indicator); @@ -140,11 +134,7 @@ impl State { .map(|line| { Row::with_children( line.chars() - .map(|c| { - Text::new(c.to_string()) - .width(Length::Units(CHAR_WIDTH)) - .into() - }) + .map(|c| Text::new(c.to_string()).width(CHAR_WIDTH).into()) .collect(), ) .into() @@ -152,7 +142,7 @@ impl State { .collect(), ) .spacing(LINE_SPACE) - .width(Length::Units(ROW_WIDTH)); + .width(ROW_WIDTH); let training = Column::with_children(vec![content_active.into(), content_next.into()]) .padding([0, STATS_WIDTH.saturating_sub(ROW_ERROR_WIDTH), 0, 0]); @@ -172,11 +162,11 @@ impl State { .map(|(ch, val)| { let stats = profiles.active().state.timings.get(ch); let mut row = Row::new() - .push(Text::new(ch.to_string()).font(font::LIGHT).size(12)) + .push(Text::new(ch.to_string()).font(font::Font::Light).size(12)) .push( Text::new("\u{25a0}") - .color(theme.metric(self.accuracy_metric.value(*val))) - .font(font::LIGHT) + .style(style::Text::Metric(self.accuracy_metric.value(*val))) + .font(font::Font::Light) .size(16), ) .align_items(Alignment::Center) @@ -186,8 +176,8 @@ impl State { let wpm = f64::from(stats.wpm_harmonic_mean) as f32; row = row.push( Text::new("\u{25a0}") - .color(theme.metric(self.wpm_metric.value(wpm))) - .font(font::LIGHT) + .style(style::Text::Metric(self.wpm_metric.value(wpm))) + .font(font::Font::Light) .size(16), ) } @@ -195,7 +185,7 @@ impl State { }) .collect(), ) - .width(Length::Units(STATS_WIDTH)) + .width(STATS_WIDTH) .spacing(2) .padding(5); @@ -206,15 +196,15 @@ impl State { .height(Length::Fill); let settings_button_content = Column::new() - .push(Text::new(profiles.active().name.clone()).size(14)) + .push(Text::new(profiles.active().name.to_string()).size(14)) .push(Text::new(profiles.active().layout.to_string()).size(14)) .width(Length::Fill) .align_items(Alignment::End) .spacing(5); - let settings_button = Button::new(&mut self.settings_button, settings_button_content) + let settings_button = Button::new(settings_button_content) .on_press(Message::UserButtonPressed) - .style(style::button::text(theme)) + .style(style::Button::Text) .padding(10); let footer = Row::new() @@ -273,10 +263,10 @@ impl State { } pub fn subscription() -> Subscription { - use iced_native::event::{Event, Status}; - use iced_native::window::Event as WindowEvent; + use iced::event::{Event, Status}; + use iced::window::Event as WindowEvent; - iced_native::subscription::events_with(|event, status| { + iced::subscription::events_with(|event, status| { if status == Status::Captured { return None; } diff --git a/src/style.rs b/src/style.rs index eff46d7..ffbbce6 100644 --- a/src/style.rs +++ b/src/style.rs @@ -1,5 +1,454 @@ -pub mod button; -pub mod container; -pub mod pick_list; -pub mod rule; -pub mod text_input; +// pub mod button; +// pub mod container; +// pub mod pick_list; +// pub mod rule; +// pub mod text_input; + +use iced::widget::overlay::menu; +use iced::widget::{button, container, pick_list, rule, scrollable, text, text_input}; +use iced::{Background, Color}; + +use crate::data; +use crate::data::theme::alpha; + +#[derive(Debug, Default, Clone)] +pub struct Theme { + theme: data::Theme, +} + +impl Theme { + pub fn new(theme: data::Theme) -> Self { + Self { theme } + } + + pub fn name(&self) -> &'static str { + self.theme.name + } +} + +impl iced::application::StyleSheet for Theme { + type Style = Theme; + + fn appearance(&self, _style: &Self::Style) -> iced::application::Appearance { + iced::application::Appearance { + background_color: self.theme.bg, + text_color: self.theme.text, + } + } +} + +#[derive(Default, Clone, Copy)] +pub enum Text { + #[default] + Default, + Error, + Metric(f32), + Miss, + Override(Color), + Target, +} + +impl text::StyleSheet for Theme { + type Style = Text; + + fn appearance(&self, style: Self::Style) -> text::Appearance { + let color = match style { + Text::Default => None, + Text::Error => Some(self.theme.error), + Text::Metric(metric) => Some(self.theme.metric(metric)), + Text::Miss => Some(self.theme.miss), + Text::Override(color) => Some(color), + Text::Target => Some(self.theme.target), + }; + + text::Appearance { color } + } +} + +#[derive(Default)] +pub enum Button { + /// Accept changes + Accept, + /// Normal button + #[default] + Basic, + /// Menu item + Menu { selected: bool }, + /// Reject changes + Reject, + /// Bare text + Text, + /// Override theme + ThemePreview(data::Theme), +} + +impl button::StyleSheet for Theme { + type Style = Button; + + fn active(&self, style: &Self::Style) -> button::Appearance { + let appearance = button::Appearance { + border_radius: 2.0, + border_width: 1.0, + border_color: alpha(self.theme.text, 0.15), + text_color: alpha(self.theme.text, 0.75), + ..button::Appearance::default() + }; + + match style { + Button::Accept => button::Appearance { + background: alpha(self.theme.target, 0.05).into(), + border_color: alpha(self.theme.target, 0.15), + text_color: alpha(self.theme.target, 0.75), + ..appearance + }, + Button::Basic => appearance, + Button::Menu { selected } => button::Appearance { + background: selected.then(|| alpha(self.theme.text, 0.05).into()), + text_color: if *selected { + self.theme.text + } else { + alpha(self.theme.text, 0.5) + }, + ..button::Appearance::default() + }, + Button::Reject => button::Appearance { + background: alpha(self.theme.error, 0.05).into(), + border_color: alpha(self.theme.error, 0.15), + text_color: alpha(self.theme.error, 0.75), + ..appearance + }, + Button::Text => button::Appearance { + text_color: alpha(self.theme.text, 0.5), + border_width: 0.0, + ..appearance + }, + Button::ThemePreview(theme) => button::Appearance { + border_color: alpha(theme.text, 0.15), + text_color: alpha(theme.text, 0.75), + ..appearance + }, + } + } + + fn hovered(&self, style: &Self::Style) -> button::Appearance { + let appearance = button::Appearance { + background: Some(alpha(self.theme.text, 0.025).into()), + border_color: alpha(self.theme.text, 0.5), + text_color: self.theme.text, + ..self.active(style) + }; + + match style { + Button::Accept => button::Appearance { + background: alpha(self.theme.target, 0.1).into(), + border_color: alpha(self.theme.target, 0.5), + text_color: self.theme.target, + ..appearance + }, + Button::Basic => appearance, + Button::Menu { selected } => button::Appearance { + background: selected.then(|| alpha(self.theme.text, 0.075).into()), + text_color: if *selected { + self.theme.text + } else { + alpha(self.theme.text, 0.75) + }, + ..self.active(style) + }, + Button::Reject => button::Appearance { + background: alpha(self.theme.error, 0.1).into(), + border_color: alpha(self.theme.error, 0.5), + text_color: self.theme.error, + ..appearance + }, + Button::Text => button::Appearance { + text_color: self.theme.text, + ..self.active(style) + }, + Button::ThemePreview(theme) => button::Appearance { + background: Some(alpha(theme.text, 0.025).into()), + border_color: alpha(theme.text, 0.5), + text_color: theme.text, + ..self.active(style) + }, + } + } + + fn pressed(&self, style: &Self::Style) -> button::Appearance { + let appearance = button::Appearance { + background: Some(alpha(self.theme.text, 0.015).into()), + border_color: alpha(self.theme.text, 0.1), + text_color: alpha(self.theme.text, 0.6), + ..self.hovered(style) + }; + + match style { + Button::Accept => button::Appearance { + background: alpha(self.theme.target, 0.075).into(), + border_color: alpha(self.theme.target, 0.4), + text_color: alpha(self.theme.target, 0.85), + ..appearance + }, + Button::Basic => appearance, + Button::Menu { selected } => button::Appearance { + background: selected.then(|| alpha(self.theme.text, 0.07).into()), + text_color: if *selected { + self.theme.text + } else { + alpha(self.theme.text, 0.6) + }, + ..self.active(style) + }, + Button::Reject => button::Appearance { + background: alpha(self.theme.error, 0.075).into(), + border_color: alpha(self.theme.error, 0.4), + text_color: alpha(self.theme.error, 0.85), + ..appearance + }, + Button::Text => button::Appearance { + text_color: alpha(self.theme.text, 0.9), + ..self.active(style) + }, + Button::ThemePreview(theme) => button::Appearance { + background: Some(alpha(theme.text, 0.015).into()), + border_color: alpha(theme.text, 0.4), + text_color: alpha(theme.text, 0.6), + ..self.active(style) + }, + } + } + + fn disabled(&self, style: &Self::Style) -> button::Appearance { + let appearance = button::Appearance { + background: None, + border_color: alpha(self.theme.text, 0.05), + text_color: alpha(self.theme.text, 0.05), + ..self.active(style) + }; + + match style { + Button::Accept => button::Appearance { + background: alpha(self.theme.target, 0.025).into(), + border_color: alpha(self.theme.target, 0.05), + text_color: alpha(self.theme.target, 0.05), + ..appearance + }, + Button::Basic => appearance, + Button::Menu { selected } => button::Appearance { + background: selected.then(|| alpha(self.theme.text, 0.025).into()), + text_color: alpha(self.theme.text, 0.25), + ..self.active(style) + }, + Button::Reject => button::Appearance { + background: alpha(self.theme.error, 0.025).into(), + border_color: alpha(self.theme.error, 0.05), + text_color: alpha(self.theme.error, 0.05), + ..appearance + }, + Button::Text => button::Appearance { + text_color: alpha(self.theme.text, 0.25), + ..self.active(style) + }, + Button::ThemePreview(theme) => button::Appearance { + background: None, + border_color: alpha(theme.text, 0.05), + text_color: alpha(theme.text, 0.05), + ..self.active(style) + }, + } + } +} + +#[derive(Default)] +pub enum Container { + MenuSelected, + ThemePreview { + fg: Color, + bg: Background, + }, + #[default] + Primary, +} + +impl Container { + pub fn theme_preview(theme: &data::Theme) -> Self { + Container::ThemePreview { + fg: theme.text, + bg: theme.bg.into(), + } + } +} + +impl container::StyleSheet for Theme { + type Style = Container; + + fn appearance(&self, style: &Self::Style) -> container::Appearance { + match style { + Container::MenuSelected => container::Appearance { + text_color: Some(self.theme.text), + background: Some(alpha(self.theme.text, 0.05).into()), + ..Default::default() + }, + Container::ThemePreview { fg, bg } => container::Appearance { + text_color: Some(*fg), + background: Some(*bg), + ..Default::default() + }, + Container::Primary => Default::default(), + } + } +} + +#[derive(Default)] +pub enum Rule { + #[default] + Divider, +} + +impl rule::StyleSheet for Theme { + type Style = Rule; + + fn appearance(&self, style: &Self::Style) -> rule::Appearance { + use iced::widget::rule::FillMode; + + match style { + Rule::Divider => rule::Appearance { + color: alpha(self.theme.hit, 0.05), + width: 1, + radius: 0.0, + fill_mode: FillMode::Full, + }, + } + } +} + +#[derive(Default)] +pub enum Scrollable { + #[default] + Divider, +} + +impl scrollable::StyleSheet for Theme { + type Style = Scrollable; + + fn active(&self, _style: &Self::Style) -> scrollable::Scrollbar { + scrollable::Scrollbar { + background: None, + border_radius: 0.0, + border_width: 0.0, + border_color: self.theme.text, + scroller: scrollable::Scroller { + color: self.theme.error, + border_radius: 2.0, + border_width: 0.0, + border_color: self.theme.error, + }, + } + } + + fn hovered(&self, style: &Self::Style) -> scrollable::Scrollbar { + self.active(style) + } + + fn dragging(&self, style: &Self::Style) -> scrollable::Scrollbar { + self.active(style) + } +} + +#[derive(Default)] +pub enum TextInput { + #[default] + Default, +} + +impl text_input::StyleSheet for Theme { + type Style = TextInput; + + fn active(&self, _style: &Self::Style) -> text_input::Appearance { + text_input::Appearance { + background: Color::TRANSPARENT.into(), + border_radius: 0.0, + border_width: 1.0, + border_color: alpha(self.theme.hit, 0.1), + } + } + + fn hovered(&self, style: &Self::Style) -> text_input::Appearance { + text_input::Appearance { + background: alpha(self.theme.hit, 0.015).into(), + border_color: alpha(self.theme.hit, 0.1), + ..self.active(style) + } + } + + fn focused(&self, style: &Self::Style) -> text_input::Appearance { + text_input::Appearance { + background: alpha(self.theme.hit, 0.025).into(), + border_color: alpha(self.theme.hit, 0.25), + ..self.active(style) + } + } + + fn placeholder_color(&self, _style: &Self::Style) -> Color { + Color { + a: 0.25, + ..self.theme.hit + } + } + + fn value_color(&self, _style: &Self::Style) -> Color { + self.theme.text + } + + fn selection_color(&self, _style: &Self::Style) -> Color { + Color { + a: 0.05, + ..self.theme.text + } + } +} + +#[derive(Default, Clone)] +pub enum PickList { + #[default] + Default, +} + +impl pick_list::StyleSheet for Theme { + type Style = PickList; + + fn active(&self, _style: &::Style) -> pick_list::Appearance { + pick_list::Appearance { + text_color: self.theme.text, + placeholder_color: alpha(self.theme.hit, 0.25), + handle_color: self.theme.text, + background: self.theme.bg.into(), + border_radius: 0.0, + border_width: 1.0, + border_color: alpha(self.theme.text, 0.1), + } + } + + fn hovered(&self, style: &::Style) -> pick_list::Appearance { + pick_list::Appearance { + border_color: alpha(self.theme.text, 0.25), + ..self.active(style) + } + } +} + +impl iced::overlay::menu::StyleSheet for Theme { + type Style = PickList; + + fn appearance(&self, _style: &Self::Style) -> menu::Appearance { + menu::Appearance { + text_color: alpha(self.theme.text, 0.5), + background: self.theme.bg.into(), + border_width: 1.0, + border_radius: 0.0, + border_color: alpha(self.theme.text, 0.25), + selected_text_color: self.theme.text, + selected_background: alpha(self.theme.text, 0.05).into(), + } + } +} diff --git a/src/style/button.rs b/src/style/button.rs deleted file mode 100644 index a99973a..0000000 --- a/src/style/button.rs +++ /dev/null @@ -1,341 +0,0 @@ -use crate::Theme; -use iced::button::{Style, StyleSheet}; -use iced::Color; - -pub fn text(theme: &Theme) -> Text { - Text { - theme: theme.clone(), - } -} - -pub fn basic(theme: &Theme) -> Basic { - Basic { - theme: theme.clone(), - } -} - -pub fn menu(theme: &Theme, selected: bool) -> Menu { - Menu { - theme: theme.clone(), - selected, - } -} - -pub fn accept(theme: &Theme) -> Accept { - Accept { - theme: theme.clone(), - } -} - -pub fn reject(theme: &Theme) -> Reject { - Reject { - theme: theme.clone(), - } -} - -pub struct Text { - theme: Theme, -} - -impl StyleSheet for Text { - fn active(&self) -> Style { - Style { - text_color: Color { - a: 0.5, - ..self.theme.text - }, - ..Style::default() - } - } - - fn hovered(&self) -> Style { - Style { - text_color: self.theme.text, - ..Style::default() - } - } - - fn pressed(&self) -> Style { - self.hovered() - } - - fn disabled(&self) -> Style { - Style { - text_color: Color { - a: 0.25, - ..self.theme.text - }, - ..Style::default() - } - } -} - -pub struct Basic { - theme: Theme, -} - -impl StyleSheet for Basic { - fn active(&self) -> Style { - Style { - background: None, - border_width: 1.0, - border_color: Color { - a: 0.15, - ..self.theme.text - }, - text_color: Color { - a: 0.75, - ..self.theme.text - }, - ..Style::default() - } - } - - fn hovered(&self) -> Style { - Style { - background: Some( - Color { - a: 0.025, - ..self.theme.text - } - .into(), - ), - border_width: 1.0, - border_color: Color { - a: 0.5, - ..self.theme.text - }, - text_color: self.theme.text, - ..Style::default() - } - } - - fn pressed(&self) -> Style { - self.hovered() - } - - fn disabled(&self) -> Style { - Style { - background: None, - border_width: 1.0, - border_color: Color { - a: 0.05, - ..self.theme.text - }, - text_color: Color { - a: 0.05, - ..self.theme.text - }, - ..Style::default() - } - } -} - -pub struct Menu { - theme: Theme, - selected: bool, -} - -impl StyleSheet for Menu { - fn active(&self) -> Style { - Style { - text_color: if self.selected { - self.theme.text - } else { - Color { - a: 0.5, - ..self.theme.text - } - }, - background: self.selected.then(|| { - Color { - a: 0.05, - ..self.theme.text - } - .into() - }), - ..Style::default() - } - } - - fn hovered(&self) -> Style { - Style { - text_color: if self.selected { - self.theme.text - } else { - Color { - a: 0.75, - ..self.theme.text - } - }, - background: self.selected.then(|| { - Color { - a: 0.075, - ..self.theme.text - } - .into() - }), - ..Style::default() - } - } - - fn pressed(&self) -> Style { - self.hovered() - } - - fn disabled(&self) -> Style { - Style { - text_color: Color { - a: 0.25, - ..self.theme.text - }, - ..Style::default() - } - } -} - -pub struct Accept { - theme: Theme, -} - -impl StyleSheet for Accept { - fn active(&self) -> Style { - Style { - background: Some( - Color { - a: 0.05, - ..self.theme.target - } - .into(), - ), - border_width: 1.0, - border_color: Color { - a: 0.15, - ..self.theme.target - }, - text_color: Color { - a: 0.75, - ..self.theme.target - }, - ..Style::default() - } - } - - fn hovered(&self) -> Style { - Style { - background: Some( - Color { - a: 0.1, - ..self.theme.target - } - .into(), - ), - border_width: 1.0, - border_color: Color { - a: 0.5, - ..self.theme.target - }, - text_color: self.theme.target, - ..Style::default() - } - } - - fn pressed(&self) -> Style { - self.hovered() - } - - fn disabled(&self) -> Style { - Style { - background: Some( - Color { - a: 0.025, - ..self.theme.target - } - .into(), - ), - border_width: 1.0, - border_color: Color { - a: 0.05, - ..self.theme.target - }, - text_color: Color { - a: 0.05, - ..self.theme.target - }, - ..Style::default() - } - } -} - -pub struct Reject { - theme: Theme, -} - -impl StyleSheet for Reject { - fn active(&self) -> Style { - Style { - background: Some( - Color { - a: 0.05, - ..self.theme.error - } - .into(), - ), - border_width: 1.0, - border_color: Color { - a: 0.15, - ..self.theme.error - }, - text_color: Color { - a: 0.75, - ..self.theme.error - }, - ..Style::default() - } - } - - fn hovered(&self) -> Style { - Style { - background: Some( - Color { - a: 0.1, - ..self.theme.error - } - .into(), - ), - border_width: 1.0, - border_color: Color { - a: 0.5, - ..self.theme.error - }, - text_color: self.theme.error, - ..Style::default() - } - } - - fn pressed(&self) -> Style { - self.hovered() - } - - fn disabled(&self) -> Style { - Style { - background: Some( - Color { - a: 0.025, - ..self.theme.error - } - .into(), - ), - border_width: 1.0, - border_color: Color { - a: 0.05, - ..self.theme.error - }, - text_color: Color { - a: 0.05, - ..self.theme.error - }, - ..Style::default() - } - } -} diff --git a/src/style/container.rs b/src/style/container.rs deleted file mode 100644 index 0c3b69d..0000000 --- a/src/style/container.rs +++ /dev/null @@ -1,50 +0,0 @@ -use crate::Theme; -use iced::container::{Style, StyleSheet}; -use iced::Color; - -pub fn primary(theme: &Theme) -> Primary { - Primary { - theme: theme.clone(), - } -} - -pub fn menu_selected(theme: &Theme) -> MenuSelected { - MenuSelected { - theme: theme.clone(), - } -} - -pub struct Primary { - theme: Theme, -} - -impl StyleSheet for Primary { - fn style(&self) -> Style { - Style { - text_color: Some(self.theme.text), - background: Some(self.theme.bg.into()), - ..Style::default() - } - } -} - -/// Use for selected menu items that aren't clickable -pub struct MenuSelected { - theme: Theme, -} - -impl StyleSheet for MenuSelected { - fn style(&self) -> Style { - Style { - text_color: Some(self.theme.text), - background: Some( - Color { - a: 0.05, - ..self.theme.text - } - .into(), - ), - ..Style::default() - } - } -} diff --git a/src/style/pick_list.rs b/src/style/pick_list.rs deleted file mode 100644 index 6c4e62f..0000000 --- a/src/style/pick_list.rs +++ /dev/null @@ -1,58 +0,0 @@ -use crate::Theme; -use iced::pick_list::{Menu, Style, StyleSheet}; -use iced::Color; - -pub fn themed(theme: &Theme) -> Themed { - Themed { - theme: theme.clone(), - } -} - -pub struct Themed { - theme: Theme, -} - -impl StyleSheet for Themed { - fn menu(&self) -> Menu { - Menu { - text_color: Color { - a: 0.5, - ..self.theme.text - }, - background: self.theme.bg.into(), - border_color: Color { - a: 0.25, - ..self.theme.text - }, - selected_text_color: self.theme.text, - selected_background: Color { - a: 0.05, - ..self.theme.text - } - .into(), - ..Menu::default() - } - } - - fn active(&self) -> Style { - Style { - text_color: self.theme.text, - background: self.theme.bg.into(), - border_color: Color { - a: 0.1, - ..self.theme.hit - }, - ..Style::default() - } - } - - fn hovered(&self) -> Style { - Style { - border_color: Color { - a: 0.25, - ..self.theme.hit - }, - ..self.active() - } - } -} diff --git a/src/style/rule.rs b/src/style/rule.rs deleted file mode 100644 index decd3e5..0000000 --- a/src/style/rule.rs +++ /dev/null @@ -1,26 +0,0 @@ -use crate::Theme; -use iced::rule::{FillMode, Style, StyleSheet}; -use iced::Color; - -pub fn divider(theme: &Theme) -> Divider { - Divider { - theme: theme.clone(), - } -} - -pub struct Divider { - theme: Theme, -} - -impl StyleSheet for Divider { - fn style(&self) -> Style { - Style { - color: Color { - a: 0.05, - ..self.theme.hit - }, - fill_mode: FillMode::Full, - ..Style::default() - } - } -} diff --git a/src/style/text_input.rs b/src/style/text_input.rs deleted file mode 100644 index bb32ff4..0000000 --- a/src/style/text_input.rs +++ /dev/null @@ -1,61 +0,0 @@ -use crate::Theme; -use iced::text_input::{Style, StyleSheet}; -use iced::Color; - -pub fn themed(theme: &Theme) -> Themed { - Themed { - theme: theme.clone(), - } -} - -pub struct Themed { - theme: Theme, -} - -impl StyleSheet for Themed { - fn active(&self) -> Style { - Style { - background: Color::TRANSPARENT.into(), - border_radius: 0.0, - border_width: 1.0, - border_color: Color { - a: 0.1, - ..self.theme.hit - }, - } - } - - fn focused(&self) -> Style { - Style { - background: Color { - a: 0.025, - ..self.theme.hit - } - .into(), - border_radius: 0.0, - border_width: 1.0, - border_color: Color { - a: 0.25, - ..self.theme.hit - }, - } - } - - fn placeholder_color(&self) -> Color { - Color { - a: 0.25, - ..self.theme.hit - } - } - - fn selection_color(&self) -> Color { - Color { - a: 0.05, - ..self.theme.text - } - } - - fn value_color(&self) -> Color { - self.theme.text - } -}