diff --git a/gui/Cargo.lock b/gui/Cargo.lock index 21f3b175..8f89340e 100644 --- a/gui/Cargo.lock +++ b/gui/Cargo.lock @@ -98,6 +98,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "approx" version = "0.5.1" @@ -127,9 +136,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "ash" -version = "0.34.0+1.2.203" +version = "0.37.0+1.3.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f780da53d0063880d45554306489f09dd8d1bda47688b4a57bc579119356df" +checksum = "006ca68e0f2b03f22d6fa9f2860f85aed430d257fec20f8879b2145e7c7ae1a6" dependencies = [ "libloading", ] @@ -178,7 +187,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -298,12 +307,15 @@ checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "calloop" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" +checksum = "5bcf530afb40e45e14440701e5e996d7fd139e84a912a4d83a8d6a0fb3e58663" dependencies = [ "log", - "nix 0.22.3", + "nix 0.25.0", + "slotmap", + "thiserror", + "vec_map", ] [[package]] @@ -312,12 +324,6 @@ version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -390,6 +396,15 @@ dependencies = [ "x11rb", ] +[[package]] +name = "cmake" +version = "0.1.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" +dependencies = [ + "cc", +] + [[package]] name = "cocoa" version = "0.24.0" @@ -399,9 +414,9 @@ dependencies = [ "bitflags", "block", "cocoa-foundation", - "core-foundation 0.9.3", - "core-graphics 0.22.3", - "foreign-types", + "core-foundation", + "core-graphics", + "foreign-types 0.3.2", "libc", "objc", ] @@ -414,9 +429,9 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", - "core-foundation 0.9.3", + "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", "objc", ] @@ -432,20 +447,10 @@ dependencies = [ ] [[package]] -name = "copyless" -version = "0.1.5" +name = "const_panic" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] +checksum = "9ed2b28323eee4fb66bb824401daa3e46bd445b9a9298a3d382b320710ba69dd" [[package]] name = "core-foundation" @@ -453,34 +458,16 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ - "core-foundation-sys 0.8.3", + "core-foundation-sys", "libc", ] -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - [[package]] name = "core-foundation-sys" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "core-graphics" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - [[package]] name = "core-graphics" version = "0.22.3" @@ -488,9 +475,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags", - "core-foundation 0.9.3", + "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -501,22 +488,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", - "core-foundation 0.9.3", - "foreign-types", + "core-foundation", + "foreign-types 0.3.2", "libc", ] [[package]] -name = "core-video-sys" -version = "0.1.4" +name = "core-text" +version = "19.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" dependencies = [ - "cfg-if 0.1.10", - "core-foundation-sys 0.7.0", - "core-graphics 0.19.2", + "core-foundation", + "core-graphics", + "foreign-types 0.3.2", "libc", - "objc", ] [[package]] @@ -534,7 +520,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -543,7 +529,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -553,7 +539,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -565,7 +551,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset", "once_cell", @@ -578,10 +564,33 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] +[[package]] +name = "crossfont" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21fd3add36ea31aba1520aa5288714dd63be506106753226d0eb387a93bc9c45" +dependencies = [ + "cocoa", + "core-foundation", + "core-foundation-sys", + "core-graphics", + "core-text", + "dwrote", + "foreign-types 0.5.0", + "freetype-rs", + "libc", + "log", + "objc", + "once_cell", + "pkg-config", + "servo-fontconfig", + "winapi", +] + [[package]] name = "cty" version = "0.2.2" @@ -590,9 +599,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "d3d12" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" +checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759" dependencies = [ "bitflags", "libloading", @@ -699,12 +708,58 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "dwrote" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +dependencies = [ + "lazy_static", + "libc", + "serde", + "serde_derive", + "winapi", + "wio", +] + [[package]] name = "either" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +[[package]] +name = "encase" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a516181e9a36e8982cb37933c5e7dba638c42938cacde46ee4e5b4156f881b9" +dependencies = [ + "const_panic", + "encase_derive", + "glam", + "thiserror", +] + +[[package]] +name = "encase_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5b802412eea315f29f2bb2da3a5963cd6121f56eaa06aebcdc0c54eea578f22" +dependencies = [ + "encase_derive_impl", +] + +[[package]] +name = "encase_derive_impl" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f2f4de457d974f548d2c2a16f709ebd81013579e543bd1a9b19ced88132c2cf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "error-code" version = "2.3.1" @@ -724,6 +779,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "expat-sys" +version = "2.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" +dependencies = [ + "cmake", + "pkg-config", +] + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -745,6 +810,15 @@ dependencies = [ "log", ] +[[package]] +name = "find-crate" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a98bbaacea1c0eb6a0876280051b892eb73594fd90cf3b20e9c817029c57d2" +dependencies = [ + "toml", +] + [[package]] name = "flate2" version = "1.0.24" @@ -793,7 +867,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8469d0d40519bc608ec6863f1cc88f3f1deee15913f2f3b3e573d81ed38cccc" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -802,6 +897,34 @@ 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 = "freetype-rs" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" +dependencies = [ + "bitflags", + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -923,7 +1046,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -936,12 +1059,9 @@ checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "glam" -version = "0.10.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579160312273c954cc51bd440f059dde741029ac8daf8c84fece76cb77f62c15" -dependencies = [ - "version_check", -] +checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" [[package]] name = "glow" @@ -955,6 +1075,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glow_glyph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4e62c64947b9a24fe20e2bba9ad819ecb506ef5c8df7ffc4737464c6df9510" +dependencies = [ + "bytemuck", + "glow", + "glyph_brush", + "log", +] + [[package]] name = "glyph_brush" version = "0.7.4" @@ -1117,15 +1249,15 @@ dependencies = [ [[package]] name = "iced" -version = "0.4.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6025abe6b1056c9b5adad79c484c5fd8b7012e5230f3b0439a1294ade7ded7bf" +checksum = "139821b0929b3c00943b3b73405ee5ecf9a8863122c74622ddeda55a8553db1c" dependencies = [ "iced_core", "iced_futures", + "iced_glow", "iced_graphics", "iced_native", - "iced_pure", "iced_wgpu", "iced_winit", "thiserror", @@ -1133,19 +1265,20 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf9133ceb345ec640047d5597fb8aa88e9cf74ce2d0277a9a62e2d6ed4a8148" +checksum = "b55abd96c8580c45614f63725c760e2c9a1fdaf5071c7504197da97fa24f183a" dependencies = [ "bitflags", + "palette", "wasm-timer", ] [[package]] name = "iced_futures" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d13241d5ed32846bbcffaf60e27e7ceebb60cf16d791ff00d582f0d4d1b07b" +checksum = "3cc3a9fd79b857228dde2a3e923a04ade4095abeda33248c6230e8c909749366" dependencies = [ "futures", "log", @@ -1155,38 +1288,57 @@ dependencies = [ ] [[package]] -name = "iced_graphics" -version = "0.3.1" +name = "iced_glow" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2adcf703fc326e0985ea99c75f1b73e718560a7b220d57ec6478417ccb2f463f" +checksum = "27e2c14ab495501e9aba09fe28fd9b2873b91ffaaf8173a5bcda4ca1b8597ff2" dependencies = [ + "bytemuck", + "euclid", + "glow", + "glow_glyph", + "glyph_brush", + "iced_graphics", + "iced_native", + "log", +] + +[[package]] +name = "iced_graphics" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0bed954a9e61e665c6c965b56a0152d87288088736d1ca99c96b166875c5707" +dependencies = [ + "bitflags", "bytemuck", "glam", "iced_native", - "iced_pure", "iced_style", + "log", "lyon", "qrcode", - "raw-window-handle 0.4.3", + "raw-window-handle 0.5.0", + "resvg", "thiserror", + "tiny-skia 0.6.6", + "usvg", ] [[package]] name = "iced_lazy" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "333979d705964832864ee7676516ab3c3df4ab0b65efb603c86a256d4adbec6f" +checksum = "59e7ac54f3f0272459d25b19a8daf71558e5737df83b6cacbd9c3b75cb40c47f" dependencies = [ "iced_native", - "iced_pure", "ouroboros", ] [[package]] name = "iced_native" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca174d4693a5daa2ffcae38d5c28cf0dbd54bd8fc19848f28392cd52624751a" +checksum = "61964acdd967f58ee6194b0b746c5656826f1e4aafc8f12de28ad4f7ced8ec0b" dependencies = [ "iced_core", "iced_futures", @@ -1196,54 +1348,43 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "iced_pure" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80aeaecadfd6832c2c787cbdfd357adc256a51c55d68142d852037451e72f393" -dependencies = [ - "iced_native", - "iced_style", - "num-traits", -] - [[package]] name = "iced_style" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90028c94ab62c13cd3b6fb1499a593a51510d4729c5b4e8e60705b2b28c6bc2" +checksum = "ca6cad47936109f1424a9c1d4e13899621ebcd5945677dd3cf7b3dd4b74e665c" dependencies = [ "iced_core", + "once_cell", + "palette", ] [[package]] name = "iced_wgpu" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc44ca209f77bd855f035d2e86e50e66332f55fb60d9fb67eeb09eae9d9de2e" +checksum = "132e359d07022fb1066cb48f6ab6aba9b1a48c2f51060e7a9929b09851ab45b7" dependencies = [ "bitflags", "bytemuck", + "encase", "futures", + "glam", "glyph_brush", "guillotiere", "iced_graphics", "iced_native", - "kamadak-exif", "log", - "raw-window-handle 0.4.3", - "resvg", - "tiny-skia", - "usvg", + "raw-window-handle 0.5.0", "wgpu", "wgpu_glyph", ] [[package]] name = "iced_winit" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72011b895e439e2ebad8f545720e3e97c7368ecfc47a23cbfeaa9508a98af90c" +checksum = "217f078cb38bedf1d4283eca4c82327e1ef0de8c78d2652187108ebd1e613a14" dependencies = [ "iced_futures", "iced_graphics", @@ -1272,19 +1413,13 @@ dependencies = [ "hashbrown 0.12.3", ] -[[package]] -name = "inplace_it" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67f0347836f3f6362c1e7efdadde2b1c4b4556d211310b70631bae7eb692070b" - [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -1310,9 +1445,9 @@ checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -1329,15 +1464,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "kamadak-exif" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70494964492bf8e491eb3951c5d70c9627eb7100ede6cc56d748b9a3f302cfb6" -dependencies = [ - "mutate_once", -] - [[package]] name = "khronos-egl" version = "4.1.0" @@ -1346,6 +1472,7 @@ checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" dependencies = [ "libc", "libloading", + "pkg-config", ] [[package]] @@ -1391,7 +1518,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45ba81a1f5f24396b37211478aff7fbcd605dd4544df8dbed07b9da3c2057aee" dependencies = [ "byteorder", - "cfg-if 1.0.0", + "cfg-if", "hex", "hidapi", "ledger-transport", @@ -1441,7 +1568,6 @@ dependencies = [ "iced", "iced_lazy", "iced_native", - "iced_pure", "liana", "log", "serde", @@ -1453,9 +1579,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.126" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libloading" @@ -1463,10 +1589,16 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + [[package]] name = "libsqlite3-sys" version = "0.23.2" @@ -1520,14 +1652,14 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "lyon" -version = "0.17.10" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf0510ed5e3e2fb80f3db2061ef5ca92d87bfda1a624bb1eacf3bd50226e4cbb" +checksum = "91e7f9cda98b5430809e63ca5197b06c7d191bf7e26dfc467d5a3f0290e2a74f" dependencies = [ "lyon_algorithms", "lyon_tessellation", @@ -1535,42 +1667,44 @@ dependencies = [ [[package]] name = "lyon_algorithms" -version = "0.17.7" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037f716541ba0d84d3de05c0069f8068baf73990d55980558b84d944c8a244a" +checksum = "fcb7a1845c15729d73d25d42cb650b647f73c3494453a5c3cd3aae0df3ac5c6c" dependencies = [ "lyon_path", - "sid", + "num-traits", ] [[package]] name = "lyon_geom" -version = "0.17.7" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d89ccbdafd83d259403e22061be27bccc3254bba65cdc5303250c4227c8c8e" +checksum = "5237e77afe5a112d5ce8060e3473e78b09b5f8cea722a251dcafa1254711f440" dependencies = [ - "arrayvec 0.5.2", + "arrayvec 0.7.2", "euclid", "num-traits", ] [[package]] name = "lyon_path" -version = "0.17.7" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0a59fdf767ca0d887aa61d1b48d4bbf6a124c1a45503593f7d38ab945bfbc0" +checksum = "2b2a6c0d4a27bb3fe8b747184caf79a57b8bd2caeee49c0f9e59d068d30f7a0d" dependencies = [ "lyon_geom", + "num-traits", ] [[package]] name = "lyon_tessellation" -version = "0.17.10" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7230e08dd0638048e46f387f255dbe7a7344a3e6705beab53242b5af25635760" +checksum = "9ba55cb38c7c601bc578e30164ec0f806a3e731c2593c8702500901cd4c363a4" dependencies = [ "float_next_after", "lyon_path", + "thiserror", ] [[package]] @@ -1641,14 +1775,14 @@ dependencies = [ [[package]] name = "metal" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084" +checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" dependencies = [ "bitflags", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "log", "objc", ] @@ -1686,7 +1820,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1702,17 +1836,11 @@ dependencies = [ "winapi", ] -[[package]] -name = "mutate_once" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" - [[package]] name = "naga" -version = "0.8.5" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3012f2dbcc79e8e0b5825a4836a7106a75dd9b2fe42c528163be0f572538c705" +checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707" dependencies = [ "bit-set", "bitflags", @@ -1723,19 +1851,22 @@ dependencies = [ "num-traits", "rustc-hash", "spirv", + "termcolor", "thiserror", + "unicode-xid", ] [[package]] name = "ndk" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags", "jni-sys", "ndk-sys", "num_enum", + "raw-window-handle 0.5.0", "thiserror", ] @@ -1747,17 +1878,18 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-glue" -version = "0.5.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" +checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" dependencies = [ - "lazy_static", "libc", "log", "ndk", "ndk-context", "ndk-macro", "ndk-sys", + "once_cell", + "parking_lot 0.12.1", ] [[package]] @@ -1775,9 +1907,12 @@ dependencies = [ [[package]] name = "ndk-sys" -version = "0.2.2" +version = "0.4.1+23.1.7779620" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] [[package]] name = "nix" @@ -1787,7 +1922,7 @@ checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" dependencies = [ "bitflags", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -1800,7 +1935,7 @@ checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" dependencies = [ "bitflags", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -1812,10 +1947,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "libc", ] +[[package]] +name = "nix" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "libc", + "memoffset", +] + [[package]] name = "no-std-compat" version = "0.4.1" @@ -1849,6 +1997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1932,9 +2081,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "ordered-float" @@ -1978,6 +2127,30 @@ dependencies = [ "ttf-parser 0.15.2", ] +[[package]] +name = "palette" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9cd68f7112581033f157e56c77ac4a5538ec5836a2e39284e65bd7d7275e49" +dependencies = [ + "approx", + "num-traits", + "palette_derive", + "phf", +] + +[[package]] +name = "palette_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05eedf46a8e7c27f74af0c9cfcdb004ceca158cb1b918c6f68f8d7a549b3e427" +dependencies = [ + "find-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -1986,7 +2159,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.4", ] [[package]] @@ -1995,7 +2178,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall", @@ -2003,12 +2186,67 @@ dependencies = [ "winapi", ] +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "phf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + [[package]] name = "pico-args" version = "0.4.2" @@ -2201,6 +2439,15 @@ dependencies = [ "cty", ] +[[package]] +name = "raw-window-handle" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + [[package]] name = "rayon" version = "1.5.3" @@ -2304,7 +2551,7 @@ dependencies = [ "png", "rgb", "svgfilters", - "tiny-skia", + "tiny-skia 0.6.6", "usvg", ] @@ -2396,6 +2643,18 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "sctk-adwaita" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61270629cc6b4d77ec1907db1033d5c2e1a404c412743621981a871dc9c12339" +dependencies = [ + "crossfont", + "log", + "smithay-client-toolkit", + "tiny-skia 0.7.0", +] + [[package]] name = "secp256k1" version = "0.24.0" @@ -2456,7 +2715,7 @@ dependencies = [ "CoreFoundation-sys", "IOKit-sys", "bitflags", - "cfg-if 1.0.0", + "cfg-if", "libudev", "mach 0.3.2", "nix 0.24.2", @@ -2465,12 +2724,24 @@ dependencies = [ ] [[package]] -name = "sid" -version = "0.6.1" +name = "servo-fontconfig" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5ac56c121948b4879bba9e519852c211bcdd8f014efff766441deff0b91bdb" +checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" dependencies = [ - "num-traits", + "libc", + "servo-fontconfig-sys", +] + +[[package]] +name = "servo-fontconfig-sys" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" +dependencies = [ + "expat-sys", + "freetype-sys", + "pkg-config", ] [[package]] @@ -2521,25 +2792,6 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" -[[package]] -name = "smithay-client-toolkit" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3" -dependencies = [ - "bitflags", - "calloop", - "dlib", - "lazy_static", - "log", - "memmap2 0.3.1", - "nix 0.22.3", - "pkg-config", - "wayland-client", - "wayland-cursor", - "wayland-protocols", -] - [[package]] name = "smithay-client-toolkit" version = "0.16.0" @@ -2547,6 +2799,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" dependencies = [ "bitflags", + "calloop", "dlib", "lazy_static", "log", @@ -2564,7 +2817,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" dependencies = [ - "smithay-client-toolkit 0.16.0", + "smithay-client-toolkit", "wayland-client", ] @@ -2729,11 +2982,36 @@ dependencies = [ "arrayref", "arrayvec 0.5.2", "bytemuck", - "cfg-if 1.0.0", + "cfg-if", "png", "safe_arch", ] +[[package]] +name = "tiny-skia" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "bytemuck", + "cfg-if", + "png", + "safe_arch", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" +dependencies = [ + "arrayref", + "bytemuck", +] + [[package]] name = "tokio" version = "1.21.2" @@ -2770,7 +3048,7 @@ version = "5.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5488e0c75c70e880823aebc3ad4ac0a6da6f48d95bc1b9a52bd3200d6f1e724" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "futures", "log", "mio-serial", @@ -2804,7 +3082,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "rand 0.8.5", "static_assertions", ] @@ -2873,6 +3151,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "usvg" version = "0.18.0" @@ -2906,6 +3190,12 @@ 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" @@ -2926,23 +3216,23 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -2951,11 +3241,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2963,9 +3253,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2973,9 +3263,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -2986,9 +3276,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "wasm-timer" @@ -2998,7 +3288,7 @@ checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ "futures", "js-sys", - "parking_lot", + "parking_lot 0.11.2", "pin-utils", "wasm-bindgen", "wasm-bindgen-futures", @@ -3080,9 +3370,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -3090,17 +3380,18 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97cd781ff044d6d697b632a2e212032c2e957d1afaa21dbf58069cbb8f78567" +checksum = "c2272b17bffc8a0c7d53897435da7c1db587c87d3a14e8dae9cdb8d1d210fc0f" dependencies = [ "arrayvec 0.7.2", "js-sys", "log", "naga", - "parking_lot", - "raw-window-handle 0.4.3", + "parking_lot 0.12.1", + "raw-window-handle 0.5.0", "smallvec", + "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3111,33 +3402,35 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.12.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4688c000eb841ca55f7b35db659b78d6e1cd77d7caf8fb929f4e181f754047d" +checksum = "73d14cad393054caf992ee02b7da6a372245d39a484f7461c1f44f6f6359bd28" dependencies = [ "arrayvec 0.7.2", + "bit-vec", "bitflags", "cfg_aliases", "codespan-reporting", - "copyless", "fxhash", "log", "naga", - "parking_lot", + "parking_lot 0.12.1", "profiling", - "raw-window-handle 0.4.3", + "raw-window-handle 0.5.0", "smallvec", "thiserror", + "web-sys", "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-hal" -version = "0.12.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d684ea6a34974a2fc19f1dfd183d11a62e22d75c4f187a574bb1224df8e056c2" +checksum = "3cc320a61acb26be4f549c9b1b53405c10a223fbfea363ec39474c32c348d12f" dependencies = [ + "android_system_properties", "arrayvec 0.7.2", "ash", "bit-set", @@ -3145,12 +3438,11 @@ dependencies = [ "block", "core-graphics-types", "d3d12", - "foreign-types", + "foreign-types 0.3.2", "fxhash", "glow", "gpu-alloc", "gpu-descriptor", - "inplace_it", "js-sys", "khronos-egl", "libloading", @@ -3158,11 +3450,12 @@ dependencies = [ "metal", "naga", "objc", - "parking_lot", + "parking_lot 0.12.1", "profiling", "range-alloc", - "raw-window-handle 0.4.3", + "raw-window-handle 0.5.0", "renderdoc-sys", + "smallvec", "thiserror", "wasm-bindgen", "web-sys", @@ -3172,18 +3465,18 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.12.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549533d9e1cdd4b4cda7718d33ff500fc4c34b5467b71d76b547ae0324f3b2a2" +checksum = "fb6b28ef22cac17b9109b25b3bf8c9a103eeb293d7c5f78653979b09140375f6" dependencies = [ "bitflags", ] [[package]] name = "wgpu_glyph" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8134edb15ae465caf308125646c9e98bdef7398cdefc69227ac77a5eb795e7fe" +checksum = "0cafb82773e0f124a33674dab5de4dff73175aeb921949047ab014efb58fb446" dependencies = [ "bytemuck", "glyph_brush", @@ -3251,37 +3544,88 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -3289,38 +3633,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] -name = "winit" -version = "0.26.1" +name = "windows_x86_64_msvc" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winit" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb796d6fbd86b2fd896c9471e6f04d39d750076ebe5680a3958f00f5ab97657c" dependencies = [ "bitflags", "cocoa", - "core-foundation 0.9.3", - "core-graphics 0.22.3", - "core-video-sys", + "core-foundation", + "core-graphics", "dispatch", "instant", - "lazy_static", "libc", "log", "mio", "ndk", "ndk-glue", - "ndk-sys", "objc", - "parking_lot", + "once_cell", + "parking_lot 0.12.1", "percent-encoding", "raw-window-handle 0.4.3", - "smithay-client-toolkit 0.15.4", + "raw-window-handle 0.5.0", + "sctk-adwaita", + "smithay-client-toolkit", "wasm-bindgen", "wayland-client", "wayland-protocols", "web-sys", - "winapi", + "windows-sys 0.36.1", "x11-dl", ] +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", +] + [[package]] name = "x11-dl" version = "2.19.1" diff --git a/gui/Cargo.toml b/gui/Cargo.toml index a3ef267d..1fdb7b49 100644 --- a/gui/Cargo.toml +++ b/gui/Cargo.toml @@ -19,10 +19,9 @@ liana = { git = "https://github.com/revault/liana", branch = "master", default-f backtrace = "0.3" base64 = "0.13" -iced = { version = "0.4", default-features= false, features = ["tokio", "wgpu", "svg", "qr_code", "pure"] } -iced_native = "0.5" -iced_lazy = { version = "0.1.1", features = ["pure"] } -iced_pure = "0.2.2" +iced = { version = "0.5", default-features= false, features = ["tokio", "wgpu", "svg", "qr_code"] } +iced_native = "0.6" +iced_lazy = { version = "0.2"} tokio = {version = "1.21.0", features = ["signal"]} serde = { version = "1.0", features = ["derive"] } diff --git a/gui/src/app/mod.rs b/gui/src/app/mod.rs index 0a130b56..3aab6ded 100644 --- a/gui/src/app/mod.rs +++ b/gui/src/app/mod.rs @@ -12,8 +12,7 @@ use std::io::Write; use std::sync::Arc; use std::time::Duration; -use iced::pure::Element; -use iced::{clipboard, time, Command, Subscription}; +use iced::{clipboard, time, Command, Element, Subscription}; use iced_native::{window, Event}; pub use liana::config::Config as DaemonConfig; diff --git a/gui/src/app/state/coins.rs b/gui/src/app/state/coins.rs index 14d7ff0e..f00f075c 100644 --- a/gui/src/app/state/coins.rs +++ b/gui/src/app/state/coins.rs @@ -1,7 +1,6 @@ use std::sync::Arc; -use iced::pure::Element; -use iced::Command; +use iced::{Command, Element}; use crate::{ app::{cache::Cache, error::Error, menu::Menu, message::Message, state::State, view}, @@ -10,7 +9,7 @@ use crate::{ pub struct CoinsPanel { coins: Vec, - selected_coin: Option, + selected: Vec, warning: Option, /// timelock value to pass for the heir to consume a coin. timelock: u32, @@ -29,7 +28,7 @@ impl CoinsPanel { } }) .collect(), - selected_coin: None, + selected: Vec::new(), warning: None, timelock, } @@ -42,7 +41,7 @@ impl State for CoinsPanel { &Menu::Coins, cache, self.warning.as_ref(), - view::coins::coins_view(cache, &self.coins, self.timelock), + view::coins::coins_view(cache, &self.coins, self.timelock, &self.selected), ) } @@ -56,6 +55,7 @@ impl State for CoinsPanel { Message::Coins(res) => match res { Err(e) => self.warning = Some(e), Ok(coins) => { + self.selected = Vec::new(); self.warning = None; self.coins = coins .iter() @@ -69,11 +69,12 @@ impl State for CoinsPanel { .collect(); } }, - Message::View(view::Message::Close) => { - self.selected_coin = None; - } Message::View(view::Message::Select(i)) => { - self.selected_coin = Some(i); + if let Some(position) = self.selected.iter().position(|j| *j == i) { + self.selected.remove(position); + } else { + self.selected.push(i); + } } _ => {} }; diff --git a/gui/src/app/state/mod.rs b/gui/src/app/state/mod.rs index 0d3dfd6a..2b024a06 100644 --- a/gui/src/app/state/mod.rs +++ b/gui/src/app/state/mod.rs @@ -6,8 +6,8 @@ use std::convert::TryInto; use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; -use iced::pure::{column, Element}; use iced::{widget::qr_code, Command, Subscription}; +use iced::{widget::Column, Element}; use liana::miniscript::bitcoin::{Address, Amount}; use super::{cache::Cache, error::Error, menu::Menu, message::Message, view}; @@ -241,7 +241,7 @@ impl State for ReceivePanel { view::receive::receive(address, self.qr_code.as_ref().unwrap()), ) } else { - view::dashboard(&Menu::Receive, cache, self.warning.as_ref(), column()) + view::dashboard(&Menu::Receive, cache, self.warning.as_ref(), Column::new()) } } fn update( diff --git a/gui/src/app/state/settings.rs b/gui/src/app/state/settings.rs index 48e78e86..ca85acf5 100644 --- a/gui/src/app/state/settings.rs +++ b/gui/src/app/state/settings.rs @@ -5,7 +5,7 @@ use std::str::FromStr; use std::sync::Arc; use chrono::prelude::*; -use iced::{pure::Element, Command}; +use iced::{Command, Element}; use liana::config::Config; diff --git a/gui/src/app/state/spend/detail.rs b/gui/src/app/state/spend/detail.rs index 74b23759..fb578841 100644 --- a/gui/src/app/state/spend/detail.rs +++ b/gui/src/app/state/spend/detail.rs @@ -1,7 +1,6 @@ use std::sync::Arc; -use iced::pure::Element; -use iced::Command; +use iced::{Command, Element}; use liana::miniscript::bitcoin::util::{bip32::Fingerprint, psbt::Psbt}; use crate::{ @@ -364,6 +363,6 @@ pub struct NoAction {} impl Action for NoAction { fn view(&self) -> Element { - iced::pure::column().into() + iced::widget::Column::new().into() } } diff --git a/gui/src/app/state/spend/mod.rs b/gui/src/app/state/spend/mod.rs index a8c4d607..e66da1a6 100644 --- a/gui/src/app/state/spend/mod.rs +++ b/gui/src/app/state/spend/mod.rs @@ -2,7 +2,7 @@ mod detail; mod step; use std::sync::Arc; -use iced::{pure::Element, Command}; +use iced::{Command, Element}; use super::{redirect, State}; use crate::{ diff --git a/gui/src/app/state/spend/step.rs b/gui/src/app/state/spend/step.rs index 28262ce2..e519a475 100644 --- a/gui/src/app/state/spend/step.rs +++ b/gui/src/app/state/spend/step.rs @@ -2,8 +2,7 @@ use std::collections::HashMap; use std::str::FromStr; use std::sync::Arc; -use iced::pure::Element; -use iced::Command; +use iced::{Command, Element}; use liana::miniscript::bitcoin::{ util::psbt::Psbt, Address, Amount, Denomination, OutPoint, Script, }; diff --git a/gui/src/app/view/coins.rs b/gui/src/app/view/coins.rs index fd938204..8af31a73 100644 --- a/gui/src/app/view/coins.rs +++ b/gui/src/app/view/coins.rs @@ -1,11 +1,11 @@ use iced::{ - pure::{column, container, row, Element}, - Alignment, Length, + widget::{Button, Column, Container, Row}, + Alignment, Element, Length, }; use crate::ui::{ color, - component::{badge, card, collapse::collapse, separation, text::*}, + component::{badge, button, card, separation, text::*}, icon, util::Collection, }; @@ -15,22 +15,36 @@ use crate::{ daemon::model::Coin, }; -pub fn coins_view<'a>(cache: &Cache, coins: &'a [Coin], timelock: u32) -> Element<'a, Message> { - column() +pub fn coins_view<'a>( + cache: &Cache, + coins: &'a [Coin], + timelock: u32, + selected: &[usize], +) -> Element<'a, Message> { + Column::new() .push( - container( - row() - .push(text(&format!(" {}", coins.len())).bold()) + Container::new( + Row::new() + .push(text(format!(" {}", coins.len()))) .push(text(" coins")), ) .width(Length::Fill), ) .push( - column() + Column::new() .spacing(10) - .push(coins.iter().fold(column().spacing(10), |col, coin| { - col.push(coin_list_view(coin, timelock, cache.blockheight as u32)) - })), + .push(coins.iter().enumerate().fold( + Column::new().spacing(10), + |col, (i, coin)| { + col.push(coin_list_view( + coin, + timelock, + cache.blockheight as u32, + i, + selected.contains(&i), + )) + }, + )), ) .align_items(Alignment::Center) .spacing(20) @@ -38,141 +52,154 @@ pub fn coins_view<'a>(cache: &Cache, coins: &'a [Coin], timelock: u32) -> Elemen } #[allow(clippy::collapsible_else_if)] -fn coin_list_view(coin: &Coin, timelock: u32, blockheight: u32) -> Element { - container(collapse::<_, _, _, _, _>( - move || { - row::() - .push( - row() - .push(badge::coin()) - .push_maybe(if coin.spend_info.is_some() { - Some( - container(text(" Spent ").small()) - .padding(3) - .style(badge::PillStyle::Success), - ) - } else { - if let Some(b) = coin.block_height { - if blockheight > b as u32 + timelock { - Some(container( - row() - .spacing(5) - .push(text(" 0").small().color(color::ALERT)) - .push( - icon::hourglass_done_icon() - .small() - .color(color::ALERT), - ) - .align_items(Alignment::Center), - )) - } else { - Some(container( - row() - .spacing(5) - .push( - text(&format!( - " {}", - b as u32 + timelock - blockheight - )) - .small(), - ) - .push(icon::hourglass_icon().small()) - .align_items(Alignment::Center), - )) - } - } else { - None - } - }) - .spacing(10) - .align_items(Alignment::Center) - .width(Length::Fill), - ) - .push( - row() - .spacing(5) +fn coin_list_view( + coin: &Coin, + timelock: u32, + blockheight: u32, + index: usize, + collapsed: bool, +) -> Container { + Container::new( + Column::new() + .push( + Button::new( + Row::new() .push( - text(&format!("{:.8}", coin.amount.to_btc())) - .bold() - .width(Length::Shrink), + Row::new() + .push(badge::coin()) + .push_maybe(if coin.spend_info.is_some() { + Some( + Container::new(text(" Spent ").small()) + .padding(3) + .style(badge::PillStyle::Success), + ) + } else { + if let Some(b) = coin.block_height { + if blockheight > b as u32 + timelock { + Some(Container::new( + Row::new() + .spacing(5) + .push(text(" 0").small().style(color::ALERT)) + .push( + icon::hourglass_done_icon() + .small() + .style(color::ALERT), + ) + .align_items(Alignment::Center), + )) + } else { + Some(Container::new( + Row::new() + .spacing(5) + .push( + text(format!( + " {}", + b as u32 + timelock - blockheight + )) + .small(), + ) + .push(icon::hourglass_icon().small()) + .align_items(Alignment::Center), + )) + } + } else { + None + } + }) + .spacing(10) + .align_items(Alignment::Center) + .width(Length::Fill), ) - .push(text("BTC")) - .align_items(Alignment::Center), - ) - .align_items(Alignment::Center) - .spacing(20) - .into() - }, - move || { - column() - .spacing(10) - .push(separation().width(Length::Fill)) - .push( - column() - .padding(10) - .spacing(5) - .push_maybe(if coin.spend_info.is_none() { - if let Some(b) = coin.block_height { - if blockheight > b as u32 + timelock { - Some(container( - text("The recovery path is available") - .bold() - .small() - .color(color::ALERT), - )) - } else { - Some(container( - text(&format!( - "The recovery path will be available in {} blocks", - b as u32 + timelock - blockheight - )) - .bold() - .small(), - )) - } - } else { - None - } - } else { - None - }) .push( - column() + Row::new() + .spacing(5) .push( - row() - .push(text("Outpoint:").small().bold()) - .push(text(&format!("{}", coin.outpoint)).small()) - .spacing(5), + text(format!("{:.8}", coin.amount.to_btc())) + .bold() + .width(Length::Shrink), ) - .push_maybe(coin.block_height.map(|b| { - row() - .push(text("Block height:").small().bold()) - .push(text(&format!("{}", b)).small()) + .push(text("BTC")) + .align_items(Alignment::Center), + ) + .align_items(Alignment::Center) + .spacing(20), + ) + .style(button::Style::TransparentBorder.into()) + .padding(10) + .on_press(Message::Select(index)), + ) + .push_maybe(if collapsed { + Some( + Column::new() + .spacing(10) + .push(separation().width(Length::Fill)) + .push( + Column::new() + .padding(10) + .spacing(5) + .push_maybe(if coin.spend_info.is_none() { + if let Some(b) = coin.block_height { + if blockheight > b as u32 + timelock { + Some(Container::new( + text("The recovery path is available") + .bold() + .small() + .style(color::ALERT), + )) + } else { + Some(Container::new( + text(format!( + "The recovery path will be available in {} blocks", + b as u32 + timelock - blockheight + )) + .bold() + .small(), + )) + } + } else { + None + } + } else { + None + }) + .push( + Column::new() + .push( + Row::new() + .push(text("Outpoint:").small().bold()) + .push(text(format!("{}", coin.outpoint)).small()) + .spacing(5), + ) + .push_maybe(coin.block_height.map(|b| { + Row::new() + .push(text("Block height:").small().bold()) + .push(text(format!("{}", b)).small()) + .spacing(5) + })), + ) + .push_maybe(coin.spend_info.map(|info| { + Column::new() + .push( + Row::new() + .push(text("Spend txid:").small().bold()) + .push(text(format!("{}", info.txid)).small()) + .spacing(5), + ) + .push(if let Some(height) = info.height { + Row::new() + .push(text("Spend block height:").small().bold()) + .push(text(format!("{}", height)).small()) + .spacing(5) + } else { + Row::new().push(text("Not in a block").bold().small()) + }) .spacing(5) })), - ) - .push_maybe(coin.spend_info.map(|info| { - column() - .push( - row() - .push(text("Spend txid:").small().bold()) - .push(text(&format!("{}", info.txid)).small()) - .spacing(5), - ) - .push(if let Some(height) = info.height { - row() - .push(text("Spend block height:").small().bold()) - .push(text(&format!("{}", height)).small()) - .spacing(5) - } else { - row().push(text("Not in a block").bold().small()) - }) - .spacing(5) - })), + ), ) - .into() - }, - )) + } else { + None + }), + ) .style(card::SimpleCardStyle) - .into() } diff --git a/gui/src/app/view/home.rs b/gui/src/app/view/home.rs index eb80533c..5869eb93 100644 --- a/gui/src/app/view/home.rs +++ b/gui/src/app/view/home.rs @@ -2,8 +2,8 @@ use chrono::NaiveDateTime; use iced::{ alignment, - pure::{button, column, container, row, Element}, - Alignment, Length, + widget::{Button, Column, Container, Row}, + Alignment, Element, Length, }; use crate::ui::{ @@ -21,17 +21,17 @@ pub fn home_view<'a>( pending_events: &[HistoryTransaction], events: &Vec, ) -> Element<'a, Message> { - column() - .push(column().padding(40)) - .push(text(&format!("{} BTC", balance.to_btc())).bold().size(50)) + Column::new() + .push(Column::new().padding(40)) + .push(text(format!("{} BTC", balance.to_btc())).bold().size(50)) .push( - column() + Column::new() .spacing(10) .push( pending_events .iter() .enumerate() - .fold(column().spacing(10), |col, (i, event)| { + .fold(Column::new().spacing(10), |col, (i, event)| { col.push(event_list_view(i, event)) }), ) @@ -39,22 +39,22 @@ pub fn home_view<'a>( events .iter() .enumerate() - .fold(column().spacing(10), |col, (i, event)| { + .fold(Column::new().spacing(10), |col, (i, event)| { col.push(event_list_view(i, event)) }), ) .push_maybe( if events.len() % HISTORY_EVENT_PAGE_SIZE as usize == 0 && !events.is_empty() { Some( - container( - button( + Container::new( + Button::new( text("See more") .width(Length::Fill) .horizontal_alignment(alignment::Horizontal::Center), ) .width(Length::Fill) .padding(15) - .style(Style::TransparentBorder) + .style(Style::TransparentBorder.into()) .on_press(Message::Next), ) .width(Length::Fill) @@ -71,23 +71,23 @@ pub fn home_view<'a>( } fn event_list_view<'a>(i: usize, event: &HistoryTransaction) -> Element<'a, Message> { - container( - button( - row() + Container::new( + Button::new( + Row::new() .push( - row() + Row::new() .push(if event.is_external() { badge::receive() } else { badge::spend() }) .push(if let Some(t) = event.time { - container( - text(&format!("{}", NaiveDateTime::from_timestamp(t as i64, 0))) + Container::new( + text(format!("{}", NaiveDateTime::from_timestamp(t as i64, 0))) .small(), ) } else { - container(text(" Pending ").small()) + Container::new(text(" Pending ").small()) .padding(3) .style(badge::PillStyle::Success) }) @@ -96,9 +96,9 @@ fn event_list_view<'a>(i: usize, event: &HistoryTransaction) -> Element<'a, Mess .width(Length::Fill), ) .push( - row() + Row::new() .push( - text(&{ + text({ if event.is_external() { format!("+ {:.8}", event.incoming_amount.to_btc()) } else { @@ -117,16 +117,16 @@ fn event_list_view<'a>(i: usize, event: &HistoryTransaction) -> Element<'a, Mess ) .padding(10) .on_press(Message::Select(i)) - .style(Style::TransparentBorder), + .style(Style::TransparentBorder.into()), ) .style(card::SimpleCardStyle) .into() } pub fn event_view<'a>(event: &HistoryTransaction) -> Element<'a, Message> { - column() + Column::new() .push( - row() + Row::new() .push(if event.is_external() { badge::receive() } else { @@ -136,7 +136,7 @@ pub fn event_view<'a>(event: &HistoryTransaction) -> Element<'a, Message> { .align_items(Alignment::Center), ) .push( - text(&{ + text({ if event.is_external() { format!("+ {} BTC", event.incoming_amount.to_btc()) } else { @@ -150,23 +150,24 @@ pub fn event_view<'a>(event: &HistoryTransaction) -> Element<'a, Message> { .push_maybe( event .fee_amount - .map(|fee| container(text(&format!("Miner Fee: {} BTC", fee.to_btc())))), + .map(|fee| Container::new(text(format!("Miner Fee: {} BTC", fee.to_btc())))), ) .push(card::simple( - column() + Column::new() .push_maybe(event.time.map(|t| { let date = NaiveDateTime::from_timestamp(t as i64, 0); - row() + Row::new() .width(Length::Fill) - .push(container(text("Date:").bold()).width(Length::Fill)) - .push(container(text(&format!("{}", date))).width(Length::Shrink)) + .push(Container::new(text("Date:").bold()).width(Length::Fill)) + .push(Container::new(text(format!("{}", date))).width(Length::Shrink)) })) .push( - row() + Row::new() .width(Length::Fill) - .push(container(text("Txid:").bold()).width(Length::Fill)) + .push(Container::new(text("Txid:").bold()).width(Length::Fill)) .push( - container(text(&format!("{}", event.tx.txid()))).width(Length::Shrink), + Container::new(text(format!("{}", event.tx.txid()))) + .width(Length::Shrink), ), ) .spacing(5), diff --git a/gui/src/app/view/mod.rs b/gui/src/app/view/mod.rs index a9f92870..1b90c8e8 100644 --- a/gui/src/app/view/mod.rs +++ b/gui/src/app/view/mod.rs @@ -11,13 +11,12 @@ pub use message::*; use warning::warn; use iced::{ - pure::{column, container, row, scrollable, widget, Element}, - Length, + widget::{self, scrollable, Button, Column, Container, Row}, + Element, Length, }; use crate::ui::{ - color, - component::{badge, button, separation, text::*}, + component::{badge, button, container, separation, text::*}, icon::{coin_icon, cross_icon, home_icon, receive_icon, send_icon, settings_icon}, util::Collection, }; @@ -36,11 +35,11 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa }; let coins_button = if *menu == Menu::Coins { - iced::pure::widget::button::Button::new( - container( - row() + Button::new( + Container::new( + Row::new() .push( - row() + Row::new() .push(coin_icon()) .push(text("Coins")) .spacing(10) @@ -48,8 +47,8 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .align_items(iced::Alignment::Center), ) .push( - container( - text(&format!( + Container::new( + text(format!( " {} ", cache .coins @@ -71,15 +70,15 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .padding(5) .center_x(), ) - .style(button::Style::Primary) + .style(button::Style::Primary.into()) .on_press(Message::Reload) .width(iced::Length::Units(200)) } else { - iced::pure::widget::button::Button::new( - container( - row() + Button::new( + Container::new( + Row::new() .push( - row() + Row::new() .push(coin_icon()) .push(text("Coins")) .spacing(10) @@ -87,8 +86,8 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .align_items(iced::Alignment::Center), ) .push( - container( - text(&format!( + Container::new( + text(format!( " {} ", cache .coins @@ -110,17 +109,17 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .padding(5) .center_x(), ) - .style(button::Style::Transparent) + .style(button::Style::Transparent.into()) .on_press(Message::Menu(Menu::Coins)) .width(iced::Length::Units(200)) }; let spend_button = if *menu == Menu::Spend { - iced::pure::widget::button::Button::new( - container( - row() + Button::new( + Container::new( + Row::new() .push( - row() + Row::new() .push(send_icon()) .push(text("Send")) .spacing(10) @@ -131,8 +130,8 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa None } else { Some( - container( - text(&format!(" {} ", cache.spend_txs.len())) + Container::new( + text(format!(" {} ", cache.spend_txs.len())) .small() .bold(), ) @@ -147,15 +146,15 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .padding(5) .center_x(), ) - .style(button::Style::Primary) + .style(button::Style::Primary.into()) .on_press(Message::Reload) .width(iced::Length::Units(200)) } else { - iced::pure::widget::button::Button::new( - container( - row() + Button::new( + Container::new( + Row::new() .push( - row() + Row::new() .push(send_icon()) .push(text("Send")) .spacing(10) @@ -166,8 +165,8 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa None } else { Some( - container( - text(&format!(" {} ", cache.spend_txs.len())) + Container::new( + text(format!(" {} ", cache.spend_txs.len())) .small() .bold(), ) @@ -182,7 +181,7 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .padding(5) .center_x(), ) - .style(button::Style::Transparent) + .style(button::Style::Transparent.into()) .on_press(Message::Menu(Menu::Spend)) .width(iced::Length::Units(200)) }; @@ -207,14 +206,14 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .width(iced::Length::Units(200)) }; - container( - column() + Container::new( + Column::new() .padding(10) .push( - column() + Column::new() .push( - column() - .push(container(text("Liana").bold()).padding(10)) + Column::new() + .push(Container::new(text("Liana").bold()).padding(10)) .push(separation().width(Length::Units(200))) .spacing(10), ) @@ -226,11 +225,11 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .height(Length::Fill), ) .push( - container( - column() + Container::new( + Column::new() .spacing(10) .push_maybe(cache.rescan_progress.map(|p| { - container(text(&format!(" Rescan...{:.2}% ", p * 100.0))) + Container::new(text(format!(" Rescan...{:.2}% ", p * 100.0))) .padding(5) .style(badge::PillStyle::Simple) })) @@ -239,19 +238,7 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> widget::Container<'a, Messa .height(Length::Shrink), ), ) - .style(SidebarStyle) -} - -pub struct SidebarStyle; -impl widget::container::StyleSheet for SidebarStyle { - fn style(&self) -> widget::container::Style { - widget::container::Style { - background: color::FOREGROUND.into(), - border_width: 1.0, - border_color: color::SECONDARY, - ..widget::container::Style::default() - } - } + .style(container::Style::Sidebar) } pub fn dashboard<'a, T: Into>>( @@ -260,17 +247,17 @@ pub fn dashboard<'a, T: Into>>( warning: Option<&Error>, content: T, ) -> Element<'a, Message> { - row() + Row::new() .push( sidebar(menu, cache) .width(Length::Shrink) .height(Length::Fill), ) .push( - column() + Column::new() .push(warn(warning)) - .push(main_section(container(scrollable( - container(content).padding(20), + .push(main_section(Container::new(scrollable( + Container::new(content).padding(20), )))), ) .width(iced::Length::Fill) @@ -279,69 +266,49 @@ pub fn dashboard<'a, T: Into>>( } fn main_section<'a, T: 'a>(menu: widget::Container<'a, T>) -> widget::Container<'a, T> { - container(menu.max_width(1500)) - .style(MainSectionStyle) + Container::new(menu.max_width(1500)) + .style(container::Style::Background) .center_x() .width(Length::Fill) .height(Length::Fill) } -pub struct MainSectionStyle; -impl widget::container::StyleSheet for MainSectionStyle { - fn style(&self) -> widget::container::Style { - widget::container::Style { - background: color::BACKGROUND.into(), - ..widget::container::Style::default() - } - } -} - pub fn modal<'a, T: Into>>( is_previous: bool, warning: Option<&Error>, content: T, ) -> Element<'a, Message> { - column() + Column::new() .push(warn(warning)) .push( - container( - row() + Container::new( + Row::new() .push(if is_previous { - column() + Column::new() .push( button::transparent(None, "< Previous").on_press(Message::Previous), ) .width(Length::Fill) } else { - column().width(Length::Fill) + Column::new().width(Length::Fill) }) .align_items(iced::Alignment::Center) .push(button::primary(Some(cross_icon()), "Close").on_press(Message::Close)), ) .padding(10) - .style(ModalSectionStyle), + .style(container::Style::Background), ) - .push(modal_section(container(scrollable(content)))) + .push(modal_section(Container::new(scrollable(content)))) .width(Length::Fill) .height(Length::Fill) .into() } fn modal_section<'a, T: 'a>(menu: widget::Container<'a, T>) -> widget::Container<'a, T> { - container(menu.max_width(1500)) + Container::new(menu.max_width(1500)) .padding(20) - .style(ModalSectionStyle) + .style(container::Style::Background) .center_x() .width(Length::Fill) .height(Length::Fill) } - -pub struct ModalSectionStyle; -impl widget::container::StyleSheet for ModalSectionStyle { - fn style(&self) -> widget::container::Style { - widget::container::Style { - background: color::BACKGROUND.into(), - ..widget::container::Style::default() - } - } -} diff --git a/gui/src/app/view/receive.rs b/gui/src/app/view/receive.rs index 6f3dc01a..7e6a9706 100644 --- a/gui/src/app/view/receive.rs +++ b/gui/src/app/view/receive.rs @@ -1,7 +1,9 @@ use iced::{ - pure::{column, row, widget::Button, Element}, - widget::qr_code::{self, QRCode}, - Alignment, + widget::{ + qr_code::{self, QRCode}, + Button, Column, Row, + }, + Alignment, Element, }; use liana::miniscript::bitcoin; @@ -15,15 +17,15 @@ use super::message::Message; pub fn receive<'a>(address: &'a bitcoin::Address, qr: &'a qr_code::State) -> Element<'a, Message> { card::simple( - column() + Column::new() .push(QRCode::new(qr).cell_size(10)) .push( - row() - .push(text(&address.to_string()).small()) + Row::new() + .push(text(address.to_string()).small()) .push( Button::new(icon::clipboard_icon()) .on_press(Message::Clipboard(address.to_string())) - .style(button::Style::TransparentBorder), + .style(button::Style::TransparentBorder.into()), ) .align_items(Alignment::Center), ) diff --git a/gui/src/app/view/settings.rs b/gui/src/app/view/settings.rs index 428f7273..abde7e65 100644 --- a/gui/src/app/view/settings.rs +++ b/gui/src/app/view/settings.rs @@ -2,8 +2,8 @@ use std::str::FromStr; use iced::{ alignment, - pure::{column, container, progress_bar, row, widget, Element}, - Alignment, Length, + widget::{self, Column, Container, ProgressBar, Row}, + Alignment, Element, Length, }; use liana::miniscript::bitcoin; @@ -43,29 +43,29 @@ pub fn bitcoind_edit<'a>( cookie_path: &form::Value, processing: bool, ) -> Element<'a, SettingsMessage> { - let mut col = column().spacing(20); + let mut col = Column::new().spacing(20); if blockheight != 0 { col = col .push( - row() + Row::new() .push( - row() + Row::new() .push(badge::Badge::new(icon::network_icon())) .push( - column() + Column::new() .push(text("Network:")) - .push(text(&network.to_string()).bold()), + .push(text(network.to_string()).bold()), ) .spacing(10) .width(Length::FillPortion(1)), ) .push( - row() + Row::new() .push(badge::Badge::new(icon::block_icon())) .push( - column() + Column::new() .push(text("Block Height:")) - .push(text(&blockheight.to_string()).bold()), + .push(text(blockheight.to_string()).bold()), ) .spacing(10) .width(Length::FillPortion(1)), @@ -76,7 +76,7 @@ pub fn bitcoind_edit<'a>( col = col .push( - column() + Column::new() .push(text("Cookie file path:").bold().small()) .push( form::Form::new("Cookie file path", cookie_path, |value| { @@ -89,7 +89,7 @@ pub fn bitcoind_edit<'a>( .spacing(5), ) .push( - column() + Column::new() .push(text("Socket address:").bold().small()) .push( form::Form::new("Socket address:", addr, |value| { @@ -109,10 +109,10 @@ pub fn bitcoind_edit<'a>( confirm_button = confirm_button.on_press(SettingsMessage::ConfirmEdit); } - card::simple(container( - column() + card::simple(Container::new( + Column::new() .push( - row() + Row::new() .push(badge::Badge::new(icon::bitcoin_icon())) .push(text("Bitcoind")) .padding(10) @@ -123,8 +123,8 @@ pub fn bitcoind_edit<'a>( .push(separation().width(Length::Fill)) .push(col) .push( - container( - row() + Container::new( + Row::new() .push(cancel_button) .push(confirm_button) .spacing(10) @@ -146,29 +146,29 @@ pub fn bitcoind<'a>( is_running: Option, can_edit: bool, ) -> Element<'a, SettingsMessage> { - let mut col = column().spacing(20); + let mut col = Column::new().spacing(20); if blockheight != 0 { col = col .push( - row() + Row::new() .push( - row() + Row::new() .push(badge::Badge::new(icon::network_icon())) .push( - column() + Column::new() .push(text("Network:")) - .push(text(&network.to_string()).bold()), + .push(text(network.to_string()).bold()), ) .spacing(10) .width(Length::FillPortion(1)), ) .push( - row() + Row::new() .push(badge::Badge::new(icon::block_icon())) .push( - column() + Column::new() .push(text("Block Height:")) - .push(text(&blockheight.to_string()).bold()), + .push(text(blockheight.to_string()).bold()), ) .spacing(10) .width(Length::FillPortion(1)), @@ -185,21 +185,21 @@ pub fn bitcoind<'a>( ("Socket address:", config.addr.to_string()), ]; - let mut col_fields = column(); + let mut col_fields = Column::new(); for (k, v) in rows { col_fields = col_fields.push( - row() - .push(container(text(k).bold().small()).width(Length::Fill)) - .push(text(&v).small()), + Row::new() + .push(Container::new(text(k).bold().small()).width(Length::Fill)) + .push(text(v).small()), ); } - card::simple(container( - column() + card::simple(Container::new( + Column::new() .push( - row() + Row::new() .push( - row() + Row::new() .push(badge::Badge::new(icon::bitcoin_icon())) .push(text("Bitcoind")) .push(is_running_label(is_running)) @@ -209,11 +209,11 @@ pub fn bitcoind<'a>( ) .push(if can_edit { widget::Button::new(icon::pencil_icon()) - .style(button::Style::TransparentBorder) + .style(button::Style::TransparentBorder.into()) .on_press(SettingsMessage::Edit) } else { widget::Button::new(icon::pencil_icon()) - .style(button::Style::TransparentBorder) + .style(button::Style::TransparentBorder.into()) }) .align_items(Alignment::Center), ) @@ -228,22 +228,22 @@ pub fn bitcoind<'a>( pub fn is_running_label<'a, T: 'a>(is_running: Option) -> widget::Container<'a, T> { if let Some(running) = is_running { if running { - container( - row() - .push(icon::dot_icon().size(5).color(color::SUCCESS)) - .push(text("Running").small().color(color::SUCCESS)) + Container::new( + Row::new() + .push(icon::dot_icon().size(5).style(color::SUCCESS)) + .push(text("Running").small().style(color::SUCCESS)) .align_items(Alignment::Center), ) } else { - container( - row() - .push(icon::dot_icon().size(5).color(color::ALERT)) - .push(text("Not running").small().color(color::ALERT)) + Container::new( + Row::new() + .push(icon::dot_icon().size(5).style(color::ALERT)) + .push(text("Not running").small().style(color::ALERT)) .align_items(Alignment::Center), ) } } else { - container(column()) + Container::new(Column::new()) } } @@ -256,14 +256,14 @@ pub fn rescan<'a>( processing: bool, can_edit: bool, ) -> Element<'a, SettingsMessage> { - card::simple(container( - column() + card::simple(Container::new( + Column::new() .push( - row() + Row::new() .push(badge::Badge::new(icon::block_icon())) .push(text("Rescan blockchain").width(Length::Fill)) .push_maybe(if success { - Some(text("Rescan was successful").color(color::SUCCESS)) + Some(text("Rescan was successful").style(color::SUCCESS)) } else { None }) @@ -273,18 +273,18 @@ pub fn rescan<'a>( ) .push(separation().width(Length::Fill)) .push(if let Some(p) = scan_progress { - container( - column() + Container::new( + Column::new() .width(Length::Fill) - .push(progress_bar(0.0..=1.0, p as f32).width(Length::Fill)) - .push(text(&format!("Rescan...{:.2}%", p * 100.0))), + .push(ProgressBar::new(0.0..=1.0, p as f32).width(Length::Fill)) + .push(text(format!("Rescan...{:.2}%", p * 100.0))), ) } else { - container( - column() + Container::new( + Column::new() .spacing(10) .push( - row() + Row::new() .push(text("Year:").bold().small()) .push( form::Form::new("2022", year, |value| { @@ -321,18 +321,18 @@ pub fn rescan<'a>( }) && is_ok_and(&u32::from_str(&day.value), |&v| v > 0 && v <= 31)) { - row().push(column().width(Length::Fill)).push( + Row::new().push(Column::new().width(Length::Fill)).push( button::primary(None, "Start rescan") .on_press(SettingsMessage::ConfirmEdit) .width(Length::Shrink), ) } else if processing { - row().push(column().width(Length::Fill)).push( + Row::new().push(Column::new().width(Length::Fill)).push( button::primary(None, "Starting rescan...") .width(Length::Shrink), ) } else { - row().push(column().width(Length::Fill)).push( + Row::new().push(Column::new().width(Length::Fill)).push( button::primary(None, "Start rescan").width(Length::Shrink), ) }, diff --git a/gui/src/app/view/spend/detail.rs b/gui/src/app/view/spend/detail.rs index 685b7cfa..dd3717f8 100644 --- a/gui/src/app/view/spend/detail.rs +++ b/gui/src/app/view/spend/detail.rs @@ -1,6 +1,6 @@ use iced::{ - pure::{column, container, row, scrollable, Element}, - Alignment, Length, + widget::{Button, Column, Container, Row, Scrollable}, + Alignment, Element, Length, }; use liana::miniscript::bitcoin::{ @@ -11,14 +11,14 @@ use liana::miniscript::bitcoin::{ use crate::{ app::{ error::Error, - view::{message::*, modal_section, warning::warn, ModalSectionStyle}, + view::{message::*, modal_section, warning::warn}, }, daemon::model::{Coin, SpendStatus, SpendTx}, hw::HardwareWallet, ui::{ color, component::{ - badge, button, card, separation, + badge, button, card, container, separation, text::{text, Text}, }, icon, @@ -36,7 +36,7 @@ pub fn spend_view<'a, T: Into>>( spend_modal( show_delete, warning, - column() + Column::new() .align_items(Alignment::Center) .spacing(20) .push(spend_header(tx)) @@ -59,10 +59,10 @@ pub fn save_action<'a>(saved: bool) -> Element<'a, Message> { .into() } else { card::simple( - column() + Column::new() .spacing(10) .push(text("Save the transaction")) - .push(row().push(column().width(Length::Fill)).push( + .push(Row::new().push(Column::new().width(Length::Fill)).push( button::primary(None, "Save").on_press(Message::Spend(SpendTxMessage::Confirm)), )), ) @@ -79,11 +79,11 @@ pub fn broadcast_action<'a>(saved: bool) -> Element<'a, Message> { .into() } else { card::simple( - column() + Column::new() .spacing(10) .push(text("Broadcast the transaction")) .push( - row().push(column().width(Length::Fill)).push( + Row::new().push(Column::new().width(Length::Fill)).push( button::primary(None, "Broadcast") .on_press(Message::Spend(SpendTxMessage::Confirm)), ), @@ -102,12 +102,12 @@ pub fn delete_action<'a>(deleted: bool) -> Element<'a, Message> { .into() } else { card::simple( - column() + Column::new() .spacing(10) .push(text("Delete the transaction draft")) .push( - row() - .push(column().width(Length::Fill)) + Row::new() + .push(Column::new().width(Length::Fill)) .push( button::transparent(None, "Cancel") .on_press(Message::Spend(SpendTxMessage::Cancel)), @@ -128,20 +128,20 @@ pub fn spend_modal<'a, T: Into>>( warning: Option<&Error>, content: T, ) -> Element<'a, Message> { - column() + Column::new() .push(warn(warning)) .push( - container( - row() + Container::new( + Row::new() .push(if show_delete { - column() + Column::new() .push( button::alert(Some(icon::trash_icon()), "Delete") .on_press(Message::Spend(SpendTxMessage::Delete)), ) .width(Length::Fill) } else { - column() + Column::new() .push( button::transparent(None, "< Previous").on_press(Message::Previous), ) @@ -153,20 +153,20 @@ pub fn spend_modal<'a, T: Into>>( ), ) .padding(10) - .style(ModalSectionStyle), + .style(container::Style::Background), ) - .push(modal_section(container(scrollable(content)))) + .push(modal_section(Container::new(Scrollable::new(content)))) .width(Length::Fill) .height(Length::Fill) .into() } fn spend_header<'a>(tx: &SpendTx) -> Element<'a, Message> { - column() + Column::new() .spacing(20) .align_items(Alignment::Center) .push( - row() + Row::new() .push(badge::Badge::new(icon::send_icon()).style(badge::Style::Standard)) .push(text("Spend").bold()) .spacing(5) @@ -174,26 +174,26 @@ fn spend_header<'a>(tx: &SpendTx) -> Element<'a, Message> { ) .push_maybe(match tx.status { SpendStatus::Deprecated => Some( - container(text(" Deprecated ").small()) + Container::new(text(" Deprecated ").small()) .padding(3) .style(badge::PillStyle::Simple), ), SpendStatus::Broadcasted => Some( - container(text(" Broadcasted ").small()) + Container::new(text(" Broadcasted ").small()) .padding(3) .style(badge::PillStyle::Success), ), _ => None, }) .push( - column() + Column::new() .align_items(Alignment::Center) .push( - text(&format!("- {} BTC", tx.spend_amount.to_btc())) + text(format!("- {} BTC", tx.spend_amount.to_btc())) .bold() .size(50), ) - .push(container(text(&format!( + .push(Container::new(text(format!( "Miner Fee: {} BTC", tx.fee_amount.to_btc() )))), @@ -203,16 +203,23 @@ fn spend_header<'a>(tx: &SpendTx) -> Element<'a, Message> { fn spend_overview_view<'a>(tx: &SpendTx) -> Element<'a, Message> { card::simple( - column() - .push(container( - row() + Column::new() + .push(Container::new( + Row::new() .push( - container( - row() - .push(container(icon::key_icon().size(30).width(Length::Fill))) - .push(column().push(text("Number of signatures:").bold()).push( - text(&format!("{}", tx.psbt.inputs[0].partial_sigs.len(),)), + Container::new( + Row::new() + .push(Container::new( + icon::key_icon().size(30).width(Length::Fill), )) + .push( + Column::new() + .push(text("Number of signatures:").bold()) + .push(text(format!( + "{}", + tx.psbt.inputs[0].partial_sigs.len(), + ))), + ) .align_items(Alignment::Center) .spacing(20), ) @@ -223,15 +230,15 @@ fn spend_overview_view<'a>(tx: &SpendTx) -> Element<'a, Message> { )) .push(separation().width(Length::Fill)) .push( - column() + Column::new() .push( - row() + Row::new() .push(text("Tx ID:").bold().width(Length::Fill)) - .push(text(&format!("{}", tx.psbt.unsigned_tx.txid())).small()) + .push(text(format!("{}", tx.psbt.unsigned_tx.txid())).small()) .align_items(Alignment::Center), ) .push( - row() + Row::new() .push(text("Psbt:").bold().width(Length::Fill)) .push( button::transparent(Some(icon::clipboard_icon()), "Copy") @@ -251,21 +258,21 @@ fn inputs_and_outputs_view<'a>( network: Network, change_index: Option, ) -> Element<'a, Message> { - column() + Column::new() .push( - row() + Row::new() .spacing(10) .push( - column() + Column::new() .spacing(10) .push(text("Spent coins:").bold()) - .push(coins.iter().fold(column().spacing(10), |col, coin| { + .push(coins.iter().fold(Column::new().spacing(10), |col, coin| { col.push( card::simple( - column() + Column::new() .width(Length::Fill) - .push(text(&format!("{} BTC", coin.amount.to_btc())).bold()) - .push(text(&format!("{}", coin.outpoint)).small()), + .push(text(format!("{} BTC", coin.amount.to_btc())).bold()) + .push(text(format!("{}", coin.outpoint)).small()), ) .width(Length::Fill), ) @@ -273,28 +280,28 @@ fn inputs_and_outputs_view<'a>( .width(Length::FillPortion(1)), ) .push( - column() + Column::new() .spacing(10) .push(text("Recipients:").bold()) .push(psbt.unsigned_tx.output.iter().enumerate().fold( - column().spacing(10), + Column::new().spacing(10), |col, (i, output)| { col.push( card::simple( - column() + Column::new() .spacing(10) .push( - column() + Column::new() .width(Length::Fill) .push( - text(&format!( + text(format!( "{} BTC", Amount::from_sat(output.value).to_btc() )) .bold(), ) .push( - text(&format!( + text(format!( "{}", Address::from_script( &output.script_pubkey, @@ -307,7 +314,7 @@ fn inputs_and_outputs_view<'a>( ) .push_maybe(if Some(i) == change_index { Some( - container(text("Change")) + Container::new(text("Change")) .padding(5) .style(badge::PillStyle::Success), ) @@ -332,15 +339,15 @@ pub fn sign_action<'a>( signed: &[Fingerprint], ) -> Element<'a, Message> { card::simple( - column() + Column::new() .push(if !hws.is_empty() { - column() + Column::new() .push(text("Select hardware wallet to sign with:").bold()) .spacing(10) .push( hws.iter() .enumerate() - .fold(column().spacing(10), |col, (i, hw)| { + .fold(Column::new().spacing(10), |col, (i, hw)| { col.push(hw_list_view( i, hw, @@ -352,10 +359,10 @@ pub fn sign_action<'a>( ) .width(Length::Fill) } else { - column() + Column::new() .push( card::simple( - column() + Column::new() .spacing(20) .width(Length::Fill) .push("Please connect a hardware wallet") @@ -380,18 +387,18 @@ fn hw_list_view<'a>( processing: bool, signed: bool, ) -> Element<'a, Message> { - let mut bttn = iced::pure::button( - row() + let mut bttn = Button::new( + Row::new() .push( - column() - .push(text(&format!("{}", hw.kind)).bold()) - .push(text(&format!("fingerprint: {}", hw.fingerprint)).small()) + Column::new() + .push(text(format!("{}", hw.kind)).bold()) + .push(text(format!("fingerprint: {}", hw.fingerprint)).small()) .spacing(5) .width(Length::Fill), ) .push_maybe(if chosen && processing { Some( - column() + Column::new() .push(text("Processing...")) .push(text("Please check your device").small()), ) @@ -400,11 +407,11 @@ fn hw_list_view<'a>( }) .push_maybe(if signed { Some( - column().push( - row() + Column::new().push( + Row::new() .spacing(5) - .push(icon::circle_check_icon().color(color::SUCCESS)) - .push(text("Signed").color(color::SUCCESS)), + .push(icon::circle_check_icon().style(color::SUCCESS)) + .push(text("Signed").style(color::SUCCESS)), ), ) } else { @@ -414,12 +421,12 @@ fn hw_list_view<'a>( .width(Length::Fill), ) .padding(10) - .style(button::Style::Border) + .style(button::Style::Border.into()) .width(Length::Fill); if !processing { bttn = bttn.on_press(Message::Spend(SpendTxMessage::SelectHardwareWallet(i))); } - container(bttn) + Container::new(bttn) .width(Length::Fill) .style(card::SimpleCardStyle) .into() diff --git a/gui/src/app/view/spend/mod.rs b/gui/src/app/view/spend/mod.rs index 4ddef3ac..a7fe868b 100644 --- a/gui/src/app/view/spend/mod.rs +++ b/gui/src/app/view/spend/mod.rs @@ -2,8 +2,8 @@ pub mod detail; pub mod step; use iced::{ - pure::{button, column, container, row, Element}, - Alignment, Length, + widget::{Button, Column, Container, Row}, + Alignment, Element, Length, }; use crate::{ @@ -19,27 +19,27 @@ use crate::{ use super::message::Message; pub fn spend_view<'a>(spend_txs: &[SpendTx]) -> Element<'a, Message> { - column() + Column::new() .push( - row().push(column().width(Length::Fill)).push( + Row::new().push(Column::new().width(Length::Fill)).push( button::primary(Some(icon::plus_icon()), "Create a new transaction") .on_press(Message::Menu(Menu::CreateSpendTx)), ), ) .push( - container( - row() - .push(text(&format!(" {}", spend_txs.len())).bold()) + Container::new( + Row::new() + .push(text(format!(" {}", spend_txs.len())).bold()) .push(text(" draft transactions")), ) .width(Length::Fill), ) .push( - column().spacing(10).push( + Column::new().spacing(10).push( spend_txs .iter() .enumerate() - .fold(column().spacing(10), |col, (i, tx)| { + .fold(Column::new().spacing(10), |col, (i, tx)| { col.push(spend_tx_list_view(i, tx)) }), ), @@ -50,20 +50,20 @@ pub fn spend_view<'a>(spend_txs: &[SpendTx]) -> Element<'a, Message> { } fn spend_tx_list_view<'a>(i: usize, tx: &SpendTx) -> Element<'a, Message> { - container( - button( - row() + Container::new( + Button::new( + Row::new() .push( - row() + Row::new() .push(badge::spend()) .push_maybe(match tx.status { SpendStatus::Deprecated => Some( - container(text(" Deprecated ").small()) + Container::new(text(" Deprecated ").small()) .padding(3) .style(badge::PillStyle::Simple), ), SpendStatus::Broadcasted => Some( - container(text(" Broadcasted ").small()) + Container::new(text(" Broadcasted ").small()) .padding(3) .style(badge::PillStyle::Success), ), @@ -74,9 +74,9 @@ fn spend_tx_list_view<'a>(i: usize, tx: &SpendTx) -> Element<'a, Message> { .width(Length::Fill), ) .push( - column() - .push(text(&format!("{} BTC", tx.spend_amount.to_btc())).bold()) - .push(text(&format!("fee: {}", tx.fee_amount.to_btc())).small()) + Column::new() + .push(text(format!("{} BTC", tx.spend_amount.to_btc())).bold()) + .push(text(format!("fee: {}", tx.fee_amount.to_btc())).small()) .width(Length::Shrink), ) .align_items(Alignment::Center) @@ -84,7 +84,7 @@ fn spend_tx_list_view<'a>(i: usize, tx: &SpendTx) -> Element<'a, Message> { ) .padding(10) .on_press(Message::Select(i)) - .style(button::Style::TransparentBorder), + .style(button::Style::TransparentBorder.into()), ) .style(card::SimpleCardStyle) .into() diff --git a/gui/src/app/view/spend/step.rs b/gui/src/app/view/spend/step.rs index 34c40375..57238dc9 100644 --- a/gui/src/app/view/spend/step.rs +++ b/gui/src/app/view/spend/step.rs @@ -1,6 +1,6 @@ use iced::{ - pure::{column, container, row, widget, Element}, - Alignment, Length, + widget::{self, Button, Column, Container, Row}, + Alignment, Element, Length, }; use liana::miniscript::bitcoin::Amount; @@ -28,10 +28,10 @@ pub fn choose_recipients_view( modal( false, None, - column() + Column::new() .push(text("Choose recipients").bold().size(50)) .push( - column() + Column::new() .push(widget::Column::with_children(recipients).spacing(10)) .push( button::transparent(Some(icon::plus_icon()), "Add recipient") @@ -59,7 +59,7 @@ pub fn recipient_view<'a>( address: &form::Value, amount: &form::Value, ) -> Element<'a, CreateSpendMessage> { - row() + Row::new() .push( form::Form::new("Address", address, move |msg| { CreateSpendMessage::RecipientEdited(index, "address", msg) @@ -69,7 +69,7 @@ pub fn recipient_view<'a>( .padding(10), ) .push( - container( + Container::new( form::Form::new("Amount", amount, move |msg| { CreateSpendMessage::RecipientEdited(index, "amount", msg) }) @@ -97,10 +97,10 @@ pub fn choose_feerate_view<'a>( modal( true, None, - column() + Column::new() .push(text("Choose feerate").bold().size(50)) .push( - container( + Container::new( form::Form::new("Feerate", feerate, move |msg| { Message::CreateSpend(CreateSpendMessage::FeerateEdited(msg)) }) @@ -110,7 +110,7 @@ pub fn choose_feerate_view<'a>( ) .width(Length::Units(250)), ) - .push_maybe(error.map(|e| card::error("Failed to create spend", &e.to_string()))) + .push_maybe(error.map(|e| card::error("Failed to create spend", e.to_string()))) .push_maybe(if is_valid { Some( button::primary(None, "Next") @@ -133,26 +133,26 @@ pub fn choose_coins_view<'a>( modal( true, None, - column() + Column::new() .push(text("Choose coins").bold().size(50)) .push( - column().spacing(10).push( + Column::new().spacing(10).push( coins .iter() .enumerate() - .fold(column().spacing(10), |col, (i, (coin, selected))| { + .fold(Column::new().spacing(10), |col, (i, (coin, selected))| { col.push(coin_list_view(i, coin, *selected)) }), ), ) .push_maybe(if is_valid { - Some(container( + Some(Container::new( button::primary(None, "Next") .on_press(Message::Next) .width(Length::Units(100)), )) } else if total_needed.is_some() { - Some(container(card::warning(&format!( + Some(Container::new(card::warning(format!( "Total amount must be superior to {}", total_needed.unwrap().to_btc(), )))) @@ -165,24 +165,24 @@ pub fn choose_coins_view<'a>( } fn coin_list_view<'a>(i: usize, coin: &Coin, selected: bool) -> Element<'a, Message> { - container( - iced::pure::button( - row() + Container::new( + Button::new( + Row::new() .push( - row() + Row::new() .push(if selected { icon::square_check_icon() } else { icon::square_icon() }) .push(badge::coin()) - .push(text(&format!("block: {}", coin.block_height.unwrap_or(0))).small()) + .push(text(format!("block: {}", coin.block_height.unwrap_or(0))).small()) .spacing(10) .align_items(Alignment::Center) .width(Length::Fill), ) .push( - text(&format!("{} BTC", coin.amount.to_btc())) + text(format!("{} BTC", coin.amount.to_btc())) .bold() .width(Length::Shrink), ) @@ -191,7 +191,7 @@ fn coin_list_view<'a>(i: usize, coin: &Coin, selected: bool) -> Element<'a, Mess ) .padding(10) .on_press(Message::CreateSpend(CreateSpendMessage::SelectCoin(i))) - .style(button::Style::TransparentBorder), + .style(button::Style::TransparentBorder.into()), ) .style(card::SimpleCardStyle) .into() diff --git a/gui/src/app/view/warning.rs b/gui/src/app/view/warning.rs index 084c4de0..74120573 100644 --- a/gui/src/app/view/warning.rs +++ b/gui/src/app/view/warning.rs @@ -1,14 +1,14 @@ use std::convert::From; use iced::{ - pure::{column, container, row, widget}, + widget::{self, Column, Container}, Length, }; use crate::{ app::error::Error, daemon::{client::error::RpcErrorCode, DaemonError}, - ui::{color, component::text::*, icon}, + ui::component::notification, }; /// Simple warning message displayed to non technical user. @@ -47,52 +47,8 @@ impl std::fmt::Display for WarningMessage { pub fn warn<'a, T: 'a>(error: Option<&Error>) -> widget::Container<'a, T> { if let Some(w) = error { let message: WarningMessage = w.into(); - warning(&message.to_string(), &w.to_string()).width(Length::Fill) + notification::warning(message.to_string(), w.to_string()).width(Length::Fill) } else { - container(column()).width(Length::Fill) - } -} - -pub fn warning<'a, T: 'a>(message: &str, error: &str) -> widget::Container<'a, T> { - container( - widget::Tooltip::new( - row() - .push(icon::warning_icon()) - .push(text(message)) - .spacing(20), - error, - widget::tooltip::Position::Bottom, - ) - .style(TooltipWarningStyle), - ) - .padding(15) - .center_x() - .style(WarningStyle) - .width(Length::Fill) -} - -struct WarningStyle; -impl widget::container::StyleSheet for WarningStyle { - fn style(&self) -> widget::container::Style { - widget::container::Style { - border_radius: 0.0, - text_color: iced::Color::BLACK.into(), - background: color::WARNING.into(), - border_color: color::WARNING, - ..widget::container::Style::default() - } - } -} - -struct TooltipWarningStyle; -impl widget::container::StyleSheet for TooltipWarningStyle { - fn style(&self) -> widget::container::Style { - widget::container::Style { - border_radius: 0.0, - border_width: 1.0, - text_color: color::WARNING.into(), - background: color::FOREGROUND.into(), - border_color: color::WARNING, - } + Container::new(Column::new()).width(Length::Fill) } } diff --git a/gui/src/installer/mod.rs b/gui/src/installer/mod.rs index 12e838ae..8f4f9e0e 100644 --- a/gui/src/installer/mod.rs +++ b/gui/src/installer/mod.rs @@ -3,8 +3,7 @@ mod message; mod step; mod view; -use iced::pure::Element; -use iced::{clipboard, Command, Subscription}; +use iced::{clipboard, Command, Element, Subscription}; use iced_native::{window, Event}; use liana::miniscript::bitcoin; diff --git a/gui/src/installer/step/descriptor.rs b/gui/src/installer/step/descriptor.rs index 12e55a8e..22c6ec49 100644 --- a/gui/src/installer/step/descriptor.rs +++ b/gui/src/installer/step/descriptor.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use iced::{pure::Element, Command}; +use iced::{Command, Element}; use liana::{ descriptors::MultipathDescriptor, miniscript::{ @@ -424,7 +424,7 @@ impl Step for RegisterDescriptor { fn view(&self) -> Element { let desc = self.descriptor.as_ref().unwrap(); view::register_descriptor( - &desc.to_string(), + desc.to_string(), &self.hws, self.error.as_ref(), self.processing, diff --git a/gui/src/installer/step/mod.rs b/gui/src/installer/step/mod.rs index 71ab0e86..52c243d6 100644 --- a/gui/src/installer/step/mod.rs +++ b/gui/src/installer/step/mod.rs @@ -6,7 +6,7 @@ use std::str::FromStr; use std::time::Duration; use async_hwi::DeviceKind; -use iced::{pure::Element, Command}; +use iced::{Command, Element}; use liana::{ config::{BitcoinConfig, BitcoindConfig}, descriptors::MultipathDescriptor, diff --git a/gui/src/installer/view.rs b/gui/src/installer/view.rs index 696bbd93..2efb2677 100644 --- a/gui/src/installer/view.rs +++ b/gui/src/installer/view.rs @@ -1,5 +1,5 @@ -use iced::pure::{column, container, pick_list, row, scrollable, widget, Element}; -use iced::{Alignment, Length}; +use iced::widget::{Button, Column, Container, PickList, Row, Scrollable}; +use iced::{Alignment, Element, Length}; use liana::miniscript::bitcoin; @@ -12,7 +12,7 @@ use crate::{ ui::{ color, component::{ - button, card, form, + button, card, container, form, text::{text, Text}, }, icon, @@ -28,19 +28,19 @@ const NETWORKS: [bitcoin::Network; 4] = [ ]; pub fn welcome(network: &bitcoin::Network, valid: bool) -> Element { - container(container( - column() - .push(container( - pick_list(&NETWORKS[..], Some(*network), message::Message::Network).padding(10), + Container::new(Container::new( + Column::new() + .push(Container::new( + PickList::new(&NETWORKS[..], Some(*network), message::Message::Network).padding(10), )) .push(if valid { - container( + Container::new( button::primary(None, "Start the install") .on_press(Message::Next) .width(Length::Units(200)), ) } else { - card::warning("A data directory already exists for this network") + card::warning("A data directory already exists for this network".to_string()) }) .width(Length::Fill) .height(Length::Fill) @@ -63,7 +63,7 @@ pub fn define_descriptor<'a>( sequence: &form::Value, error: Option<&String>, ) -> Element<'a, Message> { - let col_descriptor = column() + let col_descriptor = Column::new() .push(text("Descriptor:").bold()) .push( form::Form::new("Descriptor", imported_descriptor, |msg| { @@ -75,10 +75,10 @@ pub fn define_descriptor<'a>( ) .spacing(10); - let col_user_xpub = column() + let col_user_xpub = Column::new() .push(text("Your xpub:").bold()) .push( - row() + Row::new() .push( form::Form::new("Xpub", user_xpub, |msg| { Message::DefineDescriptor(message::DefineDescriptor::UserXpubEdited(msg)) @@ -99,10 +99,10 @@ pub fn define_descriptor<'a>( ) .spacing(10); - let col_heir_xpub = column() + let col_heir_xpub = Column::new() .push(text("Heir xpub:").bold()) .push( - row() + Row::new() .push( form::Form::new("Xpub", heir_xpub, |msg| { Message::DefineDescriptor(message::DefineDescriptor::HeirXpubEdited(msg)) @@ -123,10 +123,10 @@ pub fn define_descriptor<'a>( ) .spacing(10); - let col_sequence = column() + let col_sequence = Column::new() .push(text("Number of block:").bold()) .push( - container( + Container::new( form::Form::new("Number of block", sequence, |msg| { Message::DefineDescriptor(message::DefineDescriptor::SequenceEdited(msg)) }) @@ -139,10 +139,10 @@ pub fn define_descriptor<'a>( .spacing(10); layout( - column() + Column::new() .push(text("Create the descriptor").bold().size(50)) .push( - column() + Column::new() .push(col_user_xpub) .push(col_sequence) .push(col_heir_xpub) @@ -163,7 +163,7 @@ pub fn define_descriptor<'a>( .on_press(Message::Next) }, ) - .push_maybe(error.map(|e| card::error("Failed to create descriptor", e))) + .push_maybe(error.map(|e| card::error("Failed to create descriptor", e.to_string()))) .width(Length::Fill) .height(Length::Fill) .padding(100) @@ -173,34 +173,34 @@ pub fn define_descriptor<'a>( } pub fn register_descriptor<'a>( - descriptor: &str, + descriptor: String, hws: &[(HardwareWallet, Option<[u8; 32]>)], error: Option<&Error>, processing: bool, chosen_hw: Option, ) -> Element<'a, Message> { layout( - column() + Column::new() .push(text("Register descriptor").bold().size(50)) .push( - column() - .push(text(descriptor).small()) + Column::new() + .push(text(descriptor.clone()).small()) .push( button::transparent_border(Some(icon::clipboard_icon()), "Copy") - .on_press(Message::Clibpboard(descriptor.to_string())), + .on_press(Message::Clibpboard(descriptor)), ) .spacing(10) .align_items(Alignment::Center), ) - .push_maybe(error.map(|e| card::error("Failed to import xpub", &e.to_string()))) + .push_maybe(error.map(|e| card::error("Failed to import xpub", e.to_string()))) .push(if !hws.is_empty() { - column() - .push(text(&format!("{} hardware wallets connected", hws.len())).bold()) + Column::new() + .push(text(format!("{} hardware wallets connected", hws.len())).bold()) .spacing(10) .push( hws.iter() .enumerate() - .fold(column().spacing(10), |col, (i, hw)| { + .fold(Column::new().spacing(10), |col, (i, hw)| { col.push(hw_list_view( i, &hw.0, @@ -212,8 +212,8 @@ pub fn register_descriptor<'a>( ) .width(Length::Fill) } else { - column().push(card::simple( - column() + Column::new().push(card::simple( + Column::new() .spacing(20) .push("No hardware wallet connected") .push(button::primary(None, "Refresh").on_press(Message::Reload)) @@ -238,7 +238,7 @@ pub fn define_bitcoin<'a>( address: &form::Value, cookie_path: &form::Value, ) -> Element<'a, Message> { - let col_address = column() + let col_address = Column::new() .push(text("Address:").bold()) .push( form::Form::new("Address", address, |msg| { @@ -250,7 +250,7 @@ pub fn define_bitcoin<'a>( ) .spacing(10); - let col_cookie = column() + let col_cookie = Column::new() .push(text("Cookie path:").bold()) .push( form::Form::new("Cookie path", cookie_path, |msg| { @@ -263,7 +263,7 @@ pub fn define_bitcoin<'a>( .spacing(10); layout( - column() + Column::new() .push( text("Set up connection to the Bitcoin full node") .bold() @@ -287,9 +287,9 @@ pub fn define_bitcoin<'a>( pub fn install<'a>( generating: bool, config_path: Option<&std::path::PathBuf>, - warning: Option<&String>, + warning: Option<&'a String>, ) -> Element<'a, Message> { - let mut col = column() + let mut col = Column::new() .width(Length::Fill) .height(Length::Fill) .padding(100) @@ -304,10 +304,10 @@ pub fn install<'a>( col = col.push(button::primary(None, "Installing ...").width(Length::Units(200))) } else if let Some(path) = config_path { col = col.push( - container( - column() - .push(container(text("Installed !"))) - .push(container( + Container::new( + Column::new() + .push(Container::new(text("Installed !"))) + .push(Container::new( button::primary(None, "Start") .on_press(Message::Exit(path.clone())) .width(Length::Units(200)), @@ -338,7 +338,7 @@ pub fn hardware_wallet_xpubs_modal<'a>( chosen_hw: Option, ) -> Element<'a, Message> { modal( - column() + Column::new() .push( text(if is_heir { "Import the Heir xpub" @@ -348,15 +348,15 @@ pub fn hardware_wallet_xpubs_modal<'a>( .bold() .size(50), ) - .push_maybe(error.map(|e| card::error("Failed to import xpub", &e.to_string()))) + .push_maybe(error.map(|e| card::error("Failed to import xpub", e.to_string()))) .push(if !hws.is_empty() { - column() - .push(text(&format!("{} hardware wallets connected", hws.len())).bold()) + Column::new() + .push(text(format!("{} hardware wallets connected", hws.len())).bold()) .spacing(10) .push( hws.iter() .enumerate() - .fold(column().spacing(10), |col, (i, hw)| { + .fold(Column::new().spacing(10), |col, (i, hw)| { col.push(hw_list_view( i, hw, @@ -368,10 +368,10 @@ pub fn hardware_wallet_xpubs_modal<'a>( ) .width(Length::Fill) } else { - column() + Column::new() .push( card::simple( - column() + Column::new() .spacing(20) .width(Length::Fill) .push("Please connect a hardware wallet") @@ -397,18 +397,18 @@ fn hw_list_view<'a>( processing: bool, registered: bool, ) -> Element<'a, Message> { - let mut bttn = iced::pure::button( - row() + let mut bttn = Button::new( + Row::new() .push( - column() - .push(text(&format!("{}", hw.kind)).bold()) - .push(text(&format!("fingerprint: {}", hw.fingerprint)).small()) + Column::new() + .push(text(format!("{}", hw.kind)).bold()) + .push(text(format!("fingerprint: {}", hw.fingerprint)).small()) .spacing(5) .width(Length::Fill), ) .push_maybe(if chosen && processing { Some( - column() + Column::new() .push(text("Processing...")) .push(text("Please check your device").small()), ) @@ -416,7 +416,7 @@ fn hw_list_view<'a>( None }) .push_maybe(if registered { - Some(column().push(icon::circle_check_icon().color(color::SUCCESS))) + Some(Column::new().push(icon::circle_check_icon().style(color::SUCCESS))) } else { None }) @@ -424,59 +424,49 @@ fn hw_list_view<'a>( .width(Length::Fill), ) .padding(10) - .style(button::Style::TransparentBorder) + .style(button::Style::TransparentBorder.into()) .width(Length::Fill); if !processing { bttn = bttn.on_press(Message::Select(i)); } - container(bttn) + Container::new(bttn) .width(Length::Fill) .style(card::SimpleCardStyle) .into() } fn layout<'a>(content: impl Into>) -> Element<'a, Message> { - container(scrollable( - column() + Container::new(Scrollable::new( + Column::new() .push( - container(button::transparent(None, "< Previous").on_press(Message::Previous)) + Container::new(button::transparent(None, "< Previous").on_press(Message::Previous)) .padding(5), ) - .push(container(content).width(Length::Fill).center_x()), + .push(Container::new(content).width(Length::Fill).center_x()), )) .center_x() .height(Length::Fill) .width(Length::Fill) - .style(BackgroundStyle) + .style(container::Style::Background) .into() } fn modal<'a>(content: impl Into>) -> Element<'a, Message> { - container(scrollable( - column() + Container::new(Scrollable::new( + Column::new() .push( - row().push(column().width(Length::Fill)).push( - container( + Row::new().push(Column::new().width(Length::Fill)).push( + Container::new( button::primary(Some(icon::cross_icon()), "Close").on_press(Message::Close), ) .padding(10), ), ) - .push(container(content).width(Length::Fill).center_x()), + .push(Container::new(content).width(Length::Fill).center_x()), )) .center_x() .height(Length::Fill) .width(Length::Fill) - .style(BackgroundStyle) + .style(container::Style::Background) .into() } - -pub struct BackgroundStyle; -impl widget::container::StyleSheet for BackgroundStyle { - fn style(&self) -> widget::container::Style { - widget::container::Style { - background: color::BACKGROUND.into(), - ..widget::container::Style::default() - } - } -} diff --git a/gui/src/loader.rs b/gui/src/loader.rs index 075085e8..55662345 100644 --- a/gui/src/loader.rs +++ b/gui/src/loader.rs @@ -3,7 +3,10 @@ use std::io::ErrorKind; use std::path::PathBuf; use std::sync::Arc; -use iced::pure::{column, text, Element}; +use iced::{ + widget::{Column, Text}, + Element, +}; use iced::{Alignment, Command, Subscription}; use iced_native::{window, Event}; use log::{debug, info}; @@ -199,16 +202,16 @@ impl Loader { pub fn view(&self) -> Element { match &self.step { - Step::StartingDaemon => cover(text("Starting daemon...")), - Step::Connecting => cover(text("Connecting to daemon...")), - Step::Syncing { progress, .. } => cover(text(&format!("Syncing... {}%", progress))), - Step::Error(error) => cover(text(&format!("Error: {}", error))), + Step::StartingDaemon => cover(Text::new("Starting daemon...")), + Step::Connecting => cover(Text::new("Connecting to daemon...")), + Step::Syncing { progress, .. } => cover(Text::new(format!("Syncing... {}%", progress))), + Step::Error(error) => cover(Text::new(format!("Error: {}", error))), } } } pub fn cover<'a, T: 'a, C: Into>>(content: C) -> Element<'a, T> { - column() + Column::new() .push(content) .width(iced::Length::Fill) .height(iced::Length::Fill) diff --git a/gui/src/main.rs b/gui/src/main.rs index 032f7f8b..7d9d3e7c 100644 --- a/gui/src/main.rs +++ b/gui/src/main.rs @@ -1,7 +1,6 @@ use std::{error::Error, path::PathBuf, str::FromStr}; -use iced::pure::{Application, Element}; -use iced::{executor, Command, Settings, Subscription}; +use iced::{executor, Application, Command, Element, Settings, Subscription}; extern crate serde; extern crate serde_json; @@ -94,6 +93,7 @@ impl Application for GUI { type Executor = executor::Default; type Message = Message; type Flags = Config; + type Theme = iced::Theme; fn title(&self) -> String { match self.state { diff --git a/gui/src/ui/component/badge.rs b/gui/src/ui/component/badge.rs index 44984196..673783d8 100644 --- a/gui/src/ui/component/badge.rs +++ b/gui/src/ui/component/badge.rs @@ -1,6 +1,6 @@ use iced::{ - pure::{container, widget, Element}, - Length, + widget::{self, Container}, + Element, Length, }; use crate::ui::{color, icon}; @@ -12,36 +12,49 @@ pub enum Style { } impl widget::container::StyleSheet for Style { - fn style(&self) -> widget::container::Style { + type Style = iced::Theme; + fn appearance(&self, _style: &Self::Style) -> widget::container::Appearance { match self { - Self::Standard => widget::container::Style { + Self::Standard => widget::container::Appearance { border_radius: 40.0, background: color::BACKGROUND.into(), - ..widget::container::Style::default() + ..widget::container::Appearance::default() }, - Self::Success => widget::container::Style { + Self::Success => widget::container::Appearance { border_radius: 40.0, background: color::SUCCESS_LIGHT.into(), text_color: color::SUCCESS.into(), - ..widget::container::Style::default() + ..widget::container::Appearance::default() }, - Self::Warning => widget::container::Style { + Self::Warning => widget::container::Appearance { border_radius: 40.0, background: color::WARNING_LIGHT.into(), text_color: color::WARNING.into(), - ..widget::container::Style::default() + ..widget::container::Appearance::default() }, } } } -pub struct Badge { - icon: widget::Text, - style: S, +impl From