diff --git a/Cargo.lock b/Cargo.lock index ccb478970..bd8a9f07c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,13 +46,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -78,13 +80,15 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-activity" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c77a0045eda8b888c76ea473c2b0515ba6f471d318f8927c5c72240937035a6" +checksum = "39b801912a977c3fd52d80511fe1c0c8480c6f957f21ae2ce1b92ffe970cf4b9" dependencies = [ "android-properties", - "bitflags 1.3.2", + "bitflags 2.4.2", "cc", + "cesu8", + "jni", "jni-sys", "libc", "log", @@ -92,6 +96,7 @@ dependencies = [ "ndk-context", "ndk-sys", "num_enum", + "thiserror", ] [[package]] @@ -136,6 +141,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ash" version = "0.37.3+1.3.251" @@ -175,7 +186,7 @@ dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand", + "fastrand 1.9.0", "futures-lite", "slab", ] @@ -205,8 +216,8 @@ dependencies = [ "futures-lite", "log", "parking", - "polling", - "rustix", + "polling 2.8.0", + "rustix 0.37.19", "slab", "socket2", "waker-fn", @@ -234,7 +245,7 @@ dependencies = [ "cfg-if", "event-listener", "futures-lite", - "rustix", + "rustix 0.37.19", "signal-hook", "windows-sys 0.48.0", ] @@ -247,7 +258,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -264,7 +275,7 @@ checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -329,9 +340,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block" @@ -350,21 +361,21 @@ dependencies = [ [[package]] name = "block-sys" -version = "0.1.0-beta.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ "objc-sys", ] [[package]] name = "block2" -version = "0.2.0-alpha.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ "block-sys", - "objc2-encode", + "objc2", ] [[package]] @@ -377,7 +388,7 @@ dependencies = [ "async-lock", "async-task", "atomic-waker", - "fastrand", + "fastrand 1.9.0", "futures-lite", "log", ] @@ -405,7 +416,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -422,15 +433,28 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "calloop" -version = "0.10.5" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a59225be45a478d772ce015d9743e49e92798ece9e34eda9a6aa2a6a7f40192" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ + "bitflags 2.4.2", "log", - "nix 0.25.1", - "slotmap", + "polling 3.3.2", + "rustix 0.38.30", + "slab", "thiserror", - "vec_map", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop", + "rustix 0.38.30", + "wayland-backend", + "wayland-client 0.31.2", ] [[package]] @@ -442,6 +466,12 @@ dependencies = [ "jobserver", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.0" @@ -454,6 +484,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f" + [[package]] name = "chrono" version = "0.4.26" @@ -472,13 +508,11 @@ dependencies = [ [[package]] name = "clipboard-win" -version = "4.5.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +checksum = "c57002a5d9be777c1ef967e33674dac9ebd310d8893e4e3437b14d5f0f6372cc" dependencies = [ "error-code", - "str-buf", - "winapi", ] [[package]] @@ -513,16 +547,16 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", "core-foundation", "core-graphics", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -537,7 +571,7 @@ dependencies = [ "block", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", "objc", ] @@ -559,10 +593,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "combine" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] [[package]] name = "concurrent-queue" @@ -591,14 +660,14 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core-graphics" -version = "0.22.3" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -610,22 +679,23 @@ checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags 1.3.2", "core-foundation", - "foreign-types", + "foreign-types 0.3.2", "libc", ] [[package]] name = "cosmic-text" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b68966c2543609f8d92f9d33ac3b719b2a67529b0c6c0b3e025637b477eef9" +checksum = "75acbfb314aeb4f5210d379af45ed1ec2c98c7f1790bf57b8a4c562ac0c51b71" dependencies = [ - "aliasable", "fontdb", "libm", "log", "rangemap", + "rustc-hash", "rustybuzz", + "self_cell", "swash", "sys-locale", "unicode-bidi", @@ -711,14 +781,30 @@ dependencies = [ "typenum", ] +[[package]] +name = "ctor" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +dependencies = [ + "quote", + "syn 2.0.48", +] + +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + [[package]] name = "d3d12" -version = "0.6.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" dependencies = [ - "bitflags 1.3.2", - "libloading 0.7.4", + "bitflags 2.4.2", + "libloading 0.8.0", "winapi", ] @@ -797,11 +883,11 @@ checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] name = "dlib" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.7.4", + "libloading 0.8.0", ] [[package]] @@ -810,6 +896,45 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "drm" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" +dependencies = [ + "bitflags 2.4.2", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "rustix 0.38.30", +] + +[[package]] +name = "drm-ffi" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" +dependencies = [ + "drm-sys", + "rustix 0.38.30", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" +dependencies = [ + "libc", + "linux-raw-sys 0.6.4", +] + [[package]] name = "either" version = "1.8.1" @@ -847,45 +972,36 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] -name = "errno" -version = "0.3.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] name = "error-code" -version = "2.3.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" -dependencies = [ - "libc", - "str-buf", -] +checksum = "281e452d3bad4005426416cdba5ccfd4f5c1280e10099e21db27f7c1c28347fc" [[package]] name = "etagere" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf22f748754352918e082e0039335ee92454a5d62bcaf69b5e8daf5907d9644" +checksum = "306960881d6c46bd0dd6b7f07442a441418c08d0d3e63d8d080b0f64c6343e4e" dependencies = [ "euclid", "svg_fmt", @@ -937,6 +1053,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "fdeflate" version = "0.3.0" @@ -978,17 +1100,27 @@ dependencies = [ "spin", ] +[[package]] +name = "fontconfig-parser" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a595cb550439a117696039dfc69830492058211b771a2a165379f2a1a53d84d" +dependencies = [ + "roxmltree", +] + [[package]] name = "fontdb" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8d8cbea8f21307d7e84bca254772981296f058a1d36b461bf4d83a7499fc9e" +checksum = "020e203f177c0fb250fb19455a252e838d2bbbce1f80f25ecc42402aafa8cd38" dependencies = [ + "fontconfig-parser", "log", - "memmap2 0.6.2", + "memmap2 0.8.0", "slotmap", "tinyvec", - "ttf-parser", + "ttf-parser 0.19.0", ] [[package]] @@ -997,7 +1129,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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -1006,6 +1159,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "futures" version = "0.3.28" @@ -1061,7 +1220,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -1078,7 +1237,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -1131,6 +1290,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.0", +] + [[package]] name = "getrandom" version = "0.2.10" @@ -1160,6 +1329,17 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +[[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", +] + [[package]] name = "glam" version = "0.24.0" @@ -1168,9 +1348,9 @@ checksum = "ad83ab008a4fa3b31dfa713dd41b5a9bdea1e94e4cf1e2fc274ffbd49b0271d3" [[package]] name = "glow" -version = "0.12.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807edf58b70c0b5b2181dd39fe1839dbdb3ba02645630dc5f753e23da307f762" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -1178,11 +1358,20 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + [[package]] name = "glyphon" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e87caa7459145f5e5f167bf34db4532901404c679e62339fb712a0e3ccf722a" +checksum = "6a62d0338e4056db6a73221c2fb2e30619452f6ea9651bac4110f51b0f7a7581" dependencies = [ "cosmic-text", "etagere", @@ -1192,34 +1381,34 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.5.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22beaafc29b38204457ea030f6fb7a84c9e4dd1b86e311ba0542533453d87f62" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "gpu-alloc-types", ] [[package]] name = "gpu-alloc-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", ] [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", + "presser", "thiserror", "winapi", - "windows 0.44.0", + "windows 0.52.0", ] [[package]] @@ -1294,24 +1483,24 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.7", "allocator-api2", ] [[package]] name = "hassle-rs" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.4.2", + "com", "libc", - "libloading 0.7.4", + "libloading 0.8.0", "thiserror", "widestring", "winapi", @@ -1375,8 +1564,8 @@ dependencies = [ [[package]] name = "iced" -version = "0.9.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "iced_core", "iced_futures", @@ -1389,21 +1578,24 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.9.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "bitflags 1.3.2", - "instant", "log", + "num-traits", "palette", + "raw-window-handle", + "smol_str", "thiserror", - "twox-hash", + "web-time", + "xxhash-rust", ] [[package]] name = "iced_futures" -version = "0.6.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "futures", "iced_core", @@ -1415,38 +1607,43 @@ dependencies = [ [[package]] name = "iced_graphics" -version = "0.8.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "bitflags 1.3.2", "bytemuck", + "cosmic-text", "glam", "half", "iced_core", + "iced_futures", "image", "kamadak-exif", "log", + "once_cell", "raw-window-handle", + "rustc-hash", "thiserror", + "unicode-segmentation", + "xxhash-rust", ] [[package]] name = "iced_renderer" -version = "0.1.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "iced_graphics", "iced_tiny_skia", "iced_wgpu", "log", - "raw-window-handle", "thiserror", ] [[package]] name = "iced_runtime" -version = "0.1.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "iced_core", "iced_futures", @@ -1455,8 +1652,8 @@ dependencies = [ [[package]] name = "iced_style" -version = "0.8.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "iced_core", "once_cell", @@ -1465,25 +1662,24 @@ dependencies = [ [[package]] name = "iced_tiny_skia" -version = "0.1.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "bytemuck", "cosmic-text", "iced_graphics", "kurbo", "log", - "raw-window-handle", "rustc-hash", "softbuffer", - "tiny-skia 0.10.0", - "twox-hash", + "tiny-skia", + "xxhash-rust", ] [[package]] name = "iced_wgpu" -version = "0.10.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -1494,16 +1690,13 @@ dependencies = [ "iced_graphics", "log", "once_cell", - "raw-window-handle", - "rustc-hash", - "twox-hash", "wgpu", ] [[package]] name = "iced_widget" -version = "0.1.0" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "iced_renderer", "iced_runtime", @@ -1516,21 +1709,32 @@ dependencies = [ [[package]] name = "iced_winit" -version = "0.9.1" -source = "git+https://github.com/iced-rs/iced?rev=78dc341ea82449f1e075e37e67c1ccf66b88e8d6#78dc341ea82449f1e075e37e67c1ccf66b88e8d6" +version = "0.12.0" +source = "git+https://github.com/tarkah/iced?rev=f9db8d1efe68634b7b06ce07f12ea33a3e37d79c#f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" dependencies = [ "iced_graphics", "iced_runtime", "iced_style", "log", - "raw-window-handle", "thiserror", + "tracing", "web-sys", "winapi", "window_clipboard", "winit", ] +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2", + "dispatch", + "objc2", +] + [[package]] name = "image" version = "0.24.6" @@ -1560,6 +1764,16 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + [[package]] name = "instant" version = "0.1.12" @@ -1567,9 +1781,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", ] [[package]] @@ -1626,9 +1837,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -1640,11 +1851,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] -name = "jni-sys" -version = "0.3.0" +name = "jni" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jobserver" version = "0.1.26" @@ -1665,9 +1892,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -1683,15 +1910,21 @@ dependencies = [ [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading 0.8.0", "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "kurbo" version = "0.9.5" @@ -1715,9 +1948,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" @@ -1741,21 +1974,27 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "linked-hash-map" -version = "0.5.6" +name = "linux-raw-sys" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "linux-raw-sys" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0b5399f6804fbab912acbd8878ed3532d506b7c951b8f9f164ef90fef39e3f4" [[package]] name = "lock_api" @@ -1769,17 +2008,17 @@ dependencies = [ [[package]] name = "log" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eedb2bdbad7e0634f83989bf596f497b070130daaa398ab22d84c39e266deec5" +checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.3", ] [[package]] @@ -1821,9 +2060,18 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.6.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ "libc", ] @@ -1857,16 +2105,17 @@ dependencies = [ [[package]] name = "metal" -version = "0.24.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "log", "objc", + "paste", ] [[package]] @@ -1901,7 +2150,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] @@ -1914,15 +2162,15 @@ checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" [[package]] name = "naga" -version = "0.12.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cd00bd6180a8790f1c020ed258a46b8d73dd5bd6af104a238c9d71f806938e" +checksum = "8878eb410fc90853da3908aebfe61d73d26d4437ef850b70050461f939509899" dependencies = [ "bit-set", - "bitflags 1.3.2", + "bitflags 2.4.2", "codespan-reporting", "hexf-parse", - "indexmap", + "indexmap 2.2.1", "log", "num-traits", "rustc-hash", @@ -1961,12 +2209,13 @@ dependencies = [ [[package]] name = "ndk" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "jni-sys", + "log", "ndk-sys", "num_enum", "raw-window-handle", @@ -1981,9 +2230,9 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-sys" -version = "0.4.1+23.1.7779620" +version = "0.5.0+25.2.9519653" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" dependencies = [ "jni-sys", ] @@ -2013,19 +2262,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nix" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - [[package]] name = "nix" version = "0.26.2" @@ -2036,7 +2272,6 @@ dependencies = [ "cfg-if", "libc", "memoffset 0.7.1", - "pin-utils", "static_assertions", ] @@ -2105,23 +2340,23 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.11" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.11" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -2147,29 +2382,25 @@ dependencies = [ [[package]] name = "objc-sys" -version = "0.2.0-beta.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" +checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" [[package]] name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "block2", "objc-sys", "objc2-encode", ] [[package]] name = "objc2-encode" -version = "2.0.0-pre.2" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys", -] +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" [[package]] name = "objc_exception" @@ -2200,17 +2431,18 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "open" -version = "4.1.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" +checksum = "90878fb664448b54c4e592455ad02831e23a3f7e157374a8b95654731aac7349" dependencies = [ "is-wsl", + "libc", "pathdiff", ] @@ -2222,7 +2454,7 @@ checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ "bitflags 1.3.2", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -2237,7 +2469,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -2298,7 +2530,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -2307,14 +2539,14 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "706de7e2214113d63a8238d1910463cfce781129a6f263d13fdb09ff64355ba4" dependencies = [ - "ttf-parser", + "ttf-parser 0.19.0", ] [[package]] name = "palette" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1641aee47803391405d0a1250e837d2336fdddd18b27f3ddb8c1d80ce8d7f43" +checksum = "3d38e6e5ca1612e2081cc31188f08c3cba630ce4ba44709a153f1a0f38d678f2" dependencies = [ "approx", "fast-srgb8", @@ -2324,13 +2556,13 @@ dependencies = [ [[package]] name = "palette_derive" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c02bfa6b3ba8af5434fa0531bf5701f750d983d4260acd6867faca51cdc4484" +checksum = "e05d1c929301fee6830dafa764341118829b2535c216b0571e3821ecac5c885b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -2387,6 +2619,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pathdiff" version = "0.2.1" @@ -2458,7 +2696,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -2508,12 +2746,32 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.30", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "ppv-lite86" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2550,9 +2808,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2581,11 +2839,20 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + [[package]] name = "quote" -version = "1.0.28" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2628,15 +2895,15 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "rangemap" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9283c6b06096b47afc7109834fdedab891175bb5241ee5d4f7d2546549f263" +checksum = "977b1e897f9d764566891689e642653e5ed90c6895106acd005eb4c1d0203991" [[package]] name = "raw-window-handle" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "rayon" @@ -2678,6 +2945,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -2712,6 +2988,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" +[[package]] +name = "roxmltree" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -2743,24 +3025,37 @@ dependencies = [ "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", "windows-sys 0.48.0", ] +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", +] + [[package]] name = "rustybuzz" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82eea22c8f56965eeaf3a209b3d24508256c7b920fb3b6211b8ba0f7c0583250" +checksum = "2ee8fe2a8461a0854a37101fe7a1b13998d0cfa987e43248e81d2a5f4570f6fa" dependencies = [ "bitflags 1.3.2", "bytemuck", "libm", "smallvec", - "ttf-parser", + "ttf-parser 0.20.0", "unicode-bidi-mirroring", "unicode-ccc", - "unicode-general-category", + "unicode-properties", "unicode-script", ] @@ -2770,6 +3065,15 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.21" @@ -2793,15 +3097,15 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sctk-adwaita" -version = "0.5.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" +checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" dependencies = [ "ab_glyph", "log", - "memmap2 0.5.10", - "smithay-client-toolkit", - "tiny-skia 0.8.4", + "memmap2 0.9.4", + "smithay-client-toolkit 0.18.0", + "tiny-skia", ] [[package]] @@ -2833,6 +3137,12 @@ dependencies = [ "libc", ] +[[package]] +name = "self_cell" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" + [[package]] name = "semver" version = "1.0.17" @@ -2841,22 +3151,22 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -2878,7 +3188,7 @@ checksum = "6f0a21fba416426ac927b1691996e82079f8b6156e920c85345f135b2e9ba2de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -2892,14 +3202,15 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.26" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ - "indexmap", + "indexmap 2.2.1", + "itoa", "ryu", "serde", - "yaml-rust", + "unsafe-libyaml", ] [[package]] @@ -2975,7 +3286,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" dependencies = [ "bitflags 1.3.2", - "calloop", "dlib", "lazy_static", "log", @@ -2983,8 +3293,33 @@ dependencies = [ "nix 0.24.3", "pkg-config", "wayland-client 0.29.5", - "wayland-cursor", - "wayland-protocols", + "wayland-cursor 0.29.5", + "wayland-protocols 0.29.5", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f" +dependencies = [ + "bitflags 2.4.2", + "calloop", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.4", + "rustix 0.38.30", + "thiserror", + "wayland-backend", + "wayland-client 0.31.2", + "wayland-csd-frame", + "wayland-cursor 0.31.1", + "wayland-protocols 0.31.2", + "wayland-protocols-wlr", + "wayland-scanner 0.31.1", + "xkeysym", ] [[package]] @@ -2993,10 +3328,19 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" dependencies = [ - "smithay-client-toolkit", + "smithay-client-toolkit 0.16.0", "wayland-client 0.29.5", ] +[[package]] +name = "smol_str" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +dependencies = [ + "serde", +] + [[package]] name = "socket2" version = "0.4.9" @@ -3009,30 +3353,33 @@ dependencies = [ [[package]] name = "softbuffer" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2b953f6ba7285f0af131eb748aabd8ddaf53e0b81dda3ba5d803b0847d6559f" +checksum = "071916a85d1db274b4ed57af3a14afb66bd836ae7f82ebb6f1fd3455107830d9" dependencies = [ + "as-raw-xcb-connection", "bytemuck", - "cfg_aliases", + "cfg_aliases 0.2.0", "cocoa", "core-graphics", - "fastrand", - "foreign-types", + "drm", + "fastrand 2.0.1", + "foreign-types 0.5.0", + "js-sys", "log", - "nix 0.26.2", + "memmap2 0.9.4", "objc", "raw-window-handle", - "redox_syscall 0.3.5", - "thiserror", + "redox_syscall 0.4.1", + "rustix 0.38.30", + "tiny-xlib", "wasm-bindgen", "wayland-backend", - "wayland-client 0.30.2", - "wayland-sys 0.30.1", + "wayland-client 0.31.2", + "wayland-sys 0.31.1", "web-sys", - "windows-sys 0.48.0", - "x11-dl", - "x11rb 0.11.1", + "windows-sys 0.52.0", + "x11rb 0.13.0", ] [[package]] @@ -3046,12 +3393,11 @@ dependencies = [ [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.4.2", ] [[package]] @@ -3060,12 +3406,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str-buf" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" - [[package]] name = "strict-num" version = "0.1.1" @@ -3101,9 +3441,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -3112,12 +3452,11 @@ dependencies = [ [[package]] name = "sys-locale" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0b9eefabb91675082b41eb94c3ecd91af7656caee3fb4961a07c0ec8c7ca6f" +checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" dependencies = [ "libc", - "windows-sys 0.45.0", ] [[package]] @@ -3126,7 +3465,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f5bff1d532fead7c43324a0fa33643b8621a47ce2944a633be4cb6c0240898f" dependencies = [ - "quick-xml", + "quick-xml 0.23.1", "windows 0.39.0", ] @@ -3137,39 +3476,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if", - "fastrand", + "fastrand 1.9.0", "redox_syscall 0.3.5", - "rustix", + "rustix 0.37.19", "windows-sys 0.45.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -3212,23 +3551,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "tiny-skia" -version = "0.8.4" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67" -dependencies = [ - "arrayref", - "arrayvec", - "bytemuck", - "cfg-if", - "png", - "tiny-skia-path 0.8.4", -] - -[[package]] -name = "tiny-skia" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc" +checksum = "b6a067b809476893fce6a254cf285850ff69c847e6cfbade6a20b655b6c7e80d" dependencies = [ "arrayref", "arrayvec", @@ -3236,14 +3561,14 @@ dependencies = [ "cfg-if", "log", "png", - "tiny-skia-path 0.10.0", + "tiny-skia-path", ] [[package]] name = "tiny-skia-path" -version = "0.8.4" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adbfb5d3f3dd57a0e11d12f4f13d4ebbbc1b5c15b7ab0a156d030b21da5f677c" +checksum = "5de35e8a90052baaaf61f171680ac2f8e925a1e43ea9d2e3a00514772250e541" dependencies = [ "arrayref", "bytemuck", @@ -3251,14 +3576,15 @@ dependencies = [ ] [[package]] -name = "tiny-skia-path" -version = "0.10.0" +name = "tiny-xlib" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f60aa35c89ac2687ace1a2556eaaea68e8c0d47408a2e3e7f5c98a489e7281c" +checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" dependencies = [ - "arrayref", - "bytemuck", - "strict-num", + "as-raw-xcb-connection", + "ctor", + "libloading 0.8.0", + "tracing", ] [[package]] @@ -3304,7 +3630,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -3369,7 +3695,7 @@ version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ - "indexmap", + "indexmap 1.9.3", "serde", "serde_spanned", "toml_datetime", @@ -3396,7 +3722,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", ] [[package]] @@ -3415,15 +3741,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44dcf002ae3b32cd25400d6df128c5babec3927cd1eb7ce813cfff20eb6c3746" [[package]] -name = "twox-hash" -version = "1.6.3" +name = "ttf-parser" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "rand", - "static_assertions", -] +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[package]] name = "typenum" @@ -3459,12 +3780,6 @@ 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.9" @@ -3473,13 +3788,15 @@ checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-linebreak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" -dependencies = [ - "hashbrown 0.12.3", - "regex", -] +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" [[package]] name = "unicode-script" @@ -3505,6 +3822,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unsafe-libyaml" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" + [[package]] name = "uuid" version = "1.3.3" @@ -3520,12 +3843,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.4" @@ -3558,6 +3875,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.10.0+wasi-snapshot-preview1" @@ -3572,9 +3899,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3582,24 +3909,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -3609,9 +3936,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3619,22 +3946,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-timer" @@ -3653,17 +3980,16 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.1.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b48e27457e8da3b2260ac60d0a94512f5cba36448679f3747c0865b7893ed8" +checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" dependencies = [ "cc", "downcast-rs", - "io-lifetimes", - "nix 0.26.2", + "rustix 0.38.30", "scoped-tls", "smallvec", - "wayland-sys 0.30.1", + "wayland-sys 0.31.1", ] [[package]] @@ -3684,14 +4010,14 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.30.2" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" +checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ - "bitflags 1.3.2", - "nix 0.26.2", + "bitflags 2.4.2", + "rustix 0.38.30", "wayland-backend", - "wayland-scanner 0.30.0", + "wayland-scanner 0.31.1", ] [[package]] @@ -3706,6 +4032,17 @@ dependencies = [ "wayland-sys 0.29.5", ] +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.4.2", + "cursor-icon", + "wayland-backend", +] + [[package]] name = "wayland-cursor" version = "0.29.5" @@ -3717,6 +4054,17 @@ dependencies = [ "xcursor", ] +[[package]] +name = "wayland-cursor" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" +dependencies = [ + "rustix 0.38.30", + "wayland-client 0.31.2", + "xcursor", +] + [[package]] name = "wayland-protocols" version = "0.29.5" @@ -3729,6 +4077,44 @@ dependencies = [ "wayland-scanner 0.29.5", ] +[[package]] +name = "wayland-protocols" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend", + "wayland-client 0.31.2", + "wayland-scanner 0.31.1", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.1", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.1", +] + [[package]] name = "wayland-scanner" version = "0.29.5" @@ -3742,12 +4128,12 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.30.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4834c14b3edf1d9986c83ca79b1e7e3afbe9874c7c144702f6467063259ce45d" +checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" dependencies = [ "proc-macro2", - "quick-xml", + "quick-xml 0.31.0", "quote", ] @@ -3764,21 +4150,31 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.30.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", - "lazy_static", "log", + "once_cell", "pkg-config", ] [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3792,12 +4188,13 @@ checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" [[package]] name = "wgpu" -version = "0.16.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3059ea4ddec41ca14f356833e2af65e7e38c0a8f91273867ed526fb9bafcca95" +checksum = "0bfe9a310dcf2e6b85f00c46059aaeaf4184caa8e29a1ecd4b7a704c3482332d" dependencies = [ "arrayvec", "cfg-if", + "cfg_aliases 0.1.1", "js-sys", "log", "naga", @@ -3816,16 +4213,19 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.16.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" +checksum = "6b15e451d4060ada0d99a64df44e4d590213496da7c4f245572d51071e8e30ed" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.3.1", + "bitflags 2.4.2", + "cfg_aliases 0.1.1", "codespan-reporting", + "indexmap 2.2.1", "log", "naga", + "once_cell", "parking_lot 0.12.1", "profiling", "raw-window-handle", @@ -3839,20 +4239,21 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74851c2c8e5d97652e74c241d41b0656b31c924a45dcdecde83975717362cfa4" +checksum = "e3bb47856236bfafc0bc591a925eb036ac19cd987624a447ff353e7a7e7e6f72" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 2.3.1", + "bitflags 2.4.2", "block", + "cfg_aliases 0.1.1", "core-graphics-types", "d3d12", - "foreign-types", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -3865,6 +4266,7 @@ dependencies = [ "metal", "naga", "objc", + "once_cell", "parking_lot 0.12.1", "profiling", "range-alloc", @@ -3881,11 +4283,11 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b" +checksum = "895fcbeb772bfb049eb80b2d6e47f6c9af235284e9703c96fc0218a42ffd5af2" dependencies = [ - "bitflags 2.3.1", + "bitflags 2.4.2", "js-sys", "web-sys", ] @@ -3938,9 +4340,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63287c9c4396ccf5346d035a9b0fcaead9e18377637f5eaa78b7ac65c873ff7d" +checksum = "c6a197337269a469b5b2583d65dd7dfe475fd79a525be0aa647ff6d37ac6612c" dependencies = [ "clipboard-win", "clipboard_macos", @@ -3965,20 +4367,30 @@ dependencies = [ [[package]] name = "windows" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.48.0", ] [[package]] name = "windows" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.48.0", + "windows-core", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -4014,6 +4426,15 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -4044,6 +4465,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -4056,6 +4492,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.39.0" @@ -4074,6 +4516,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.39.0" @@ -4092,6 +4540,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.39.0" @@ -4110,6 +4564,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.39.0" @@ -4128,6 +4588,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -4140,6 +4606,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.39.0" @@ -4158,38 +4630,57 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winit" -version = "0.28.6" -source = "git+https://github.com/iced-rs/winit.git?rev=c52db2045d0a2f1b8d9923870de1d4ab1994146e#c52db2045d0a2f1b8d9923870de1d4ab1994146e" +version = "0.29.10" +source = "git+https://github.com/iced-rs/winit.git?rev=b91e39ece2c0d378c3b80da7f3ab50e17bb798a5#b91e39ece2c0d378c3b80da7f3ab50e17bb798a5" dependencies = [ + "ahash 0.8.7", "android-activity", - "bitflags 1.3.2", - "cfg_aliases", + "atomic-waker", + "bitflags 2.4.2", + "bytemuck", + "calloop", + "cfg_aliases 0.1.1", "core-foundation", "core-graphics", - "dispatch", - "instant", + "cursor-icon", + "icrate", + "js-sys", "libc", "log", - "mio", + "memmap2 0.9.4", "ndk", + "ndk-sys", "objc2", "once_cell", "orbclient", "percent-encoding", "raw-window-handle", "redox_syscall 0.3.5", + "rustix 0.38.30", "sctk-adwaita", - "smithay-client-toolkit", + "smithay-client-toolkit 0.18.0", + "smol_str", + "unicode-segmentation", "wasm-bindgen", - "wayland-client 0.29.5", - "wayland-commons", - "wayland-protocols", - "wayland-scanner 0.29.5", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-protocols-plasma", "web-sys", - "windows-sys 0.45.0", + "web-time", + "windows-sys 0.48.0", "x11-dl", + "x11rb 0.13.0", + "xkbcommon-dl", ] [[package]] @@ -4228,7 +4719,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" dependencies = [ - "gethostname", + "gethostname 0.2.3", "nix 0.22.3", "winapi", "winapi-wsapoll", @@ -4236,28 +4727,24 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" +checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" dependencies = [ - "gethostname", + "as-raw-xcb-connection", + "gethostname 0.4.3", "libc", - "libloading 0.7.4", - "nix 0.25.1", + "libloading 0.8.0", "once_cell", - "winapi", - "winapi-wsapoll", + "rustix 0.38.30", "x11rb-protocol", ] [[package]] name = "x11rb-protocol" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" -dependencies = [ - "nix 0.25.1", -] +checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" [[package]] name = "xcursor" @@ -4278,6 +4765,25 @@ dependencies = [ "winapi", ] +[[package]] +name = "xkbcommon-dl" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6924668544c48c0133152e7eec86d644a056ca3d09275eb8d5cdb9855f9d8699" +dependencies = [ + "bitflags 2.4.2", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" + [[package]] name = "xml-rs" version = "0.8.13" @@ -4285,13 +4791,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d8f380ae16a37b30e6a2cf67040608071384b1450c189e61bea3ff57cde922d" [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "xxhash-rust" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] +checksum = "53be06678ed9e83edb1745eb72efc0bbcd7b5c3c35711a860906aed827a13d61" [[package]] name = "yazi" @@ -4371,6 +4874,26 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c110ba09c9b3a43edd4803d570df0da2414fed6e822e22b976a4e3ef50860701" +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "zune-inflate" version = "0.2.54" diff --git a/Cargo.toml b/Cargo.toml index bf18e2ca4..3ed8bfb9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,14 +14,14 @@ data = { version = "0.1.0", path = "data" } notify-rust = "4" chrono = { version = "0.4", features = ['serde'] } fern = "0.6.1" -iced = { version = "0.9", features = ["tokio", "lazy", "advanced", "image"] } +iced = { version = "0.12.0", features = ["tokio", "lazy", "advanced", "image"] } log = "0.4.16" once_cell = "1.18" -palette = "=0.7.2" +palette = "0.7.4" thiserror = "1.0.30" tokio = { version = "1.0", features = ["rt", "fs", "process"] } unicode-segmentation = "1.6" -open = "4.1.0" +open = "5.0.1" [dependencies.uuid] version = "1.0" @@ -34,12 +34,8 @@ image = "0.24.6" embed-resource = "2.1.1" [workspace] -members = [ - "data", - "irc", - "irc/proto", -] +members = ["data", "irc", "irc/proto"] [patch.crates-io] -iced = { git = "https://github.com/iced-rs/iced", rev = "78dc341ea82449f1e075e37e67c1ccf66b88e8d6" } -iced_core = { git = "https://github.com/iced-rs/iced", rev = "78dc341ea82449f1e075e37e67c1ccf66b88e8d6" } +iced = { git = "https://github.com/tarkah/iced", rev = "f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" } +iced_core = { git = "https://github.com/tarkah/iced", rev = "f9db8d1efe68634b7b06ce07f12ea33a3e37d79c" } diff --git a/data/Cargo.toml b/data/Cargo.toml index 05955e351..a5d2c5343 100644 --- a/data/Cargo.toml +++ b/data/Cargo.toml @@ -12,18 +12,18 @@ chrono = { version = "0.4", features = ['serde'] } dirs-next = "2.0.0" flate2 = "1.0" futures = "0.3.21" -iced_core = "0.9" +iced_core = "0.12.0" log = "0.4.16" -palette = "=0.7.2" +palette = "0.7.4" rand = "0.8.4" rand_chacha = "0.3.0" seahash = "4.1.0" serde_json = "1.0" -serde_yaml = "0.8.23" +serde_yaml = "0.9.30" thiserror = "1.0.30" tokio = { version = "1.0", features = ["io-util"] } tokio-stream = { version = "0.1", features = ["time"] } -itertools = "0.10.5" +itertools = "0.12.1" [dependencies.irc] path = "../irc" diff --git a/data/src/config/keys.rs b/data/src/config/keys.rs index 1441f8832..d48b5bf35 100644 --- a/data/src/config/keys.rs +++ b/data/src/config/keys.rs @@ -24,6 +24,8 @@ pub struct Keys { pub cycle_previous_buffer: KeyBind, #[serde(default = "KeyBind::toggle_nick_list")] pub toggle_nick_list: KeyBind, + #[serde(default = "KeyBind::command_bar")] + pub command_bar: KeyBind, } impl Default for Keys { @@ -39,6 +41,7 @@ impl Default for Keys { cycle_next_buffer: KeyBind::cycle_next_buffer(), cycle_previous_buffer: KeyBind::cycle_previous_buffer(), toggle_nick_list: KeyBind::toggle_nick_list(), + command_bar: KeyBind::command_bar(), } } } @@ -48,16 +51,17 @@ impl Keys { use crate::shortcut::Command::*; vec![ - shortcut(self.move_up, MoveUp), - shortcut(self.move_down, MoveDown), - shortcut(self.move_left, MoveLeft), - shortcut(self.move_right, MoveRight), - shortcut(self.close_buffer, CloseBuffer), - shortcut(self.maximize_buffer, MaximizeBuffer), - shortcut(self.restore_buffer, RestoreBuffer), - shortcut(self.cycle_next_buffer, CycleNextBuffer), - shortcut(self.cycle_previous_buffer, CyclePreviousBuffer), - shortcut(self.toggle_nick_list, ToggleNickList), + shortcut(self.move_up.clone(), MoveUp), + shortcut(self.move_down.clone(), MoveDown), + shortcut(self.move_left.clone(), MoveLeft), + shortcut(self.move_right.clone(), MoveRight), + shortcut(self.close_buffer.clone(), CloseBuffer), + shortcut(self.maximize_buffer.clone(), MaximizeBuffer), + shortcut(self.restore_buffer.clone(), RestoreBuffer), + shortcut(self.cycle_next_buffer.clone(), CycleNextBuffer), + shortcut(self.cycle_previous_buffer.clone(), CyclePreviousBuffer), + shortcut(self.toggle_nick_list.clone(), ToggleNickList), + shortcut(self.command_bar.clone(), CommandBar), ] } } diff --git a/data/src/shortcut.rs b/data/src/shortcut.rs index 1c200040f..0cd4c9d1e 100644 --- a/data/src/shortcut.rs +++ b/data/src/shortcut.rs @@ -1,22 +1,23 @@ +use std::hash::Hash; use std::ops; use std::str::FromStr; -use iced_core::keyboard; +use iced_core::keyboard::{self, key}; use serde::Deserialize; pub fn shortcut(key_bind: KeyBind, command: Command) -> Shortcut { Shortcut { key_bind, command } } -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Shortcut { key_bind: KeyBind, command: Command, } impl Shortcut { - pub fn execute(&self, key_bind: KeyBind) -> Option { - (self.key_bind == key_bind).then_some(self.command) + pub fn execute(&self, key_bind: &KeyBind) -> Option { + (self.key_bind == *key_bind).then_some(self.command) } } @@ -32,44 +33,83 @@ pub enum Command { CycleNextBuffer, CyclePreviousBuffer, ToggleNickList, + CommandBar, } macro_rules! default { ($name:ident, $k:tt) => { pub fn $name() -> KeyBind { KeyBind { - key_code: KeyCode(iced_core::keyboard::KeyCode::$k), + key_code: KeyCode(iced_core::keyboard::Key::Named( + iced_core::keyboard::key::Named::$k, + )), modifiers: Modifiers::default(), } } }; + ($name:ident, $k:literal, $m:expr) => { + pub fn $name() -> KeyBind { + KeyBind { + key_code: KeyCode(iced_core::keyboard::Key::Character($k.into())), + modifiers: $m, + } + } + }; ($name:ident, $k:tt, $m:expr) => { pub fn $name() -> KeyBind { KeyBind { - key_code: KeyCode(iced_core::keyboard::KeyCode::$k), + key_code: KeyCode(iced_core::keyboard::Key::Named( + iced_core::keyboard::key::Named::$k, + )), modifiers: $m, } } }; } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)] +#[derive(Debug, Clone, Eq, Ord, PartialOrd)] pub struct KeyBind { key_code: KeyCode, modifiers: Modifiers, } +impl PartialEq for KeyBind { + fn eq(&self, other: &Self) -> bool { + if self.modifiers != other.modifiers { + return false; + } + + match (&self.key_code.0, &other.key_code.0) { + // SHIFT modifier effects if this comes across as `a` or `A`, but + // we explicitly define / check modifiers so it doesn't matter if + // user defined it as `a` or `A` in their keymap + (keyboard::Key::Character(a), keyboard::Key::Character(b)) => { + a.to_lowercase() == b.to_lowercase() + } + (a, b) => a == b, + } + } +} + +impl Hash for KeyBind { + fn hash(&self, state: &mut H) { + self.key_code.hash(state); + self.modifiers.hash(state); + } +} + impl KeyBind { - default!(move_up, Up, ALT); - default!(move_down, Down, ALT); - default!(move_left, Left, ALT); - default!(move_right, Right, ALT); - default!(close_buffer, W, COMMAND); - default!(maximize_buffer, Up, COMMAND); - default!(restore_buffer, Down, COMMAND); + default!(move_up, ArrowUp, ALT); + default!(move_down, ArrowDown, ALT); + default!(move_left, ArrowLeft, ALT); + default!(move_right, ArrowRight, ALT); + default!(close_buffer, "w", COMMAND); + default!(maximize_buffer, ArrowUp, COMMAND); + default!(restore_buffer, ArrowDown, COMMAND); default!(cycle_next_buffer, Tab, CTRL); default!(cycle_previous_buffer, Tab, CTRL | SHIFT); - default!(toggle_nick_list, M, COMMAND | ALT); + default!(toggle_nick_list, "m", COMMAND | ALT); + default!(command_bar, "k", COMMAND); pub fn is_pressed( &self, @@ -78,20 +118,10 @@ impl KeyBind { ) -> bool { self.key_code == key_code.into() && self.modifiers == modifiers.into() } - - pub fn from_char(char: char, modifiers: impl Into) -> Option { - char.to_string() - .parse::() - .ok() - .map(|key_code| KeyBind { - key_code, - modifiers: modifiers.into(), - }) - } } -impl From<(keyboard::KeyCode, keyboard::Modifiers)> for KeyBind { - fn from((key_code, modifiers): (keyboard::KeyCode, keyboard::Modifiers)) -> Self { +impl From<(keyboard::Key, keyboard::Modifiers)> for KeyBind { + fn from((key_code, modifiers): (keyboard::Key, keyboard::Modifiers)) -> Self { Self { key_code: KeyCode(key_code), modifiers: Modifiers(modifiers), @@ -138,8 +168,8 @@ impl<'de> Deserialize<'de> for KeyBind { } } -#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)] -pub struct KeyCode(keyboard::KeyCode); +#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone)] +pub struct KeyCode(keyboard::Key); #[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy, Default)] pub struct Modifiers(keyboard::Modifiers); @@ -168,169 +198,63 @@ impl FromStr for KeyCode { fn from_str(s: &str) -> Result { Ok(Self(match s.to_ascii_lowercase().as_str() { - "1" => keyboard::KeyCode::Key1, - "2" => keyboard::KeyCode::Key2, - "3" => keyboard::KeyCode::Key3, - "4" => keyboard::KeyCode::Key4, - "5" => keyboard::KeyCode::Key5, - "6" => keyboard::KeyCode::Key6, - "7" => keyboard::KeyCode::Key7, - "8" => keyboard::KeyCode::Key8, - "9" => keyboard::KeyCode::Key9, - "0" => keyboard::KeyCode::Key0, - "a" => keyboard::KeyCode::A, - "b" => keyboard::KeyCode::B, - "c" => keyboard::KeyCode::C, - "d" => keyboard::KeyCode::D, - "e" => keyboard::KeyCode::E, - "f" => keyboard::KeyCode::F, - "g" => keyboard::KeyCode::G, - "h" => keyboard::KeyCode::H, - "i" => keyboard::KeyCode::I, - "j" => keyboard::KeyCode::J, - "k" => keyboard::KeyCode::K, - "l" => keyboard::KeyCode::L, - "m" => keyboard::KeyCode::M, - "n" => keyboard::KeyCode::N, - "o" => keyboard::KeyCode::O, - "p" => keyboard::KeyCode::P, - "q" => keyboard::KeyCode::Q, - "r" => keyboard::KeyCode::R, - "s" => keyboard::KeyCode::S, - "t" => keyboard::KeyCode::T, - "u" => keyboard::KeyCode::U, - "v" => keyboard::KeyCode::V, - "w" => keyboard::KeyCode::W, - "x" => keyboard::KeyCode::X, - "y" => keyboard::KeyCode::Y, - "z" => keyboard::KeyCode::Z, - "escape" => keyboard::KeyCode::Escape, - "f1" => keyboard::KeyCode::F1, - "f2" => keyboard::KeyCode::F2, - "f3" => keyboard::KeyCode::F3, - "f4" => keyboard::KeyCode::F4, - "f5" => keyboard::KeyCode::F5, - "f6" => keyboard::KeyCode::F6, - "f7" => keyboard::KeyCode::F7, - "f8" => keyboard::KeyCode::F8, - "f9" => keyboard::KeyCode::F9, - "f10" => keyboard::KeyCode::F10, - "f11" => keyboard::KeyCode::F11, - "f12" => keyboard::KeyCode::F12, - "f13" => keyboard::KeyCode::F13, - "f14" => keyboard::KeyCode::F14, - "f15" => keyboard::KeyCode::F15, - "f16" => keyboard::KeyCode::F16, - "f17" => keyboard::KeyCode::F17, - "f18" => keyboard::KeyCode::F18, - "f19" => keyboard::KeyCode::F19, - "f20" => keyboard::KeyCode::F20, - "f21" => keyboard::KeyCode::F21, - "f22" => keyboard::KeyCode::F22, - "f23" => keyboard::KeyCode::F23, - "f24" => keyboard::KeyCode::F24, - "snapshot" => keyboard::KeyCode::Snapshot, - "scroll" => keyboard::KeyCode::Scroll, - "pause" => keyboard::KeyCode::Pause, - "insert" => keyboard::KeyCode::Insert, - "home" => keyboard::KeyCode::Home, - "delete" => keyboard::KeyCode::Delete, - "end" => keyboard::KeyCode::End, - "pagedown" => keyboard::KeyCode::PageDown, - "pageup" => keyboard::KeyCode::PageUp, - "left" => keyboard::KeyCode::Left, - "up" => keyboard::KeyCode::Up, - "right" => keyboard::KeyCode::Right, - "down" => keyboard::KeyCode::Down, - "backspace" => keyboard::KeyCode::Backspace, - "enter" => keyboard::KeyCode::Enter, - "space" => keyboard::KeyCode::Space, - "compose" => keyboard::KeyCode::Compose, - "caret" => keyboard::KeyCode::Caret, - "numlock" => keyboard::KeyCode::Numlock, - "numpad0" => keyboard::KeyCode::Numpad0, - "numpad1" => keyboard::KeyCode::Numpad1, - "numpad2" => keyboard::KeyCode::Numpad2, - "numpad3" => keyboard::KeyCode::Numpad3, - "numpad4" => keyboard::KeyCode::Numpad4, - "numpad5" => keyboard::KeyCode::Numpad5, - "numpad6" => keyboard::KeyCode::Numpad6, - "numpad7" => keyboard::KeyCode::Numpad7, - "numpad8" => keyboard::KeyCode::Numpad8, - "numpad9" => keyboard::KeyCode::Numpad9, - "numpadadd" => keyboard::KeyCode::NumpadAdd, - "numpaddivide" => keyboard::KeyCode::NumpadDivide, - "numpaddecimal" => keyboard::KeyCode::NumpadDecimal, - "numpadcomma" => keyboard::KeyCode::NumpadComma, - "numpadenter" => keyboard::KeyCode::NumpadEnter, - "numpadequals" => keyboard::KeyCode::NumpadEquals, - "numpadmultiply" => keyboard::KeyCode::NumpadMultiply, - "numpadsubtract" => keyboard::KeyCode::NumpadSubtract, - "abntc1" => keyboard::KeyCode::AbntC1, - "abntc2" => keyboard::KeyCode::AbntC2, - "apostrophe" => keyboard::KeyCode::Apostrophe, - "apps" => keyboard::KeyCode::Apps, - "asterisk" => keyboard::KeyCode::Asterisk, - "at" => keyboard::KeyCode::At, - "ax" => keyboard::KeyCode::Ax, - "backslash" => keyboard::KeyCode::Backslash, - "calculator" => keyboard::KeyCode::Calculator, - "capital" => keyboard::KeyCode::Capital, - "colon" => keyboard::KeyCode::Colon, - "comma" => keyboard::KeyCode::Comma, - "convert" => keyboard::KeyCode::Convert, - "equals" => keyboard::KeyCode::Equals, - "grave" => keyboard::KeyCode::Grave, - "kana" => keyboard::KeyCode::Kana, - "kanji" => keyboard::KeyCode::Kanji, - "lalt" => keyboard::KeyCode::LAlt, - "lbracket" => keyboard::KeyCode::LBracket, - "lcontrol" => keyboard::KeyCode::LControl, - "lshift" => keyboard::KeyCode::LShift, - "lwin" => keyboard::KeyCode::LWin, - "mail" => keyboard::KeyCode::Mail, - "mediaselect" => keyboard::KeyCode::MediaSelect, - "mediastop" => keyboard::KeyCode::MediaStop, - "minus" => keyboard::KeyCode::Minus, - "mute" => keyboard::KeyCode::Mute, - "mycomputer" => keyboard::KeyCode::MyComputer, - "navigateforward" => keyboard::KeyCode::NavigateForward, // also called "Next" - "navigatebackward" => keyboard::KeyCode::NavigateBackward, // also called "Prior" - "nexttrack" => keyboard::KeyCode::NextTrack, - "noconvert" => keyboard::KeyCode::NoConvert, - "oem102" => keyboard::KeyCode::OEM102, - "period" => keyboard::KeyCode::Period, - "playpause" => keyboard::KeyCode::PlayPause, - "plus" => keyboard::KeyCode::Plus, - "power" => keyboard::KeyCode::Power, - "prevtrack" => keyboard::KeyCode::PrevTrack, - "ralt" => keyboard::KeyCode::RAlt, - "rbracket" => keyboard::KeyCode::RBracket, - "rcontrol" => keyboard::KeyCode::RControl, - "rshift" => keyboard::KeyCode::RShift, - "rwin" => keyboard::KeyCode::RWin, - "semicolon" => keyboard::KeyCode::Semicolon, - "slash" => keyboard::KeyCode::Slash, - "sleep" => keyboard::KeyCode::Sleep, - "stop" => keyboard::KeyCode::Stop, - "sysrq" => keyboard::KeyCode::Sysrq, - "tab" => keyboard::KeyCode::Tab, - "underline" => keyboard::KeyCode::Underline, - "unlabeled" => keyboard::KeyCode::Unlabeled, - "volumedown" => keyboard::KeyCode::VolumeDown, - "volumeup" => keyboard::KeyCode::VolumeUp, - "wake" => keyboard::KeyCode::Wake, - "webback" => keyboard::KeyCode::WebBack, - "webfavorites" => keyboard::KeyCode::WebFavorites, - "webforward" => keyboard::KeyCode::WebForward, - "webhome" => keyboard::KeyCode::WebHome, - "webrefresh" => keyboard::KeyCode::WebRefresh, - "websearch" => keyboard::KeyCode::WebSearch, - "webstop" => keyboard::KeyCode::WebStop, - "yen" => keyboard::KeyCode::Yen, - "copy" => keyboard::KeyCode::Copy, - "paste" => keyboard::KeyCode::Paste, - "cut" => keyboard::KeyCode::Cut, + "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0" | "a" | "b" | "c" | "d" + | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" + | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" => keyboard::Key::Character(s.into()), + "escape" | "esc" => keyboard::Key::Named(key::Named::Escape), + "f1" => keyboard::Key::Named(key::Named::F1), + "f2" => keyboard::Key::Named(key::Named::F2), + "f3" => keyboard::Key::Named(key::Named::F3), + "f4" => keyboard::Key::Named(key::Named::F4), + "f5" => keyboard::Key::Named(key::Named::F5), + "f6" => keyboard::Key::Named(key::Named::F6), + "f7" => keyboard::Key::Named(key::Named::F7), + "f8" => keyboard::Key::Named(key::Named::F8), + "f9" => keyboard::Key::Named(key::Named::F9), + "f10" => keyboard::Key::Named(key::Named::F10), + "f11" => keyboard::Key::Named(key::Named::F11), + "f12" => keyboard::Key::Named(key::Named::F12), + "f13" => keyboard::Key::Named(key::Named::F13), + "f14" => keyboard::Key::Named(key::Named::F14), + "f15" => keyboard::Key::Named(key::Named::F15), + "f16" => keyboard::Key::Named(key::Named::F16), + "f17" => keyboard::Key::Named(key::Named::F17), + "f18" => keyboard::Key::Named(key::Named::F18), + "f19" => keyboard::Key::Named(key::Named::F19), + "f20" => keyboard::Key::Named(key::Named::F20), + "f21" => keyboard::Key::Named(key::Named::F21), + "f22" => keyboard::Key::Named(key::Named::F22), + "f23" => keyboard::Key::Named(key::Named::F23), + "f24" => keyboard::Key::Named(key::Named::F24), + "home" => keyboard::Key::Named(key::Named::Home), + "delete" => keyboard::Key::Named(key::Named::Delete), + "end" => keyboard::Key::Named(key::Named::End), + "pagedown" => keyboard::Key::Named(key::Named::PageDown), + "pageup" => keyboard::Key::Named(key::Named::PageUp), + "left" => keyboard::Key::Named(key::Named::ArrowLeft), + "up" => keyboard::Key::Named(key::Named::ArrowUp), + "right" => keyboard::Key::Named(key::Named::ArrowRight), + "down" => keyboard::Key::Named(key::Named::ArrowDown), + "backspace" => keyboard::Key::Named(key::Named::Backspace), + "enter" => keyboard::Key::Named(key::Named::Enter), + "space" => keyboard::Key::Named(key::Named::Space), + "numlock" => keyboard::Key::Named(key::Named::NumLock), + "alt" => keyboard::Key::Named(key::Named::Alt), + "tab" => keyboard::Key::Named(key::Named::Tab), + "pause" => keyboard::Key::Named(key::Named::Pause), + "insert" => keyboard::Key::Named(key::Named::Insert), + "cut" => keyboard::Key::Named(key::Named::Cut), + "paste" => keyboard::Key::Named(key::Named::Paste), + "copy" => keyboard::Key::Named(key::Named::Copy), + "volumedown" => keyboard::Key::Named(key::Named::AudioVolumeDown), + "volumeup" => keyboard::Key::Named(key::Named::AudioVolumeUp), + "shift" => keyboard::Key::Named(key::Named::Shift), + "control" => keyboard::Key::Named(key::Named::Control), + "mute" => keyboard::Key::Named(key::Named::AudioVolumeMute), + "mediastop" => keyboard::Key::Named(key::Named::MediaStop), + "mediapause" => keyboard::Key::Named(key::Named::MediaPause), + "mediatracknext" => keyboard::Key::Named(key::Named::MediaTrackNext), + "mediatrackprev" => keyboard::Key::Named(key::Named::MediaTrackPrevious), _ => return Err(ParseError::InvalidKeyCode(s.to_string())), })) } diff --git a/data/src/time.rs b/data/src/time.rs index c767e7384..d7ac704b6 100644 --- a/data/src/time.rs +++ b/data/src/time.rs @@ -1,6 +1,6 @@ use std::time::SystemTime; -use chrono::{DateTime, NaiveDateTime, Utc}; +use chrono::{DateTime, NaiveDateTime, TimeZone, Utc}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] @@ -29,6 +29,6 @@ impl Posix { let nanos = (self.0 % 1_000_000_000) as u32; NaiveDateTime::from_timestamp_opt(seconds, nanos) - .map(|datetime| DateTime::from_utc(datetime, Utc)) + .map(|datetime| Utc.from_utc_datetime(&datetime)) } } diff --git a/irc/proto/Cargo.toml b/irc/proto/Cargo.toml index ed6f7af59..6a4cb4f33 100644 --- a/irc/proto/Cargo.toml +++ b/irc/proto/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -itertools = "0.10.5" +itertools = "0.12.1" nom = "7.1" thiserror = "1.0.30" diff --git a/src/buffer/channel.rs b/src/buffer/channel.rs index 8755d5096..309dbdabe 100644 --- a/src/buffer/channel.rs +++ b/src/buffer/channel.rs @@ -121,6 +121,7 @@ pub fn view<'a>( ) .map(Message::InputView) ] + .width(Length::Fill) }); let content = match (settings.users.visible, config.buffer.channel.users.position) { @@ -227,25 +228,20 @@ mod nick_list { use crate::widget::Element; pub fn view(users: &[User]) -> Element { - let column = column( - users - .iter() - .map(|user| { - let content = text(format!( - "{}{}", - user.highest_access_level(), - user.nickname() - )) - .style(if user.is_away() { - theme::Text::Transparent - } else { - theme::Text::Primary - }); + let column = column(users.iter().map(|user| { + let content = text(format!( + "{}{}", + user.highest_access_level(), + user.nickname() + )) + .style(if user.is_away() { + theme::Text::Transparent + } else { + theme::Text::Primary + }); - user_context::view(content, user.clone()) - }) - .collect(), - ) + user_context::view(content, user.clone()) + })) .padding(4) .spacing(1); diff --git a/src/event.rs b/src/event.rs index ea7903e01..42f7fd872 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1,4 +1,4 @@ -use iced::{keyboard, subscription, window, Subscription}; +use iced::{event, keyboard, window, Subscription}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Event { @@ -7,11 +7,10 @@ pub enum Event { Escape, Home, End, - CommandBar, } pub fn events() -> Subscription { - subscription::events_with(filtered_events) + event::listen_with(filtered_events) } fn filtered_events(event: iced::Event, status: iced::event::Status) -> Option { @@ -19,26 +18,23 @@ fn filtered_events(event: iced::Event, status: iced::event::Status) -> Option Some(Event::Escape), iced::Event::Keyboard(keyboard::Event::KeyPressed { - key_code: keyboard::KeyCode::C, + key: keyboard::Key::Character(c), modifiers, - }) if modifiers.command() => Some(Event::Copy), + .. + }) if c.as_str() == "c" && modifiers.command() => Some(Event::Copy), iced::Event::Keyboard(keyboard::Event::KeyPressed { - key_code: keyboard::KeyCode::Home, + key: keyboard::Key::Named(keyboard::key::Named::Home), .. }) if ignored(status) => Some(Event::Home), iced::Event::Keyboard(keyboard::Event::KeyPressed { - key_code: keyboard::KeyCode::End, + key: keyboard::Key::Named(keyboard::key::Named::End), .. }) if ignored(status) => Some(Event::End), - iced::Event::Keyboard(keyboard::Event::KeyPressed { - key_code: keyboard::KeyCode::K, - modifiers, - }) if modifiers.command() => Some(Event::CommandBar), - iced::Event::Window(window::Event::CloseRequested) => Some(Event::CloseRequested), + iced::Event::Window(_, window::Event::CloseRequested) => Some(Event::CloseRequested), _ => None, } } diff --git a/src/font.rs b/src/font.rs index e143eafee..7677768f2 100644 --- a/src/font.rs +++ b/src/font.rs @@ -1,15 +1,12 @@ +use std::borrow::Cow; use std::sync::OnceLock; use data::Config; -use iced::font::{self, Error}; -use iced::Command; +use iced::font; pub static MONO: Font = Font::new(false); pub static MONO_BOLD: Font = Font::new(true); -pub const ICON: iced::Font = iced::Font { - monospaced: true, - ..iced::Font::with_name("bootstrap-icons") -}; +pub const ICON: iced::Font = iced::Font::with_name("bootstrap-icons"); #[derive(Debug, Clone)] pub struct Font { @@ -34,7 +31,6 @@ impl Font { }; let _ = self.inner.set(iced::Font { - monospaced: true, weight, ..iced::Font::with_name(name) }); @@ -56,11 +52,17 @@ pub fn set(config: Option<&Config>) { MONO_BOLD.set(family); } -pub fn load() -> Command> { - Command::batch(vec![ - font::load(include_bytes!("../fonts/iosevka-term-regular.ttf").as_slice()), - font::load(include_bytes!("../fonts/iosevka-term-bold.ttf").as_slice()), - font::load(include_bytes!("../fonts/iosevka-term-italic.ttf").as_slice()), - font::load(include_bytes!("../fonts/icons.ttf").as_slice()), - ]) +pub fn load() -> Vec> { + vec![ + include_bytes!("../fonts/iosevka-term-regular.ttf") + .as_slice() + .into(), + include_bytes!("../fonts/iosevka-term-bold.ttf") + .as_slice() + .into(), + include_bytes!("../fonts/iosevka-term-italic.ttf") + .as_slice() + .into(), + include_bytes!("../fonts/icons.ttf").as_slice().into(), + ] } diff --git a/src/icon.rs b/src/icon.rs index 5f5448254..97fad4616 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -41,7 +41,7 @@ pub fn people<'a>() -> Text<'a> { fn to_text<'a>(unicode: char) -> Text<'a> { text(unicode.to_string()) .style(theme::Text::Primary) - .line_height(LineHeight::Relative(1.1)) + .line_height(LineHeight::Relative(1.0)) .size(theme::ICON_SIZE) .font(font::ICON) } diff --git a/src/main.rs b/src/main.rs index 50056034c..aaefe5037 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,12 +83,15 @@ fn settings( iced::Settings { default_font: font::MONO.clone().into(), - default_text_size, - window: window::settings(), - exit_on_close_request: false, + default_text_size: default_text_size.into(), + window: window::Settings { + exit_on_close_request: false, + ..window::settings() + }, flags: config_load, id: None, antialiasing: false, + fonts: font::load(), } } @@ -165,7 +168,6 @@ pub enum Message { Help(help::Message), Welcome(welcome::Message), Event(Event), - FontsLoaded(Result<(), iced::font::Error>), Tick(Instant), } @@ -178,10 +180,7 @@ impl Application for Halloy { fn new(config_load: Self::Flags) -> (Halloy, Command) { let (halloy, command) = Halloy::load_from_state(config_load); - ( - halloy, - Command::batch(vec![font::load().map(Message::FontsLoaded), command]), - ) + (halloy, command) } fn title(&self) -> String { @@ -422,18 +421,13 @@ impl Application for Halloy { Command::none() } }, - Message::FontsLoaded(Ok(())) => Command::none(), - Message::FontsLoaded(Err(error)) => { - log::error!("fonts failed to load: {error:?}"); - Command::none() - } Message::Event(event) => { if let Screen::Dashboard(dashboard) = &mut self.screen { dashboard .handle_event(event, &self.clients, &self.config, &mut self.theme) .map(Message::Dashboard) } else if let event::Event::CloseRequested = event { - window::close() + window::close(window::Id::MAIN) } else { Command::none() } diff --git a/src/screen/dashboard.rs b/src/screen/dashboard.rs index c4c34c6d3..33a4d40a4 100644 --- a/src/screen/dashboard.rs +++ b/src/screen/dashboard.rs @@ -8,7 +8,7 @@ use data::history::manager::Broadcast; use data::user::Nick; use data::{client, history, server, Config, Server, User}; use iced::widget::pane_grid::{self, PaneGrid}; -use iced::widget::{container, row, Space}; +use iced::widget::{column, container, row, Space}; use iced::{clipboard, window, Command, Length}; use self::command_bar::CommandBar; @@ -87,11 +87,11 @@ impl Dashboard { return self.focus_pane(pane); } pane::Message::PaneResized(pane_grid::ResizeEvent { split, ratio }) => { - self.panes.resize(&split, ratio); + self.panes.resize(split, ratio); self.last_changed = Some(Instant::now()); } pane::Message::PaneDragged(pane_grid::DragEvent::Dropped { pane, target }) => { - self.panes.drop(&pane, target); + self.panes.drop(pane, target); self.last_changed = Some(Instant::now()); } pane::Message::PaneDragged(_) => {} @@ -104,7 +104,7 @@ impl Dashboard { return self.split_pane(axis, config); } pane::Message::Buffer(id, message) => { - if let Some(pane) = self.panes.get_mut(&id) { + if let Some(pane) = self.panes.get_mut(id) { let (command, event) = pane.buffer.update(message, clients, &mut self.history); @@ -172,7 +172,7 @@ impl Dashboard { return self.open_buffer(kind, config); } side_menu::Event::Replace(kind, pane) => { - if let Some(state) = self.panes.get_mut(&pane) { + if let Some(state) = self.panes.get_mut(pane) { state.buffer = Buffer::from(kind); self.last_changed = Some(Instant::now()); self.focus = None; @@ -183,7 +183,7 @@ impl Dashboard { } } side_menu::Event::Close(pane) => { - self.panes.close(&pane); + self.panes.close(pane); self.last_changed = Some(Instant::now()); if self.focus == Some(pane) { @@ -191,7 +191,7 @@ impl Dashboard { } } side_menu::Event::Swap(from, to) => { - self.panes.swap(&from, &to); + self.panes.swap(from, to); self.last_changed = Some(Instant::now()); return self.focus_pane(from); } @@ -202,8 +202,8 @@ impl Dashboard { // Close pane if let Some(pane) = pane { - if self.panes.close(&pane).is_none() { - if let Some(state) = self.panes.get_mut(&pane) { + if self.panes.close(pane).is_none() { + if let Some(state) = self.panes.get_mut(pane) { state.buffer = Buffer::Empty; } } @@ -294,7 +294,7 @@ impl Dashboard { self.history.update(message); } Message::Close => { - return window::close(); + return window::close(window::Id::MAIN); } Message::DashboardSaved(Ok(_)) => { log::info!("dashboard saved"); @@ -335,7 +335,7 @@ impl Dashboard { let mut commands = vec![]; if let Some(pane) = self.focus.take() { - if let Some(state) = self.panes.get_mut(&pane) { + if let Some(state) = self.panes.get_mut(pane) { state.buffer = Buffer::from(buffer); self.last_changed = Some(Instant::now()); @@ -389,7 +389,7 @@ impl Dashboard { let mut move_focus = |direction: pane_grid::Direction| { if let Some(pane) = self.focus.as_ref() { - if let Some(adjacent) = self.panes.adjacent(pane, direction) { + if let Some(adjacent) = self.panes.adjacent(*pane, direction) { return self.focus_pane(adjacent); } } else if let Some((pane, _)) = self.panes.panes.iter().next() { @@ -411,7 +411,7 @@ impl Dashboard { } MaximizeBuffer => { if let Some(pane) = self.focus.as_ref() { - self.panes.maximize(pane); + self.panes.maximize(*pane); } } RestoreBuffer => { @@ -456,6 +456,13 @@ impl Dashboard { }); } } + CommandBar => { + return self.toggle_command_bar( + &closed_buffers(self, clients), + config, + theme, + ); + } } } } @@ -543,7 +550,10 @@ impl Dashboard { 10.0, ) } else { - base.into() + // Align `base` into same view tree shape + // as `anchored_overlay` to prevent diff + // from firing when displaying command bar + column![column![base]].into() }; shortcut(base, config.keys.shortcuts(), Message::Shortcut) @@ -615,7 +625,6 @@ impl Dashboard { Command::perform(task, |_| Message::Close) } - CommandBar => self.toggle_command_bar(&closed_buffers(self, clients), config, theme), } } @@ -661,7 +670,7 @@ impl Dashboard { let result = self .panes - .split(axis, &pane_to_split, Pane::new(Buffer::from(kind), config)); + .split(axis, pane_to_split, Pane::new(Buffer::from(kind), config)); self.last_changed = Some(Instant::now()); if let Some((pane, _)) = result { @@ -765,7 +774,7 @@ impl Dashboard { fn get_focused_mut(&mut self) -> Option<(pane_grid::Pane, &mut Pane)> { let pane = self.focus?; - self.panes.get_mut(&pane).map(|state| (pane, state)) + self.panes.get_mut(pane).map(|state| (pane, state)) } fn focus_pane(&mut self, pane: pane_grid::Pane) -> Command { @@ -792,7 +801,7 @@ impl Dashboard { if self.is_pane_maximized() { self.panes.restore(); } else if let Some(pane) = self.focus { - self.panes.maximize(&pane); + self.panes.maximize(pane); } } @@ -811,7 +820,7 @@ impl Dashboard { if let Some(pane) = pane { let result = self .panes - .split(axis, &pane, Pane::new(Buffer::Empty, config)); + .split(axis, pane, Pane::new(Buffer::Empty, config)); self.last_changed = Some(Instant::now()); if let Some((pane, _)) = result { @@ -832,7 +841,7 @@ impl Dashboard { if let Some(pane) = self.focus { let result = self .panes - .split(axis, &pane, Pane::new(Buffer::Empty, config)); + .split(axis, pane, Pane::new(Buffer::Empty, config)); self.last_changed = Some(Instant::now()); if let Some((pane, _)) = result { return self.focus_pane(pane); @@ -859,9 +868,9 @@ impl Dashboard { fn close_pane(&mut self, pane: pane_grid::Pane) -> Command { self.last_changed = Some(Instant::now()); - if let Some((_, sibling)) = self.panes.close(&pane) { + if let Some((_, sibling)) = self.panes.close(pane) { return self.focus_pane(sibling); - } else if let Some(pane) = self.panes.get_mut(&pane) { + } else if let Some(pane) = self.panes.get_mut(pane) { pane.buffer = Buffer::Empty; } @@ -1005,7 +1014,7 @@ impl<'a> From<&'a Dashboard> for data::Dashboard { b: Box::new(from_layout(panes, *b)), }, Node::Pane(pane) => panes - .get(&pane) + .get(pane) .cloned() .map(data::Pane::from) .unwrap_or(data::Pane::Empty), diff --git a/src/screen/dashboard/command_bar.rs b/src/screen/dashboard/command_bar.rs index 0700a3d6f..eb3cf0a0a 100644 --- a/src/screen/dashboard/command_bar.rs +++ b/src/screen/dashboard/command_bar.rs @@ -69,7 +69,7 @@ impl CommandBar { // and prevent undesired effects let combo_box = key_press( combo_box, - key_press::KeyCode::Escape, + key_press::Key::Named(key_press::Named::Escape), key_press::Modifiers::default(), Message::Ignored, ); @@ -83,8 +83,7 @@ impl CommandBar { .iter() .map(|command| text(command).size(font_size)), ) - .map(Element::from) - .collect(), + .map(Element::from), ) // Give it some extra width .padding([0, 20]), diff --git a/src/theme.rs b/src/theme.rs index 43c4aed7e..d39593f4d 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -1,7 +1,7 @@ use data::message; use data::theme::{randomize_color, Colors}; use iced::widget::{button, container, pane_grid, rule, scrollable, text, text_input}; -use iced::{application, overlay, Background, Color}; +use iced::{application, overlay, Background, Border, Color}; use crate::widget::selectable_text; @@ -188,25 +188,32 @@ impl container::StyleSheet for Theme { }, Container::PaneBody { selected } => container::Appearance { background: Some(Background::Color(self.colors().background.dark)), - border_radius: 4.0.into(), - border_width: 1.0, - border_color: if *selected { - self.colors().action.base - } else { - Color::TRANSPARENT + border: Border { + radius: 4.0.into(), + width: 1.0, + color: if *selected { + self.colors().action.base + } else { + Color::TRANSPARENT + }, }, ..Default::default() }, Container::PaneHeader => container::Appearance { background: Some(Background::Color(self.colors().background.darker)), - border_radius: [4.0, 4.0, 0.0, 0.0].into(), - border_width: 1.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: [4.0, 4.0, 0.0, 0.0].into(), + width: 1.0, + color: Color::TRANSPARENT, + }, ..Default::default() }, Container::Command { selected } if *selected => container::Appearance { background: Some(Background::Color(self.colors().background.darker)), - border_radius: 3.0.into(), + border: Border { + radius: 3.0.into(), + ..Default::default() + }, ..Default::default() }, Container::Command { .. } => container::Appearance { @@ -216,18 +223,23 @@ impl container::StyleSheet for Theme { Container::Context => container::Appearance { //TODO: Blur background when possible? background: Some(Background::Color(self.colors().background.base)), - border_radius: 4.0.into(), - border_width: 1.0, - border_color: if self.colors().background.is_dark() { - self.colors().background.lighter - } else { - self.colors().background.darker + border: Border { + radius: 4.0.into(), + width: 1.0, + color: if self.colors().background.is_dark() { + self.colors().background.lighter + } else { + self.colors().background.darker + }, }, ..Default::default() }, Container::Highlight => container::Appearance { background: Some(Background::Color(self.colors().info.high_alpha)), - border_radius: 0.0.into(), + border: Border { + radius: 0.0.into(), + ..Default::default() + }, ..Default::default() }, Container::SemiTransparent => container::Appearance { @@ -267,46 +279,65 @@ impl button::StyleSheet for Theme { Button::Default => button::Appearance { background: Some(Background::Color(self.colors().action.high_alpha)), text_color: self.colors().action.base, - border_radius: 3.0.into(), + border: Border { + radius: 3.0.into(), + ..Default::default() + }, ..Default::default() }, Button::Secondary => button::Appearance { background: Some(Background::Color(self.colors().text.high_alpha)), text_color: self.colors().text.base, - border_radius: 3.0.into(), + border: Border { + radius: 3.0.into(), + ..Default::default() + }, ..Default::default() }, Button::SideMenu { selected } if *selected => button::Appearance { background: Some(Background::Color(self.colors().background.darker)), - border_radius: 3.0.into(), + border: Border { + radius: 3.0.into(), + ..Default::default() + }, ..Default::default() }, Button::SideMenu { .. } => button::Appearance { background: None, - border_radius: 3.0.into(), + border: Border { + radius: 3.0.into(), + ..Default::default() + }, ..Default::default() }, Button::Pane { selected } if *selected => button::Appearance { background: Some(Background::Color(self.colors().action.med_alpha)), - border_color: self.colors().action.low_alpha, - border_width: 1.0, - border_radius: 3.0.into(), + border: Border { + color: self.colors().action.low_alpha, + width: 1.0, + radius: 3.0.into(), + }, ..Default::default() }, Button::Pane { .. } => button::Appearance { background: Some(Background::Color(self.colors().background.dark)), - border_color: if self.colors().background.is_dark() { - self.colors().background.lightest - } else { - self.colors().background.darkest + border: Border { + color: if self.colors().background.is_dark() { + self.colors().background.lightest + } else { + self.colors().background.darkest + }, + width: 1.0, + radius: 3.0.into(), }, - border_width: 1.0, - border_radius: 3.0.into(), ..Default::default() }, Button::Context => button::Appearance { background: Some(Background::Color(Color::TRANSPARENT)), - border_radius: 4.0.into(), + border: Border { + radius: 4.0.into(), + ..Default::default() + }, ..Default::default() }, Button::Bare => button::Appearance { @@ -335,13 +366,19 @@ impl button::StyleSheet for Theme { Button::Default => button::Appearance { background: Some(Background::Color(self.colors().action.med_alpha)), text_color: self.colors().action.base, - border_radius: 3.0.into(), + border: Border { + radius: 3.0.into(), + ..Default::default() + }, ..Default::default() }, Button::Secondary => button::Appearance { background: Some(Background::Color(self.colors().text.med_alpha)), text_color: self.colors().text.base, - border_radius: 3.0.into(), + border: Border { + radius: 3.0.into(), + ..Default::default() + }, ..Default::default() }, Button::SideMenu { selected } if *selected => button::Appearance { @@ -380,9 +417,12 @@ impl button::StyleSheet for Theme { a: 0.2, ..active.text_color }, - border_color: Color { - a: 0.2, - ..active.border_color + border: Border { + color: Color { + a: 0.2, + ..active.border.color + }, + ..Default::default() }, ..active } @@ -403,26 +443,34 @@ impl scrollable::StyleSheet for Theme { match style { Scrollable::Default => scrollable::Scrollbar { background: Some(Background::Color(self.colors().background.darker)), - border_radius: 8.0.into(), - border_width: 1.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: 8.0.into(), + width: 1.0, + color: Color::TRANSPARENT, + }, scroller: scrollable::Scroller { color: self.colors().background.darkest, - border_radius: 8.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: 8.0.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, }, }, Scrollable::Hidden => scrollable::Scrollbar { background: Some(Background::Color(Color::TRANSPARENT)), - border_radius: 8.0.into(), - border_width: 1.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: 8.0.into(), + width: 1.0, + color: Color::TRANSPARENT, + }, scroller: scrollable::Scroller { color: Color::TRANSPARENT, - border_radius: 8.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: 8.0.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, }, }, } @@ -454,9 +502,11 @@ impl pane_grid::StyleSheet for Theme { match style { PaneGrid::Default => pane_grid::Appearance { background: Background::Color(self.colors().action.high_alpha), - border_width: 1.0, - border_color: self.colors().action.base, - border_radius: 4.0.into(), + border: Border { + width: 1.0, + color: self.colors().action.base, + radius: 4.0.into(), + }, }, } } @@ -494,15 +544,20 @@ impl text_input::StyleSheet for Theme { match style { TextInput::Default => text_input::Appearance { background: Background::Color(self.colors().background.darker), - border_radius: 4.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - // XXX Not currently displayed in application. + border: Border { + radius: 4.0.into(), + width: 0.0, + color: Color::TRANSPARENT, + // XXX Not currently displayed in application. + }, icon_color: self.colors().info.base, }, TextInput::Error => text_input::Appearance { - border_width: 1.0, - border_color: self.colors().error.base, + border: Border { + width: 1.0, + color: self.colors().error.base, + ..Default::default() + }, ..self.active(&TextInput::Default) }, } @@ -544,10 +599,12 @@ impl text_input::StyleSheet for Theme { match style { TextInput::Default | TextInput::Error => text_input::Appearance { background: Background::Color(self.colors().background.light), - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, - // XXX Not currently displayed in application. + border: Border { + radius: 0.0.into(), + width: 0.0, + color: Color::TRANSPARENT, + // XXX Not currently displayed in application. + }, icon_color: self.colors().info.base, }, } @@ -583,21 +640,25 @@ impl overlay::menu::StyleSheet for Theme { Menu::Default => overlay::menu::Appearance { text_color: self.colors().text.base, background: Background::Color(self.colors().background.base), - border_width: 1.0, - border_radius: 4.0.into(), - border_color: self.colors().action.base, + border: Border { + width: 1.0, + radius: 4.0.into(), + color: self.colors().action.base, + }, selected_text_color: self.colors().text.high_alpha, selected_background: Background::Color(self.colors().background.high_alpha), }, Menu::ComboBox => overlay::menu::Appearance { text_color: self.colors().text.base, background: Background::Color(self.colors().background.base), - border_width: 1.0, - border_radius: 4.0.into(), - border_color: if self.colors().background.is_dark() { - self.colors().background.lighter - } else { - self.colors().background.darker + border: Border { + width: 1.0, + radius: 4.0.into(), + color: if self.colors().background.is_dark() { + self.colors().background.lighter + } else { + self.colors().background.darker + }, }, selected_text_color: self.colors().text.base, selected_background: Background::Color(self.colors().background.dark), diff --git a/src/widget.rs b/src/widget.rs index f11b7af00..29692f466 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -22,12 +22,12 @@ pub mod key_press; pub mod selectable_text; pub mod shortcut; -pub type Renderer = iced::Renderer; -pub type Element<'a, Message> = iced::Element<'a, Message, Renderer>; -pub type Content<'a, Message> = iced::widget::pane_grid::Content<'a, Message, Renderer>; -pub type TitleBar<'a, Message> = iced::widget::pane_grid::TitleBar<'a, Message, Renderer>; -pub type Column<'a, Message> = iced::widget::Column<'a, Message, Renderer>; -pub type Row<'a, Message> = iced::widget::Row<'a, Message, Renderer>; -pub type Text<'a> = iced::widget::Text<'a, Renderer>; -pub type Container<'a, Message> = iced::widget::Container<'a, Message, Renderer>; -pub type Button<'a, Message> = iced::widget::Button<'a, Message>; +pub type Renderer = iced::Renderer; +pub type Element<'a, Message> = iced::Element<'a, Message, Theme, Renderer>; +pub type Content<'a, Message> = iced::widget::pane_grid::Content<'a, Message, Theme, Renderer>; +pub type TitleBar<'a, Message> = iced::widget::pane_grid::TitleBar<'a, Message, Theme, Renderer>; +pub type Column<'a, Message> = iced::widget::Column<'a, Message, Theme, Renderer>; +pub type Row<'a, Message> = iced::widget::Row<'a, Message, Theme, Renderer>; +pub type Text<'a> = iced::widget::Text<'a, Theme, Renderer>; +pub type Container<'a, Message> = iced::widget::Container<'a, Message, Theme, Renderer>; +pub type Button<'a, Message> = iced::widget::Button<'a, Message, Theme>; diff --git a/src/widget/anchored_overlay.rs b/src/widget/anchored_overlay.rs index 29ff4dd73..1e301b6ff 100644 --- a/src/widget/anchored_overlay.rs +++ b/src/widget/anchored_overlay.rs @@ -1,4 +1,3 @@ -use iced::advanced::widget::tree; use iced::advanced::{layout, overlay, renderer, widget, Clipboard, Layout, Shell, Widget}; use iced::{event, mouse, Event, Length, Point, Rectangle, Size, Vector}; @@ -33,17 +32,24 @@ struct AnchoredOverlay<'a, Message> { offset: f32, } -impl<'a, Message> Widget for AnchoredOverlay<'a, Message> { - fn width(&self) -> Length { - self.base.as_widget().width() +impl<'a, Message> Widget for AnchoredOverlay<'a, Message> { + fn size(&self) -> Size { + self.base.as_widget().size() } - fn height(&self) -> Length { - self.base.as_widget().height() + fn size_hint(&self) -> Size { + self.base.as_widget().size_hint() } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - self.base.as_widget().layout(renderer, limits) + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.base + .as_widget() + .layout(&mut tree.children[0], renderer, limits) } fn draw( @@ -67,15 +73,6 @@ impl<'a, Message> Widget for AnchoredOverlay<'a, Message> { ) } - fn tag(&self) -> tree::Tag { - struct Marker; - tree::Tag::of::() - } - - fn state(&self) -> tree::State { - tree::State::None - } - fn children(&self) -> Vec { vec![ widget::Tree::new(&self.base), @@ -144,7 +141,7 @@ impl<'a, Message> Widget for AnchoredOverlay<'a, Message> { tree: &'b mut widget::Tree, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { let (first, second) = tree.children.split_at_mut(1); let base = self @@ -187,8 +184,14 @@ struct Overlay<'a, 'b, Message> { base_layout: Rectangle, } -impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Message> { - fn layout(&self, renderer: &Renderer, bounds: Size, position: Point) -> layout::Node { +impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Message> { + fn layout( + &mut self, + renderer: &Renderer, + bounds: Size, + position: Point, + _translation: Vector, + ) -> layout::Node { let height = match self.anchor { // From top of base to top of viewport Anchor::AboveTop => position.y, @@ -206,7 +209,10 @@ impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Me .width(Length::Fill) .height(Length::Fill); - let mut node = self.content.as_widget().layout(renderer, &limits); + let node = self + .content + .as_widget() + .layout(self.tree, renderer, &limits); let translation = match self.anchor { // Overlay height + offset above the top @@ -218,9 +224,7 @@ impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Me ), }; - node.move_to(position + translation); - - node + node.move_to(position + translation) } fn draw( @@ -294,7 +298,7 @@ impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Me &'c mut self, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { self.content .as_widget_mut() .overlay(self.tree, layout, renderer) diff --git a/src/widget/combo_box.rs b/src/widget/combo_box.rs index b505f8c26..72fff0742 100644 --- a/src/widget/combo_box.rs +++ b/src/widget/combo_box.rs @@ -1,3 +1,4 @@ +use iced::advanced::graphics::text::Paragraph; use iced::advanced::{ layout, mouse, overlay, renderer, text, widget, Clipboard, Layout, Shell, Widget, }; @@ -11,35 +12,36 @@ use std::fmt::Display; use std::time::Instant; use super::Element; +use crate::Theme; /// A widget for searching and selecting a single value from a list of options. /// /// This widget is composed by a [`TextInput`] that can be filled with the text /// to search for corresponding values from the list of options that are displayed /// as a [`Menu`]. -pub struct ComboBox<'a, T, Message, Renderer = super::Renderer> +pub struct ComboBox<'a, T, Message, Theme = crate::Theme, Renderer = super::Renderer> where Renderer: text::Renderer, - Renderer::Theme: text_input::StyleSheet + menu::StyleSheet, + Theme: text_input::StyleSheet + menu::StyleSheet, { state: &'a State, - text_input: TextInput<'a, TextInputEvent, Renderer>, + text_input: TextInput<'a, TextInputEvent, Theme, Renderer>, font: Option, selection: text_input::Value, on_selected: Box Message>, on_option_hovered: Option Message>>, on_close: Option, on_input: Option Message>>, - menu_style: ::Style, + menu_style: ::Style, padding: Padding, size: Option, } -impl<'a, T, Message, Renderer> ComboBox<'a, T, Message, Renderer> +impl<'a, T, Message, Theme, Renderer> ComboBox<'a, T, Message, Theme, Renderer> where T: std::fmt::Display + Clone, Renderer: text::Renderer, - Renderer::Theme: text_input::StyleSheet + menu::StyleSheet, + Theme: text_input::StyleSheet + menu::StyleSheet, { /// Creates a new [`ComboBox`] with the given list of options, a placeholder, /// the current selected value, and the message to produce when an option is @@ -102,8 +104,8 @@ where // TODO: Define its own `StyleSheet` trait pub fn style(mut self, style: S) -> Self where - S: Into<::Style> - + Into<::Style> + S: Into<::Style> + + Into<::Style> + Clone, { self.menu_style = style.clone().into(); @@ -114,7 +116,7 @@ where /// Sets the style of the [`TextInput`] of the [`ComboBox`]. pub fn text_input_style(mut self, style: S) -> Self where - S: Into<::Style> + Clone, + S: Into<::Style> + Clone, { self.text_input = self.text_input.style(style); self @@ -168,7 +170,7 @@ pub struct State(RefCell>); #[derive(Debug, Clone)] struct Inner { - text_input: text_input::State, + text_input: text_input::State, value: String, options: Vec, option_matchers: Vec, @@ -280,14 +282,17 @@ where impl Inner { fn text_input_tree(&self) -> widget::Tree { widget::Tree { - tag: widget::tree::Tag::of::(), + tag: widget::tree::Tag::of::>(), state: widget::tree::State::new(self.text_input.clone()), children: vec![], } } fn update_text_input(&mut self, tree: widget::Tree) { - self.text_input = tree.state.downcast_ref::().clone(); + self.text_input = tree + .state + .downcast_ref::>() + .clone(); } } @@ -333,24 +338,38 @@ enum TextInputEvent { TextChanged(String), } -impl<'a, T, Message, Renderer> Widget for ComboBox<'a, T, Message, Renderer> +impl<'a, T, Message, Renderer> Widget + for ComboBox<'a, T, Message, Theme, Renderer> where T: Display + Clone + 'static, Message: Clone, Renderer: text::Renderer, - Renderer::Theme: + Theme: container::StyleSheet + text_input::StyleSheet + scrollable::StyleSheet + menu::StyleSheet, { - fn width(&self) -> Length { - Widget::::width(&self.text_input) + fn size(&self) -> iced::Size { + Widget::::size(&self.text_input) } - fn height(&self) -> Length { - Widget::::height(&self.text_input) + fn size_hint(&self) -> iced::Size { + Widget::::size_hint(&self.text_input) } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - self.text_input.layout(renderer, limits) + fn layout( + &self, + _tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + let mut tree = self.state.text_input_tree(); + let node = Widget::::layout( + &self.text_input, + &mut tree, + renderer, + limits, + ); + self.state.update_text_input(tree); + node } fn tag(&self) -> widget::tree::Tag { @@ -440,16 +459,11 @@ where } } - if let Event::Keyboard(keyboard::Event::KeyPressed { - key_code, - modifiers, - .. - }) = event - { + if let Event::Keyboard(keyboard::Event::KeyPressed { key, modifiers, .. }) = event { let shift_modifier = modifiers.shift(); - match (key_code, shift_modifier) { - (keyboard::KeyCode::Enter, _) => { + match (key, shift_modifier) { + (keyboard::Key::Named(keyboard::key::Named::Enter), _) => { if let Some(index) = &menu.hovered_option { if let Some(option) = state.filtered_options.options.get(*index) { menu.new_selection = Some(option.clone()); @@ -458,7 +472,8 @@ where event_status = event::Status::Captured; } - (keyboard::KeyCode::Up, _) | (keyboard::KeyCode::Tab, true) => { + (keyboard::Key::Named(keyboard::key::Named::ArrowUp), _) + | (keyboard::Key::Named(keyboard::key::Named::Tab), true) => { if let Some(index) = &mut menu.hovered_option { if *index == 0 { *index = state.filtered_options.options.len().saturating_sub(1); @@ -482,7 +497,8 @@ where event_status = event::Status::Captured; } - (keyboard::KeyCode::Down, _) | (keyboard::KeyCode::Tab, false) => { + (keyboard::Key::Named(keyboard::key::Named::ArrowDown), _) + | (keyboard::Key::Named(keyboard::key::Named::Tab), false) => { if let Some(index) = &mut menu.hovered_option { if *index == state.filtered_options.options.len().saturating_sub(1) { @@ -574,11 +590,11 @@ where &self, _tree: &widget::Tree, renderer: &mut Renderer, - theme: &Renderer::Theme, + theme: &Theme, _style: &renderer::Style, layout: Layout<'_>, cursor: mouse::Cursor, - _viewport: &Rectangle, + viewport: &Rectangle, ) { let selection = if self.state.is_focused() || self.selection.is_empty() { None @@ -588,7 +604,7 @@ where let tree = self.state.text_input_tree(); self.text_input - .draw(&tree, renderer, theme, layout, cursor, selection); + .draw(&tree, renderer, theme, layout, cursor, selection, viewport); } fn overlay<'b>( @@ -596,7 +612,7 @@ where tree: &'b mut widget::Tree, layout: Layout<'_>, _renderer: &Renderer, - ) -> Option> { + ) -> Option> { let Menu { menu, filtered_options, diff --git a/src/widget/context_menu.rs b/src/widget/context_menu.rs index 1b027b442..709e1e79c 100644 --- a/src/widget/context_menu.rs +++ b/src/widget/context_menu.rs @@ -1,7 +1,7 @@ use iced::advanced::widget::tree; use iced::advanced::{layout, overlay, renderer, widget, Clipboard, Layout, Shell, Widget}; use iced::widget::{column, container}; -use iced::{event, mouse, Event, Length, Point, Rectangle, Size}; +use iced::{event, mouse, Event, Length, Point, Rectangle, Size, Vector}; use super::{double_pass, Element, Renderer}; use crate::{theme, Theme}; @@ -17,11 +17,7 @@ where { let build_menu = |length, view: &dyn Fn(T, Length) -> Element<'a, Message>| { container(column( - entries - .iter() - .copied() - .map(|entry| view(entry, length)) - .collect(), + entries.iter().copied().map(|entry| view(entry, length)), )) .padding(4) .style(theme::Container::Context) @@ -59,17 +55,24 @@ impl State { } } -impl<'a, Message> Widget for ContextMenu<'a, Message> { - fn width(&self) -> Length { - self.base.as_widget().width() +impl<'a, Message> Widget for ContextMenu<'a, Message> { + fn size(&self) -> Size { + self.base.as_widget().size() } - fn height(&self) -> Length { - self.base.as_widget().height() + fn size_hint(&self) -> Size { + self.base.as_widget().size_hint() } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - self.base.as_widget().layout(renderer, limits) + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.base + .as_widget() + .layout(&mut tree.children[0], renderer, limits) } fn draw( @@ -171,7 +174,7 @@ impl<'a, Message> Widget for ContextMenu<'a, Message> { tree: &'b mut widget::Tree, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { let state = tree.state.downcast_mut::(); let (first, second) = tree.children.split_at_mut(1); @@ -211,13 +214,22 @@ struct Overlay<'a, 'b, Message> { state: &'b mut State, } -impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Message> { - fn layout(&self, renderer: &Renderer, viewport: Size, position: Point) -> layout::Node { +impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Message> { + fn layout( + &mut self, + renderer: &Renderer, + viewport: Size, + position: Point, + _translation: Vector, + ) -> layout::Node { let limits = layout::Limits::new(Size::ZERO, viewport) .width(Length::Fill) .height(Length::Fill); - let mut node = self.content.as_widget().layout(renderer, &limits); + let node = self + .content + .as_widget() + .layout(self.tree, renderer, &limits); let viewport = Rectangle::new(Point::ORIGIN, viewport); let mut bounds = Rectangle::new(position, node.size()); @@ -234,9 +246,7 @@ impl<'a, 'b, Message> overlay::Overlay for Overlay<'a, 'b, Me bounds.y = viewport.y + viewport.height - bounds.height; } - node.move_to(bounds.position()); - - node + node.move_to(bounds.position()) } fn draw( diff --git a/src/widget/double_click.rs b/src/widget/double_click.rs index 3e5b21419..fda66cdfd 100644 --- a/src/widget/double_click.rs +++ b/src/widget/double_click.rs @@ -2,7 +2,7 @@ use std::time; use iced::advanced::widget::{self, tree, Tree}; use iced::advanced::{mouse, overlay, renderer, Clipboard, Layout, Shell, Widget}; -use iced::{advanced, event, Rectangle}; +use iced::{advanced, event, Length, Rectangle, Size}; const TIMEOUT_MILLIS: u64 = 250; @@ -27,24 +27,27 @@ impl Default for Internal { } } -impl<'a, Message> Widget for DoubleClick<'a, Message> +impl<'a, Message> Widget for DoubleClick<'a, Message> where Message: Clone, { - fn width(&self) -> iced::Length { - self.content.as_widget().width() + fn size(&self) -> Size { + self.content.as_widget().size() } - fn height(&self) -> iced::Length { - self.content.as_widget().height() + fn size_hint(&self) -> Size { + self.content.as_widget().size_hint() } fn layout( &self, + tree: &mut widget::Tree, renderer: &Renderer, limits: &advanced::layout::Limits, ) -> advanced::layout::Node { - self.content.as_widget().layout(renderer, limits) + self.content + .as_widget() + .layout(&mut tree.children[0], renderer, limits) } fn tag(&self) -> widget::tree::Tag { @@ -115,7 +118,7 @@ where } let event::Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) = event else { - return event::Status::Ignored; + return event::Status::Ignored; }; let state = tree.state.downcast_mut::(); @@ -166,7 +169,7 @@ where tree: &'b mut widget::Tree, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { self.content .as_widget_mut() .overlay(&mut tree.children[0], layout, renderer) diff --git a/src/widget/double_pass.rs b/src/widget/double_pass.rs index fec22e665..2321f6eca 100644 --- a/src/widget/double_pass.rs +++ b/src/widget/double_pass.rs @@ -29,21 +29,32 @@ struct DoublePass<'a, Message> { second_pass: Element<'a, Message>, } -impl<'a, Message> Widget for DoublePass<'a, Message> { - fn width(&self) -> Length { - self.second_pass.as_widget().width() +impl<'a, Message> Widget for DoublePass<'a, Message> { + fn size(&self) -> Size { + self.second_pass.as_widget().size() } - fn height(&self) -> Length { - self.second_pass.as_widget().height() + fn size_hint(&self) -> Size { + self.second_pass.as_widget().size_hint() } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - let layout = self.first_pass.as_widget().layout(renderer, limits); + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + let layout = self.first_pass.as_widget().layout( + &mut widget::Tree::new(&self.first_pass), + renderer, + limits, + ); let new_limits = layout::Limits::new(Size::ZERO, layout.size()); - self.second_pass.as_widget().layout(renderer, &new_limits) + self.second_pass + .as_widget() + .layout(tree, renderer, &new_limits) } fn draw( @@ -123,7 +134,7 @@ impl<'a, Message> Widget for DoublePass<'a, Message> { tree: &'b mut widget::Tree, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { self.second_pass .as_widget_mut() .overlay(tree, layout, renderer) diff --git a/src/widget/hover.rs b/src/widget/hover.rs index 36a33ef6a..171ced025 100644 --- a/src/widget/hover.rs +++ b/src/widget/hover.rs @@ -9,7 +9,10 @@ pub fn hover<'a, Message: 'a>( mod component { use iced::widget::{component, Component}; - use crate::widget::{Element, Renderer}; + use crate::{ + theme::Theme, + widget::{Element, Renderer}, + }; pub enum Event { Change(super::widget::Cursor), @@ -28,7 +31,7 @@ mod component { } } - impl<'a, Message> Component for Hover<'a, Message> { + impl<'a, Message> Component for Hover<'a, Message> { type State = bool; type Event = Event; @@ -64,6 +67,7 @@ mod component { mod widget { use iced::advanced::widget::{self, tree}; use iced::advanced::{layout, mouse, overlay, renderer, Clipboard, Layout, Shell, Widget}; + use iced::{Length, Size}; use crate::widget::{Element, Renderer}; use crate::Theme; @@ -90,17 +94,24 @@ mod widget { } } - impl<'a, Message> Widget for Hover<'a, Message> { - fn width(&self) -> iced::Length { - self.content.as_widget().width() + impl<'a, Message> Widget for Hover<'a, Message> { + fn size(&self) -> Size { + self.content.as_widget().size() } - fn height(&self) -> iced::Length { - self.content.as_widget().height() + fn size_hint(&self) -> Size { + self.content.as_widget().size_hint() } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - self.content.as_widget().layout(renderer, limits) + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.content + .as_widget() + .layout(&mut tree.children[0], renderer, limits) } fn tag(&self) -> widget::tree::Tag { @@ -212,7 +223,7 @@ mod widget { tree: &'b mut widget::Tree, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { self.content .as_widget_mut() .overlay(&mut tree.children[0], layout, renderer) diff --git a/src/widget/input.rs b/src/widget/input.rs index 442abcdee..81e0d99be 100644 --- a/src/widget/input.rs +++ b/src/widget/input.rs @@ -7,7 +7,7 @@ use iced::Rectangle; use self::completion::Completion; use super::{anchored_overlay, key_press, Element, Renderer}; -use crate::theme; +use crate::theme::{self, Theme}; mod completion; @@ -78,7 +78,7 @@ pub struct State { selected_history: Option, } -impl<'a, Message> Component for Input<'a, Message> +impl<'a, Message> Component for Input<'a, Message> where Message: Clone, { @@ -196,7 +196,7 @@ where // Add tab support let mut input = key_press( text_input, - key_press::KeyCode::Tab, + key_press::Key::Named(key_press::Named::Tab), key_press::Modifiers::default(), Event::Tab, ); @@ -206,11 +206,11 @@ where input = key_press( key_press( input, - key_press::KeyCode::Up, + key_press::Key::Named(key_press::Named::ArrowUp), key_press::Modifiers::default(), Event::Up, ), - key_press::KeyCode::Down, + key_press::Key::Named(key_press::Named::ArrowDown), key_press::Modifiers::default(), Event::Down, ); diff --git a/src/widget/input/completion.rs b/src/widget/input/completion.rs index 2e4a1bbad..3bd4a2c58 100644 --- a/src/widget/input/completion.rs +++ b/src/widget/input/completion.rs @@ -212,23 +212,18 @@ impl Commands { .collect::>(); let content = |width| { - column( - entries - .iter() - .map(|(index, command)| { - let selected = Some(*index) == *highlighted; - let content = text(format!("/{}", command.title)); - - Element::from( - container(content) - .width(width) - .style(theme::Container::Command { selected }) - .padding(6) - .center_y(), - ) - }) - .collect(), - ) + column(entries.iter().map(|(index, command)| { + let selected = Some(*index) == *highlighted; + let content = text(format!("/{}", command.title)); + + Element::from( + container(content) + .width(width) + .style(theme::Container::Command { selected }) + .padding(6) + .center_y(), + ) + })) }; (!entries.is_empty()).then(|| { @@ -238,6 +233,7 @@ impl Commands { container(double_pass(first_pass, second_pass)) .padding(4) .style(theme::Container::Context) + .width(Length::Shrink) .into() }) } @@ -273,7 +269,7 @@ impl Command { Element::from(text(format!(" {arg}")).style(style)) }); - container(row(title.into_iter().chain(args).collect())) + container(row(title.into_iter().chain(args))) .style(theme::Container::Context) .padding(8) .center_y() diff --git a/src/widget/key_press.rs b/src/widget/key_press.rs index 02b9bde88..114e59f08 100644 --- a/src/widget/key_press.rs +++ b/src/widget/key_press.rs @@ -1,14 +1,14 @@ use iced::advanced::widget::tree; use iced::advanced::{layout, overlay, renderer, widget, Clipboard, Layout, Shell, Widget}; -pub use iced::keyboard::{KeyCode, Modifiers}; -use iced::{event, keyboard, mouse, Event, Length, Rectangle}; +pub use iced::keyboard::{key::Named, Key, Modifiers}; +use iced::{event, keyboard, mouse, Event, Length, Rectangle, Size}; use super::{Element, Renderer}; use crate::Theme; pub fn key_press<'a, Message>( base: impl Into>, - key_code: KeyCode, + key: Key, modifiers: Modifiers, on_press: Message, ) -> Element<'a, Message> @@ -17,7 +17,7 @@ where { KeyPress { content: base.into(), - key_code, + key, modifiers, on_press, } @@ -26,25 +26,30 @@ where struct KeyPress<'a, Message> { content: Element<'a, Message>, - key_code: KeyCode, + key: Key, modifiers: Modifiers, on_press: Message, } -impl<'a, Message> Widget for KeyPress<'a, Message> +impl<'a, Message> Widget for KeyPress<'a, Message> where Message: Clone, { - fn width(&self) -> Length { - self.content.as_widget().width() + fn size(&self) -> Size { + self.content.as_widget().size() } - fn height(&self) -> Length { - self.content.as_widget().height() + fn size_hint(&self) -> Size { + self.content.as_widget().size_hint() } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - self.content.as_widget().layout(renderer, limits) + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.content.as_widget().layout(tree, renderer, limits) } fn draw( @@ -101,12 +106,8 @@ where shell: &mut Shell<'_, Message>, viewport: &Rectangle, ) -> event::Status { - if let Event::Keyboard(keyboard::Event::KeyPressed { - key_code, - modifiers, - }) = &event - { - if *key_code == self.key_code && *modifiers == self.modifiers { + if let Event::Keyboard(keyboard::Event::KeyPressed { key, modifiers, .. }) = &event { + if *key == self.key && *modifiers == self.modifiers { shell.publish(self.on_press.clone()); return event::Status::Captured; } @@ -135,7 +136,7 @@ where tree: &'b mut widget::Tree, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { self.content.as_widget_mut().overlay(tree, layout, renderer) } } diff --git a/src/widget/selectable_text.rs b/src/widget/selectable_text.rs index 1a3c57d25..b9fed5275 100644 --- a/src/widget/selectable_text.rs +++ b/src/widget/selectable_text.rs @@ -1,11 +1,13 @@ use std::borrow::Cow; use iced::advanced::renderer::Quad; +use iced::advanced::text::Paragraph; use iced::advanced::widget::{operation, tree, Operation, Tree}; use iced::advanced::{layout, mouse, renderer, text, widget, Layout, Widget}; use iced::widget::text_input::Value; use iced::{ - alignment, event, touch, Color, Command, Element, Length, Pixels, Point, Rectangle, Size, + alignment, event, touch, Border, Color, Command, Element, Length, Pixels, Point, Rectangle, + Shadow, Size, }; use self::selection::selection; @@ -13,21 +15,21 @@ pub use self::text::{LineHeight, Shaping}; mod selection; -pub fn selectable_text<'a, Renderer>(content: impl ToString) -> Text<'a, Renderer> +pub fn selectable_text<'a, Theme, Renderer>(content: impl ToString) -> Text<'a, Theme, Renderer> where Renderer: text::Renderer, - Renderer::Theme: StyleSheet, + Theme: StyleSheet, { Text::new(content.to_string()) } -pub struct Text<'a, Renderer> +pub struct Text<'a, Theme, Renderer> where Renderer: text::Renderer, - Renderer::Theme: StyleSheet, + Theme: StyleSheet, { content: Cow<'a, str>, - size: Option, + size: Option, line_height: LineHeight, width: Length, height: Length, @@ -35,13 +37,13 @@ where vertical_alignment: alignment::Vertical, font: Option, shaping: Shaping, - style: ::Style, + style: ::Style, } -impl<'a, Renderer> Text<'a, Renderer> +impl<'a, Theme, Renderer> Text<'a, Theme, Renderer> where Renderer: text::Renderer, - Renderer::Theme: StyleSheet, + Theme: StyleSheet, { pub fn new(content: impl Into>) -> Self { Text { @@ -62,7 +64,7 @@ where } pub fn size(mut self, size: impl Into) -> Self { - self.size = Some(size.into().0); + self.size = Some(size.into()); self } @@ -76,7 +78,7 @@ where self } - pub fn style(mut self, style: impl Into<::Style>) -> Self { + pub fn style(mut self, style: impl Into<::Style>) -> Self { self.style = style.into(); self } @@ -107,46 +109,56 @@ where } } -impl<'a, Message, Renderer> Widget for Text<'a, Renderer> +impl<'a, Message, Theme, Renderer> Widget for Text<'a, Theme, Renderer> where Renderer: text::Renderer, - Renderer::Theme: StyleSheet, + Theme: StyleSheet, { - fn width(&self) -> Length { - self.width - } - - fn height(&self) -> Length { - self.height + fn size(&self) -> Size { + Size { + width: self.width, + height: self.height, + } } fn tag(&self) -> tree::Tag { - tree::Tag::of::() + tree::Tag::of::>() } fn state(&self) -> tree::State { - tree::State::new(State::default()) + tree::State::new(State::::default()) } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - let limits = limits.width(self.width).height(self.height); - - let size = self.size.unwrap_or_else(|| renderer.default_size()); - - let bounds = limits.max(); - - let Size { width, height } = renderer.measure( - &self.content, - size, - self.line_height, - self.font.unwrap_or_else(|| renderer.default_font()), - bounds, - self.shaping, - ); - - let size = limits.resolve(Size::new(width, height)); - - layout::Node::new(size) + fn layout( + &self, + tree: &mut Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + let state = tree.state.downcast_mut::>(); + + layout::sized(limits, self.width, self.height, |limits| { + let bounds = limits.max(); + + let size = self + .size + .map(Pixels::from) + .unwrap_or_else(|| renderer.default_size()); + let font = self.font.unwrap_or_else(|| renderer.default_font()); + + state.paragraph.update(text::Text { + content: &self.content, + size, + line_height: self.line_height, + bounds, + font, + horizontal_alignment: self.horizontal_alignment, + vertical_alignment: self.vertical_alignment, + shaping: self.shaping, + }); + + state.paragraph.min_bounds() + }) } fn on_event( @@ -160,33 +172,33 @@ where _shell: &mut iced::advanced::Shell<'_, Message>, _viewport: &Rectangle, ) -> event::Status { - let state = tree.state.downcast_mut::(); + let state = tree.state.downcast_mut::>(); match event { iced::Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) | iced::Event::Touch(touch::Event::FingerPressed { .. }) => { if let Some(cursor) = cursor.position() { - *state = State::Selecting(selection::Raw { + state.interaction = Interaction::Selecting(selection::Raw { start: cursor, end: cursor, }); } else { - *state = State::Idle; + state.interaction = Interaction::Idle; } } iced::Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) | iced::Event::Touch(touch::Event::FingerLifted { .. }) | iced::Event::Touch(touch::Event::FingerLost { .. }) => { - if let State::Selecting(raw) = *state { - *state = State::Selected(raw); + if let Interaction::Selecting(raw) = state.interaction { + state.interaction = Interaction::Selected(raw); } else { - *state = State::Idle; + state.interaction = Interaction::Idle; } } iced::Event::Mouse(mouse::Event::CursorMoved { .. }) | iced::Event::Touch(touch::Event::FingerMoved { .. }) => { if let Some(cursor) = cursor.position() { - if let State::Selecting(raw) = state { + if let Interaction::Selecting(raw) = &mut state.interaction { raw.end = cursor; } } @@ -201,7 +213,7 @@ where &self, tree: &Tree, renderer: &mut Renderer, - theme: &Renderer::Theme, + theme: &Theme, style: &renderer::Style, layout: Layout<'_>, _cursor_position: mouse::Cursor, @@ -215,12 +227,19 @@ where let appearance = theme.appearance(&self.style); - let state = tree.state.downcast_ref::(); + let state = tree.state.downcast_ref::>(); - if let Some(selection) = state.selection().and_then(|raw| raw.resolve(bounds)) { + if let Some(selection) = state + .interaction + .selection() + .and_then(|raw| raw.resolve(bounds)) + { let line_height = f32::from( - self.line_height - .to_absolute(self.size.unwrap_or_else(|| renderer.default_size()).into()), + self.line_height.to_absolute( + self.size + .map(Pixels::from) + .unwrap_or_else(|| renderer.default_size()), + ), ); let baseline_y = @@ -249,9 +268,12 @@ where renderer.fill_quad( Quad { bounds: Rectangle::new(Point::new(x, y), Size::new(width, line_height)), - border_radius: 0.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: 0.0.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, + shadow: Shadow::default(), }, appearance.selection_color, ); @@ -326,18 +348,7 @@ where // } // } - draw( - renderer, - layout, - &self.content, - self.size, - self.line_height, - self.font, - appearance.color.unwrap_or(style.text_color), - self.horizontal_alignment, - self.vertical_alignment, - self.shaping, - ); + draw(renderer, style, layout, state, appearance, viewport); } fn mouse_interaction( @@ -359,24 +370,18 @@ where &self, tree: &mut Tree, layout: Layout<'_>, - renderer: &Renderer, + _renderer: &Renderer, operation: &mut dyn Operation, ) { - let state = tree.state.downcast_ref::(); + let state = tree.state.downcast_ref::>(); let bounds = layout.bounds(); let value = Value::new(&self.content); - if let Some(selection) = state.selection().and_then(|raw| { - selection( - raw, - renderer, - self.font, - self.size, - self.line_height, - bounds, - &value, - ) - }) { + if let Some(selection) = state + .interaction + .selection() + .and_then(|raw| selection(raw, bounds, &state.paragraph, &value)) + { let content = value.select(selection.start, selection.end).to_string(); operation.custom(&mut (bounds.y, content), None); } @@ -385,88 +390,85 @@ where fn draw( renderer: &mut Renderer, + style: &renderer::Style, layout: Layout<'_>, - content: &str, - size: Option, - line_height: LineHeight, - font: Option, - value_color: Color, - horizontal_alignment: alignment::Horizontal, - vertical_alignment: alignment::Vertical, - shaping: Shaping, + state: &State, + appearance: Appearance, + viewport: &Rectangle, ) where Renderer: text::Renderer, { + let State { paragraph, .. } = &state; let bounds = layout.bounds(); - let x = match horizontal_alignment { + let x = match paragraph.horizontal_alignment() { alignment::Horizontal::Left => bounds.x, alignment::Horizontal::Center => bounds.center_x(), alignment::Horizontal::Right => bounds.x + bounds.width, }; - let y = match vertical_alignment { + let y = match paragraph.vertical_alignment() { alignment::Vertical::Top => bounds.y, alignment::Vertical::Center => bounds.center_y(), alignment::Vertical::Bottom => bounds.y + bounds.height, }; - let size = size.unwrap_or_else(|| renderer.default_size()); - - renderer.fill_text(iced::advanced::Text { - content, - size, - line_height, - bounds: Rectangle { x, y, ..bounds }, - color: value_color, - font: font.unwrap_or_else(|| renderer.default_font()), - horizontal_alignment, - vertical_alignment, - shaping, - }); + renderer.fill_paragraph( + paragraph, + Point::new(x, y), + appearance.color.unwrap_or(style.text_color), + *viewport, + ); } -impl<'a, Message, Renderer> From> for Element<'a, Message, Renderer> +impl<'a, Message, Theme, Renderer> From> + for Element<'a, Message, Theme, Renderer> where Renderer: text::Renderer + 'a, - Renderer::Theme: StyleSheet, + Theme: StyleSheet + 'a, { - fn from(text: Text<'a, Renderer>) -> Element<'a, Message, Renderer> { + fn from(text: Text<'a, Theme, Renderer>) -> Element<'a, Message, Theme, Renderer> { Element::new(text) } } +#[derive(Debug, Default)] +pub struct State { + paragraph: P, + interaction: Interaction, +} + #[derive(Debug, Clone, Copy, Default)] -enum State { +enum Interaction { #[default] Idle, Selecting(selection::Raw), Selected(selection::Raw), } -impl State { +impl Interaction { fn selection(self) -> Option { match &self { - State::Idle => None, - State::Selecting(raw) | State::Selected(raw) => Some(*raw), + Interaction::Idle => None, + Interaction::Selecting(raw) | Interaction::Selected(raw) => Some(*raw), } } } -fn measure( - renderer: &Renderer, - value: &Value, - size: Option, - font: Option, -) -> f32 -where - Renderer: text::Renderer, -{ - let size = size.unwrap_or_else(|| renderer.default_size()); - let font = font.unwrap_or_else(|| renderer.default_font()); - - renderer.measure_width(&value.to_string(), size, font, text::Shaping::Advanced) -} +// fn measure( +// renderer: &Renderer, +// value: &Value, +// size: Option, +// font: Option, +// ) -> f32 +// where +// Renderer: text::Renderer, +// { +// let size = size.unwrap_or_else(|| renderer.default_size()); +// let font = font.unwrap_or_else(|| renderer.default_font()); + +// renderer.measure_width(&value.to_string(), size, font, text::Shaping::Advanced) +// } pub fn selected(f: fn(Vec<(f32, String)>) -> Message) -> Command { struct Selected { diff --git a/src/widget/selectable_text/selection.rs b/src/widget/selectable_text/selection.rs index 9d1cc281e..80df1b4f3 100644 --- a/src/widget/selectable_text/selection.rs +++ b/src/widget/selectable_text/selection.rs @@ -58,25 +58,19 @@ pub struct Selection { pub end: usize, } -pub fn selection( +pub fn selection( raw: Raw, - renderer: &Renderer, - font: Option, - size: Option, - line_height: text::LineHeight, bounds: Rectangle, + paragraph: &P, value: &Value, -) -> Option -where - Renderer: text::Renderer, -{ +) -> Option { let resolved = raw.resolve(bounds)?; let start_pos = relative(resolved.start, bounds); let end_pos = relative(resolved.end, bounds); - let start = find_cursor_position(renderer, font, size, line_height, bounds, value, start_pos)?; - let end = find_cursor_position(renderer, font, size, line_height, bounds, value, end_pos)?; + let start = find_cursor_position(paragraph, value, start_pos)?; + let end = find_cursor_position(paragraph, value, end_pos)?; (start != end).then(|| Selection { start: start.min(end), @@ -84,35 +78,14 @@ where }) } -fn find_cursor_position( - renderer: &Renderer, - font: Option, - size: Option, - line_height: text::LineHeight, - bounds: Rectangle, +fn find_cursor_position( + paragraph: &P, value: &Value, cursor_position: Point, -) -> Option -where - Renderer: text::Renderer, -{ - let font = font.unwrap_or_else(|| renderer.default_font()); - let size = size.unwrap_or_else(|| renderer.default_size()); - +) -> Option { let value = value.to_string(); - let char_offset = renderer - .hit_test( - &value, - size, - line_height, - font, - bounds.size(), - text::Shaping::Advanced, - cursor_position, - true, - ) - .map(text::Hit::cursor)?; + let char_offset = paragraph.hit_test(cursor_position).map(text::Hit::cursor)?; Some(unicode_segmentation::UnicodeSegmentation::graphemes(&value[..char_offset], true).count()) } diff --git a/src/widget/shortcut.rs b/src/widget/shortcut.rs index ba757e465..c73926e6d 100644 --- a/src/widget/shortcut.rs +++ b/src/widget/shortcut.rs @@ -2,7 +2,7 @@ use data::shortcut; pub use data::shortcut::Command; use iced::advanced::widget::tree; use iced::advanced::{layout, overlay, renderer, widget, Clipboard, Layout, Shell, Widget}; -use iced::{event, keyboard, mouse, Event, Length, Rectangle}; +use iced::{event, keyboard, mouse, Event, Length, Rectangle, Size}; use super::{Element, Renderer}; use crate::Theme; @@ -29,17 +29,24 @@ struct Shortcut<'a, Message> { on_press: Box Message + 'a>, } -impl<'a, Message> Widget for Shortcut<'a, Message> { - fn width(&self) -> Length { - self.content.as_widget().width() +impl<'a, Message> Widget for Shortcut<'a, Message> { + fn size(&self) -> Size { + self.content.as_widget().size() } - fn height(&self) -> Length { - self.content.as_widget().height() + fn size_hint(&self) -> Size { + self.content.as_widget().size_hint() } - fn layout(&self, renderer: &Renderer, limits: &layout::Limits) -> layout::Node { - self.content.as_widget().layout(renderer, limits) + fn layout( + &self, + tree: &mut widget::Tree, + renderer: &Renderer, + limits: &layout::Limits, + ) -> layout::Node { + self.content + .as_widget() + .layout(&mut tree.children[0], renderer, limits) } fn draw( @@ -106,16 +113,13 @@ impl<'a, Message> Widget for Shortcut<'a, Message> { let modifiers = tree.state.downcast_mut::(); match &event { - Event::Keyboard(keyboard::Event::KeyPressed { - key_code, - modifiers, - }) => { - let key_bind = shortcut::KeyBind::from((*key_code, *modifiers)); + Event::Keyboard(keyboard::Event::KeyPressed { key, modifiers, .. }) => { + let key_bind = shortcut::KeyBind::from((key.clone(), *modifiers)); if let Some(command) = self .shortcuts .iter() - .find_map(|shortcut| shortcut.execute(key_bind)) + .find_map(|shortcut| shortcut.execute(&key_bind)) { shell.publish((self.on_press)(command)); return event::Status::Captured; @@ -124,18 +128,6 @@ impl<'a, Message> Widget for Shortcut<'a, Message> { Event::Keyboard(keyboard::Event::ModifiersChanged(new_modifiers)) => { *modifiers = (*new_modifiers).into(); } - Event::Keyboard(keyboard::Event::CharacterReceived(char)) => { - // Prevent text input character entry if it matches a keybind - if let Some(key_bind) = shortcut::KeyBind::from_char(*char, *modifiers) { - if self - .shortcuts - .iter() - .any(|shortcut| shortcut.execute(key_bind).is_some()) - { - return event::Status::Captured; - } - } - } _ => {} } @@ -173,7 +165,7 @@ impl<'a, Message> Widget for Shortcut<'a, Message> { tree: &'b mut widget::Tree, layout: Layout<'_>, renderer: &Renderer, - ) -> Option> { + ) -> Option> { self.content .as_widget_mut() .overlay(&mut tree.children[0], layout, renderer) diff --git a/src/window.rs b/src/window.rs index 094fa374b..4853c21ac 100644 --- a/src/window.rs +++ b/src/window.rs @@ -1,8 +1,8 @@ -pub use iced::window::{close, Settings}; +pub use iced::window::{close, Id, Settings}; #[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "windows")))] pub fn settings() -> Settings { - Default::default() + Settings::default() } #[cfg(target_os = "linux")] @@ -11,7 +11,7 @@ pub fn settings() -> Settings { use iced::window; Settings { - platform_specific: window::PlatformSpecific { + platform_specific: window::settings::PlatformSpecific { application_id: environment::APPLICATION_ID.to_string(), }, ..Default::default() @@ -23,7 +23,7 @@ pub fn settings() -> Settings { use iced::window; Settings { - platform_specific: window::PlatformSpecific { + platform_specific: window::settings::PlatformSpecific { title_hidden: true, titlebar_transparent: true, fullsize_content_view: true,