diff --git a/Cargo.lock b/Cargo.lock index 715a6c0..6703e17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,6 +33,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "ahash" version = "0.8.11" @@ -145,6 +156,151 @@ dependencies = [ "libloading 0.7.4", ] +[[package]] +name = "async-broadcast" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" +dependencies = [ + "event-listener 5.3.0", + "event-listener-strategy 0.5.2", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +dependencies = [ + "concurrent-queue", + "event-listener 5.3.0", + "event-listener-strategy 0.5.2", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53fc6301894e04a92cb2584fedde80cb25ba8e02d9dc39d4a87d036e22f397d" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener 5.3.0", + "futures-lite", + "rustix", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "async-signal" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -291,6 +447,20 @@ dependencies = [ "objc2", ] +[[package]] +name = "blocking" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "boolinator" version = "2.4.0" @@ -743,6 +913,22 @@ dependencies = [ "winapi", ] +[[package]] +name = "dark-light" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a76fa97167fa740dcdbfe18e8895601e1bc36525f09b044e00916e717c03a3c" +dependencies = [ + "dconf_rs", + "detect-desktop-environment", + "dirs", + "objc", + "rust-ini", + "web-sys", + "winreg 0.10.1", + "zbus", +] + [[package]] name = "data-encoding" version = "2.5.0" @@ -755,6 +941,29 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" +[[package]] +name = "dconf_rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7046468a81e6a002061c01e6a7c83139daf91b11c30e66795b13217c2d885c8b" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "detect-desktop-environment" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21d8ad60dd5b13a4ee6bd8fa2d5d88965c597c67bce32b5fc49c94f55cb50810" + [[package]] name = "digest" version = "0.10.7" @@ -775,6 +984,15 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -785,6 +1003,17 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -811,6 +1040,12 @@ dependencies = [ "libloading 0.8.3", ] +[[package]] +name = "dlv-list" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" + [[package]] name = "downcast-rs" version = "1.2.0" @@ -872,12 +1107,12 @@ dependencies = [ name = "dynasty" version = "0.1.0" dependencies = [ - "ahash", + "ahash 0.8.11", "binance-rs-async", "chrono", "directories-next", "iced", - "iced_futures", + "iced_futures 0.13.0-dev", "lyon_algorithms", "meval", "ngnk", @@ -910,6 +1145,33 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enumflags2" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -951,6 +1213,48 @@ dependencies = [ "num-traits", ] +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.0", + "pin-project-lite", +] + [[package]] name = "exr" version = "1.72.0" @@ -1206,6 +1510,19 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.30" @@ -1360,6 +1677,18 @@ dependencies = [ "wgpu", ] +[[package]] +name = "glyphon" +version = "0.5.0" +source = "git+https://github.com/hecrj/glyphon.git?rev=ceed55403ce53e120ce9d1fae17dcfe388726118#ceed55403ce53e120ce9d1fae17dcfe388726118" +dependencies = [ + "cosmic-text", + "etagere", + "lru", + "rustc-hash", + "wgpu", +] + [[package]] name = "gpu-alloc" version = "0.6.0" @@ -1400,7 +1729,7 @@ checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ "bitflags 2.4.2", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -1451,13 +1780,22 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash", + "ahash 0.8.11", "allocator-api2", ] @@ -1617,14 +1955,13 @@ dependencies = [ [[package]] name = "iced" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4eb0fbbefb8c428b70680e77ed9013887b17c1d6be366b40f264f956d1a096" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" dependencies = [ - "iced_core", - "iced_futures", - "iced_renderer", - "iced_widget", + "iced_core 0.13.0-dev", + "iced_futures 0.13.0-dev", + "iced_renderer 0.13.0-dev", + "iced_widget 0.13.0-dev", "iced_winit", "image", "thiserror", @@ -1648,6 +1985,25 @@ dependencies = [ "xxhash-rust", ] +[[package]] +name = "iced_core" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "bitflags 2.4.2", + "dark-light", + "glam", + "log", + "num-traits", + "once_cell", + "palette", + "raw-window-handle", + "rustc-hash", + "smol_str", + "thiserror", + "web-time", +] + [[package]] name = "iced_futures" version = "0.12.0" @@ -1655,8 +2011,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "370bad88fb3832cbeeb3fa6c486b4701fb7e8da32a753b3101d4ce81fc1d9497" dependencies = [ "futures", - "iced_core", + "iced_core 0.12.3", "log", + "wasm-bindgen-futures", + "wasm-timer", +] + +[[package]] +name = "iced_futures" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "futures", + "iced_core 0.13.0-dev", + "log", + "rustc-hash", "tokio", "wasm-bindgen-futures", "wasm-timer", @@ -1672,8 +2041,29 @@ dependencies = [ "bytemuck", "cosmic-text", "half", - "iced_core", - "iced_futures", + "iced_core 0.12.3", + "iced_futures 0.12.0", + "log", + "lyon_path", + "once_cell", + "raw-window-handle", + "rustc-hash", + "thiserror", + "unicode-segmentation", + "xxhash-rust", +] + +[[package]] +name = "iced_graphics" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "bitflags 2.4.2", + "bytemuck", + "cosmic-text", + "half", + "iced_core 0.13.0-dev", + "iced_futures 0.13.0-dev", "image", "kamadak-exif", "log", @@ -1683,7 +2073,6 @@ dependencies = [ "rustc-hash", "thiserror", "unicode-segmentation", - "xxhash-rust", ] [[package]] @@ -1692,9 +2081,21 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c281e03001d566058f53dec9325bbe61c62da715341206d2627f57a3ecc7f69" dependencies = [ - "iced_graphics", - "iced_tiny_skia", - "iced_wgpu", + "iced_graphics 0.12.1", + "iced_tiny_skia 0.12.1", + "iced_wgpu 0.12.1", + "log", + "thiserror", +] + +[[package]] +name = "iced_renderer" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "iced_graphics 0.13.0-dev", + "iced_tiny_skia 0.13.0-dev", + "iced_wgpu 0.13.0-dev", "log", "thiserror", ] @@ -1705,8 +2106,19 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a79f852c01cc6d61663c94379cb3974ac3ad315a28c504e847d573e094f46822" dependencies = [ - "iced_core", - "iced_futures", + "iced_core 0.12.3", + "iced_futures 0.12.0", + "raw-window-handle", + "thiserror", +] + +[[package]] +name = "iced_runtime" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "iced_core 0.13.0-dev", + "iced_futures 0.13.0-dev", "raw-window-handle", "thiserror", ] @@ -1717,7 +2129,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ea42a740915d2a5a9ff9c3aa0bca28b16e9fb660bc8f675eed71d186cadb579" dependencies = [ - "iced_core", + "iced_core 0.12.3", "once_cell", "palette", ] @@ -1730,16 +2142,31 @@ checksum = "8c2228781f4d381a1cbbd7905a9f077351aa8d37269094021d5d9e779f130aff" dependencies = [ "bytemuck", "cosmic-text", - "iced_graphics", + "iced_graphics 0.12.1", "kurbo 0.10.4", "log", - "resvg", "rustc-hash", "softbuffer", "tiny-skia", "xxhash-rust", ] +[[package]] +name = "iced_tiny_skia" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "bytemuck", + "cosmic-text", + "iced_graphics 0.13.0-dev", + "kurbo 0.10.4", + "log", + "resvg", + "rustc-hash", + "softbuffer", + "tiny-skia", +] + [[package]] name = "iced_wgpu" version = "0.12.1" @@ -1750,13 +2177,33 @@ dependencies = [ "bytemuck", "futures", "glam", - "glyphon", + "glyphon 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "guillotiere", - "iced_graphics", + "iced_graphics 0.12.1", + "log", + "lyon", + "once_cell", + "wgpu", +] + +[[package]] +name = "iced_wgpu" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "bitflags 2.4.2", + "bytemuck", + "futures", + "glam", + "glyphon 0.5.0 (git+https://github.com/hecrj/glyphon.git?rev=ceed55403ce53e120ce9d1fae17dcfe388726118)", + "guillotiere", + "iced_graphics 0.13.0-dev", "log", "lyon", "once_cell", "resvg", + "rustc-hash", + "thiserror", "wgpu", ] @@ -1766,25 +2213,37 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e01b2212adecf1cb80e2267f302c0e0c263e55f97812056949199ccf9f0b908" dependencies = [ - "iced_renderer", - "iced_runtime", + "iced_renderer 0.12.1", + "iced_runtime 0.12.1", "iced_style", "num-traits", + "thiserror", + "unicode-segmentation", +] + +[[package]] +name = "iced_widget" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" +dependencies = [ + "iced_renderer 0.13.0-dev", + "iced_runtime 0.13.0-dev", + "num-traits", "ouroboros", + "rustc-hash", "thiserror", "unicode-segmentation", ] [[package]] name = "iced_winit" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f66831d0e399b93f631739121a6171780d344b275d56808b9504d8ca75c7d2" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced#e617d7e929bf7cb9aded39dea53d079e41b530d6" dependencies = [ - "iced_graphics", - "iced_runtime", - "iced_style", + "iced_graphics 0.13.0-dev", + "iced_runtime 0.13.0-dev", "log", + "rustc-hash", "thiserror", "tracing", "web-sys", @@ -1845,7 +2304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -2078,7 +2537,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -2175,6 +2634,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "metal" version = "0.27.0" @@ -2296,6 +2764,19 @@ dependencies = [ "bindgen", ] +[[package]] +name = "nix" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "cfg_aliases 0.1.1", + "libc", + "memoffset", +] + [[package]] name = "nom" version = "1.2.4" @@ -2448,6 +2929,26 @@ dependencies = [ "libredox 0.0.2", ] +[[package]] +name = "ordered-multimap" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +dependencies = [ + "dlv-list", + "hashbrown 0.12.3", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "ouroboros" version = "0.18.3" @@ -2511,6 +3012,12 @@ dependencies = [ "syn 2.0.53", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.11.2" @@ -2666,6 +3173,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.30" @@ -2715,8 +3233,8 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5e45cd10abd572d7d0dce11446a915c8b54442480d2a46e71dcb9dd43d93b4c" dependencies = [ - "iced_graphics", - "iced_widget", + "iced_graphics 0.12.1", + "iced_widget 0.12.3", "once_cell", "plotters", "plotters-backend", @@ -3053,7 +3571,7 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots 0.25.4", - "winreg", + "winreg 0.50.0", ] [[package]] @@ -3121,6 +3639,16 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" +[[package]] +name = "rust-ini" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3667,6 +4195,18 @@ dependencies = [ "libc", ] +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -3986,6 +4526,17 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4803,10 +5354,9 @@ checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winit" version = "0.29.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" +source = "git+https://github.com/iced-rs/winit.git?rev=592bd152f6d5786fae7d918532d7db752c0d164f#592bd152f6d5786fae7d918532d7db752c0d164f" dependencies = [ - "ahash", + "ahash 0.8.11", "android-activity", "atomic-waker", "bitflags 2.4.2", @@ -4857,6 +5407,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + [[package]] name = "winreg" version = "0.50.0" @@ -4914,6 +5473,16 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" +[[package]] +name = "xdg-home" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "xkbcommon-dl" version = "0.4.2" @@ -4981,6 +5550,70 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "zbus" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9ff46f2a25abd690ed072054733e0bc3157e3d4c45f41bd183dce09c2ff8ab9" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "derivative", + "enumflags2", + "event-listener 5.3.0", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0e3852c93dcdb49c9462afe67a2a468f7bd464150d866e861eaf06208633e0" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + [[package]] name = "zeno" version = "0.2.3" @@ -5021,3 +5654,40 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zvariant" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1b3ca6db667bfada0f1ebfc94b2b1759ba25472ee5373d4551bb892616389a" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7a4b236063316163b69039f77ce3117accb41a09567fd24c168e43491e521bc" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/Cargo.toml b/Cargo.toml index 5144d83..3d42834 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,8 @@ icon = ["assets/dynasty.icns"] [dependencies] binance-rs-async = { version = "1.3.2", default_features = false, features = ["rustls-tls", "wallet_api"] } chrono = "0.4.31" -iced = { version = "0.12.0", features = ["tokio", "debug", "lazy", "svg", "image", "advanced", "canvas"] } -iced_futures = "0.12.0" +iced = { git = "https://github.com/iced-rs/iced", features = ["tokio", "debug", "lazy", "svg", "image", "advanced", "canvas"], rev = "e617d7e929bf7cb9aded39dea53d079e41b530d6" } +iced_futures = { git = "https://github.com/iced-rs/iced", rev = "e617d7e929bf7cb9aded39dea53d079e41b530d6" } serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.114" tokio = { version = "1.32.0", default-features = false, features=["sync"]} diff --git a/src/app.rs b/src/app.rs index 082d0da..0ead99b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -21,7 +21,8 @@ use iced::widget::svg; use iced::widget::Row; use iced::widget::Space; use iced::widget::{column, container, row, text}; -use iced::{Application, Color, Command, Element, Length, Subscription, Theme}; +use iced::Renderer; +use iced::{Color, Command, Element, Length, Subscription, Theme}; use ringbuf::Rb; pub(crate) struct App { @@ -92,7 +93,8 @@ impl App { } } -impl Application for App { +impl iced::advanced::Application for App { + type Renderer = Renderer; type Message = Message; type Theme = Theme; type Flags = Config; @@ -268,13 +270,13 @@ impl Application for App { Space::new(Length::Fill, 1), button(text("Settings").size(14)) .padding(8) - .style(iced::theme::Button::Text) + .style(iced::widget::button::text) .on_press(Message::SettingsToggled) ] .align_items(iced::Alignment::Center), ) .padding([0, 16]) - .style(container::Appearance { + .style(|_t| container::Style { background: Some(iced::Background::Color(Color::from_rgb(0.07, 0.07, 0.07))), border: iced::Border { radius: 16.0.into(), @@ -289,13 +291,13 @@ impl Application for App { Space::new(Length::Fill, 1), button(text("X").size(14)) .padding(8) - .style(iced::theme::Button::Text) + .style(iced::widget::button::text) .on_press(Message::SettingsToggled) ] .align_items(iced::Alignment::Center), ) .padding([0, 16]) - .style(container::Appearance { + .style(|_t| container::Style { background: Some(iced::Background::Color(Color::from_rgb(0.99, 0.03, 0.03))), border: iced::Border { radius: 16.0.into(), @@ -327,7 +329,7 @@ impl Application for App { .width(Length::Fill) .height(Length::Fill) .padding(20) - .style(|_: &_| container::Appearance { + .style(|_: &_| container::Style { background: Some(iced::Background::Color(Color::BLACK)), ..Default::default() }) diff --git a/src/main.rs b/src/main.rs index 2181b51..ff9e0fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use crate::{app::App, config::Config}; use std::env; -use iced::{Application, Font, Settings}; +use iced::{advanced::Application, Font, Settings}; use tracing_subscriber::EnvFilter; fn main() -> iced::Result { diff --git a/src/views/components/better_btn.rs b/src/views/components/better_btn.rs index 599a5b7..b6c381e 100644 --- a/src/views/components/better_btn.rs +++ b/src/views/components/better_btn.rs @@ -1,118 +1,105 @@ use iced::{widget::button, Color}; -pub struct BetterBtn; - -impl button::StyleSheet for BetterBtn { - type Style = iced::Theme; - fn active(&self, _: &Self::Style) -> button::Appearance { - button::Appearance { - background: Some(iced::Background::Color(Color::from_rgba( - 0.3, 0.3, 0.3, 0.3, - ))), - text_color: Color::WHITE, - shadow_offset: iced::Vector { x: 1.0, y: 1.0 }, - border: iced::Border { - radius: 4.0.into(), - width: 1.0, - color: Color::from_rgba(0.0, 0.0, 0.0, 0.5), - }, - ..Default::default() - } +pub fn unstyled_btn() -> button::Style { + button::Style { + background: None, + text_color: Color::WHITE, + ..Default::default() } +} - fn pressed(&self, _: &Self::Style) -> button::Appearance { - button::Appearance { - background: Some(iced::Background::Color(Color::from_rgba( - 0.3, 0.3, 0.3, 0.3, - ))), - text_color: Color::WHITE, - shadow_offset: iced::Vector { x: 1.0, y: 1.0 }, - border: iced::Border { - radius: 0.0.into(), - width: 1.0, - color: Color::from_rgb(1.0, 0.0, 0.0), - }, - ..Default::default() - } +pub fn better_btn() -> button::Style { + button::Style { + background: Some(iced::Background::Color(Color::from_rgba( + 0.3, 0.3, 0.3, 0.3, + ))), + text_color: Color::WHITE, + border: iced::Border { + radius: 4.0.into(), + width: 1.0, + color: Color::from_rgba(0.0, 0.0, 0.0, 0.5), + }, + ..Default::default() } } -pub struct GreenBtn; - -impl button::StyleSheet for GreenBtn { - type Style = iced::Theme; - fn active(&self, _: &Self::Style) -> button::Appearance { - button::Appearance { - background: Some(iced::Background::Color(Color::from_rgba( - 50.0 / 255.0, - 217.0 / 255.0, - 147.0 / 255.0, - 1.0, - ))), - text_color: Color::WHITE, - shadow_offset: iced::Vector { x: 1.0, y: 1.0 }, - border: iced::Border { - radius: 4.0.into(), - width: 1.0, - color: Color::from_rgba(0.0, 0.0, 0.0, 0.5), - }, - ..Default::default() - } +/* fn pressed(&self, _: &Self::Style) -> button::Style { + button::Style { + background: Some(iced::Background::Color(Color::from_rgba( + 0.3, 0.3, 0.3, 0.3, + ))), + text_color: Color::WHITE, + border: iced::Border { + radius: 0.0.into(), + width: 1.0, + color: Color::from_rgb(1.0, 0.0, 0.0), + }, + ..Default::default() } +} */ - fn pressed(&self, _: &Self::Style) -> button::Appearance { - button::Appearance { - background: Some(iced::Background::Color(Color::from_rgba( - 0.3, 0.3, 0.3, 0.3, - ))), - text_color: Color::WHITE, - shadow_offset: iced::Vector { x: 1.0, y: 1.0 }, - border: iced::Border { - radius: 0.0.into(), - width: 1.0, - color: Color::from_rgb(1.0, 0.0, 0.0), - }, - ..Default::default() - } +pub fn green_btn() -> button::Style { + button::Style { + background: Some(iced::Background::Color(Color::from_rgba( + 50.0 / 255.0, + 217.0 / 255.0, + 147.0 / 255.0, + 1.0, + ))), + text_color: Color::WHITE, + border: iced::Border { + radius: 4.0.into(), + width: 1.0, + color: Color::from_rgba(0.0, 0.0, 0.0, 0.5), + }, + ..Default::default() } } -pub struct RedBtn; +pub fn red_btn() -> button::Style { + button::Style { + background: Some(iced::Background::Color(Color::from_rgba( + 1.0, + 112.0 / 255.0, + 126.0 / 255.0, + 1.0, + ))), + text_color: Color::WHITE, + border: iced::Border { + radius: 4.0.into(), + width: 1.0, + color: Color::from_rgba(0.0, 0.0, 0.0, 0.5), + }, + ..Default::default() + } +} -impl button::StyleSheet for RedBtn { - type Style = iced::Theme; - fn active(&self, _: &Self::Style) -> button::Appearance { - button::Appearance { - background: Some(iced::Background::Color(Color::from_rgba( - 1.0, - 112.0 / 255.0, - 126.0 / 255.0, - 1.0, - ))), - text_color: Color::WHITE, - shadow_offset: iced::Vector { x: 1.0, y: 1.0 }, - border: iced::Border { - radius: 4.0.into(), - width: 1.0, - color: Color::from_rgba(0.0, 0.0, 0.0, 0.5), - }, - ..Default::default() - } +/* fn pressed(&self, _: &Self::Style) -> button::Style { + button::Style { + background: Some(iced::Background::Color(Color::from_rgba( + 0.3, 0.3, 0.3, 0.3, + ))), + text_color: Color::WHITE, + border: iced::Border { + radius: 0.0.into(), + width: 1.0, + color: Color::from_rgb(1.0, 0.0, 0.0), + }, + ..Default::default() } +} */ - fn pressed(&self, _: &Self::Style) -> button::Appearance { - button::Appearance { - background: Some(iced::Background::Color(Color::from_rgba( - 0.3, 0.3, 0.3, 0.3, - ))), - text_color: Color::WHITE, - shadow_offset: iced::Vector { x: 1.0, y: 1.0 }, - border: iced::Border { - radius: 0.0.into(), - width: 1.0, - color: Color::from_rgb(1.0, 0.0, 0.0), - }, - ..Default::default() - } +/* fn pressed(&self, _: &Self::Style) -> button::Style { + button::Style { + background: Some(iced::Background::Color(Color::from_rgba( + 0.3, 0.3, 0.3, 0.3, + ))), + text_color: Color::WHITE, + border: iced::Border { + radius: 0.0.into(), + width: 1.0, + color: Color::from_rgb(1.0, 0.0, 0.0), + }, + ..Default::default() } -} +} */ diff --git a/src/views/components/input.rs b/src/views/components/input.rs deleted file mode 100644 index a573ecf..0000000 --- a/src/views/components/input.rs +++ /dev/null @@ -1,74 +0,0 @@ -use iced::{widget::text_input, Background, Color}; - -pub struct Inp; - -impl text_input::StyleSheet for Inp { - type Style = iced::Theme; - - fn active(&self, _: &Self::Style) -> text_input::Appearance { - text_input::Appearance { - background: Background::Color(Color::from_rgb(0.11, 0.11, 0.11)), - border: iced::Border { - radius: 0.0.into(), - width: 1.0, - color: Color { - r: 0.0, - g: 0.0, - b: 0.0, - a: 0.3, - }, - }, - icon_color: Default::default(), - } - } - - fn focused(&self, _: &Self::Style) -> text_input::Appearance { - text_input::Appearance { - background: Background::Color(Color::from_rgb(0.5, 0.5, 0.5)), - border: iced::Border { - radius: 0.0.into(), - width: 1.0, - color: Color { - a: 0.5, - r: 0.5, - g: 0.5, - b: 0.5, - }, - }, - icon_color: Default::default(), - } - } - - fn placeholder_color(&self, _: &Self::Style) -> Color { - Color::from_rgb(0.3, 0.3, 0.3) - } - - fn value_color(&self, _: &Self::Style) -> Color { - Color::WHITE - } - - fn disabled_color(&self, _: &Self::Style) -> Color { - Color::from_rgb(0.7, 0.7, 0.7) - } - - fn selection_color(&self, _: &Self::Style) -> Color { - Color::from_rgb(0.3, 0.3, 0.3) - } - - fn disabled(&self, _: &Self::Style) -> text_input::Appearance { - text_input::Appearance { - background: Background::Color(Color::from_rgb(0.5, 0.5, 0.5)), - border: iced::Border { - radius: 0.0.into(), - width: 1.0, - color: Color { - a: 0.5, - r: 0.5, - g: 0.5, - b: 0.5, - }, - }, - icon_color: Default::default(), - } - } -} diff --git a/src/views/components/loading.rs b/src/views/components/loading.rs index 882d0e6..54773d8 100644 --- a/src/views/components/loading.rs +++ b/src/views/components/loading.rs @@ -319,7 +319,7 @@ where renderer.with_translation(Vector::new(bounds.x, bounds.y), |renderer| { use iced::advanced::graphics::geometry::Renderer as _; - renderer.draw(vec![geometry]); + renderer.draw_geometry(geometry); }); } } diff --git a/src/views/components/mod.rs b/src/views/components/mod.rs index e5b650b..fc8604c 100644 --- a/src/views/components/mod.rs +++ b/src/views/components/mod.rs @@ -1,6 +1,3 @@ pub mod better_btn; -pub mod input; -// pub mod list; pub mod loading; pub mod scrollbar; -pub mod unstyled_btn; diff --git a/src/views/components/unstyled_btn.rs b/src/views/components/unstyled_btn.rs deleted file mode 100644 index 1534bed..0000000 --- a/src/views/components/unstyled_btn.rs +++ /dev/null @@ -1,25 +0,0 @@ -use iced::{widget::button, Color}; - -/* pub fn unstyled_btn<'a, Message>(content: &'a str, message: Message) -> Element<'a, Message> -where - Message: Clone + 'a, -{ - Element::new( - iced::widget::Button::new(content) - .on_press(message) - .style(iced::theme::Button::Custom(Box::new(UnstyledBtn {}))), - ) -} */ - -pub struct UnstyledBtn; - -impl button::StyleSheet for UnstyledBtn { - type Style = iced::Theme; - fn active(&self, _: &Self::Style) -> button::Appearance { - button::Appearance { - background: None, - text_color: Color::WHITE, - ..Default::default() - } - } -} diff --git a/src/views/dashboard.rs b/src/views/dashboard.rs index 36c18c3..3cb709e 100644 --- a/src/views/dashboard.rs +++ b/src/views/dashboard.rs @@ -1,7 +1,6 @@ use iced::{ - theme, widget::{ - button, + button::{danger, secondary}, pane_grid::{self, Configuration}, responsive, row, text, PaneGrid, }, @@ -87,24 +86,24 @@ pub fn view_controls<'a>( DashboardMessage::Maximize(pane), ) }; - button(content.size(12).style(h2c("FFFFFF").unwrap())) + iced::widget::button(content.size(12).color(h2c("FFFFFF").unwrap())) .height(14) .width(14) - .style(theme::Button::Secondary) + .style(secondary) .on_press(message) }; row = row.push(toggle); } - let mut close = button( + let mut close = iced::widget::button( text('\u{F62A}') .size(12) .font(Font::with_name("bootstrap-icons")), ) .height(14) .width(14) - .style(theme::Button::Destructive); + .style(danger); if total_panes > 1 && !is_pinned { close = close.on_press(DashboardMessage::Close(pane)); diff --git a/src/views/panes/balances.rs b/src/views/panes/balances.rs index c72b334..445dfba 100644 --- a/src/views/panes/balances.rs +++ b/src/views/panes/balances.rs @@ -3,7 +3,7 @@ use crate::{ svg_logos, theme::h2c, views::{ - components::{loading::loader, unstyled_btn::UnstyledBtn}, + components::{better_btn::unstyled_btn, loading::loader}, dashboard::DashboardMessage, }, }; @@ -46,20 +46,16 @@ impl BalancesPane { container(row![ row![ svg, - button(tb(&b.asset).size(14).style(h2c("B7BDB7").unwrap())) - .style(iced::theme::Button::Custom(Box::new(UnstyledBtn {}))) + button(tb(&b.asset).size(14).color(h2c("B7BDB7").unwrap())) + .style(|_t, _s| unstyled_btn()) .on_press(DashboardMessage::CurrencyPairSelected(b.asset.clone())), ] .spacing(4) .align_items(iced::Alignment::Center), Space::new(Length::Fill, 1.0), - button( - text(format!("{}", (b.free * 10.0).round() / 10.0)) - .size(14) - .style(h2c("B7BDB7").unwrap()) - ) - .style(iced::theme::Button::Custom(Box::new(UnstyledBtn {}))) - .on_press(DashboardMessage::CurrencyPairSelected(b.asset.clone())), + button(text(format!("{}", (b.free * 10.0).round() / 10.0)).size(14)) + .style(|_t, _s| unstyled_btn()) + .on_press(DashboardMessage::CurrencyPairSelected(b.asset.clone())), ]) .width(Length::Fill) }) diff --git a/src/views/panes/book.rs b/src/views/panes/book.rs index 19f4aa4..82988c0 100644 --- a/src/views/panes/book.rs +++ b/src/views/panes/book.rs @@ -41,12 +41,12 @@ impl BookPane { row![ t(format!("{:.2}", price.parse::().unwrap())) .width(Length::FillPortion(1)) - .style(iced::Color::from_rgb(1.0, 0.0, 0.0)), + .color(iced::Color::from_rgb(1.0, 0.0, 0.0)), t(format!("{quantity:.4}")) .width(Length::FillPortion(1)) - .style(h2c("B7BDB7").unwrap()), + .color(h2c("B7BDB7").unwrap()), t(format!("{:.2}", price.parse::().unwrap() * quantity)) - .style(h2c("B7BDB7").unwrap()) + .color(h2c("B7BDB7").unwrap()) .width(Length::FillPortion(1)), ] .spacing(10) @@ -63,13 +63,13 @@ impl BookPane { row![ t(format!("{:.2}", price.parse::().unwrap())) .width(Length::FillPortion(1)) - .style(iced::Color::from_rgb(0.0, 1.0, 0.0)), + .color(iced::Color::from_rgb(0.0, 1.0, 0.0)), t(format!("{quantity:.2}")) .width(Length::FillPortion(1)) - .style(h2c("B7BDB7").unwrap()), + .color(h2c("B7BDB7").unwrap()), t(format!("{:.2}", price.parse::().unwrap() * quantity)) .width(Length::FillPortion(1)) - .style(h2c("B7BDB7").unwrap()) + .color(h2c("B7BDB7").unwrap()) ] .spacing(10) }) @@ -87,7 +87,7 @@ impl BookPane { .unwrap_or((&String::new(), &0.0)) .0 )) - .style(iced::Color::WHITE), + .color(iced::Color::WHITE), bid_rows ] .padding([2, 12]) diff --git a/src/views/panes/calculator.rs b/src/views/panes/calculator.rs index 1f368ac..a68bfc4 100644 --- a/src/views/panes/calculator.rs +++ b/src/views/panes/calculator.rs @@ -1,7 +1,7 @@ #[cfg(not(any(feature = "calculator_meval", feature = "calculator_k")))] compile_error!("no calculator backend selected"); -use crate::{data::AppData, theme::h2c, views::components::better_btn::GreenBtn}; +use crate::{data::AppData, theme::h2c, views::components::better_btn::green_btn}; use binance::rest_model::Order; use iced::{ @@ -88,7 +88,7 @@ impl CalculatorPane { .on_action(CalculatorPaneMessage::Action), container( button(text("\u{F4F5}").font(Font::with_name("bootstrap-icons"))) - .style(iced::theme::Button::Custom(Box::new(GreenBtn {}))) + .style(|_t, _s| green_btn()) .on_press(CalculatorPaneMessage::Toggle) ) .padding(2) @@ -103,16 +103,17 @@ impl CalculatorPane { self.content .text() .lines() + .map(|l| l.to_owned()) .zip(&self.eval_results) .map(|(s, e)| column![ - tb(s).size(18).style(h2c("EFE1D1").unwrap()), - text(e).size(18).style(h2c("EEEEEE").unwrap()), + tb(s).size(18).color(h2c("EFE1D1").unwrap()), + text(e).size(18).color(h2c("EEEEEE").unwrap()), ]) .map(Element::from) ), Space::new(Length::Fill, Length::Fill), button(text('\u{F4CA}').font(Font::with_name("bootstrap-icons"))) - .style(iced::theme::Button::Custom(Box::new(GreenBtn {}))) + .style(|_t, _s| green_btn()) .on_press(CalculatorPaneMessage::Toggle) ] .align_items(Alignment::Center), diff --git a/src/views/panes/chart.rs b/src/views/panes/chart.rs index bb4876e..dfd01e2 100644 --- a/src/views/panes/chart.rs +++ b/src/views/panes/chart.rs @@ -9,14 +9,15 @@ use iced::Length; use plotters::prelude::*; use plotters::style::colors; use plotters::style::IntoFont; -use plotters_iced::{Chart, ChartBuilder, ChartWidget, DrawingBackend}; +use plotters_iced::{Chart, ChartBuilder, DrawingBackend}; use ringbuf::ring_buffer::RbBase; use ringbuf::Rb; use super::orders::tb; use crate::data::AppData; +use crate::views::components::better_btn::green_btn; use crate::views::components::loading::loader; -use crate::views::{components::better_btn::GreenBtn, dashboard::DashboardMessage}; +use crate::views::dashboard::DashboardMessage; pub(crate) struct ChartPane {} @@ -90,24 +91,24 @@ impl ChartPane { let btns = Row::with_children( ["1m", "5m", "30m", "1h", "1d"] .map(|t| { - button(tb(t).style(iced::Color::WHITE).size(12)) + button(tb(t).color(iced::Color::WHITE).size(12)) .on_press(DashboardMessage::TimeframeChanged(t.into())) .padding(8) - .style(iced::theme::Button::Custom(Box::new(GreenBtn {}))) + .style(|_t, _s| green_btn()) }) .map(Element::from), ) .spacing(4); container(column![ - ChartWidget::new(PriceChart(data)), + // ChartWidget::new(PriceChart(data)), row![ Space::new(Length::Fill, 0), btns, Space::new(Length::Fill, 0) ] ]) - .style(container::Appearance { + .style(|_t| container::Style { background: Some(iced::Background::Color(iced::Color::from_rgb( 0.07, 0.07, 0.07, ))), diff --git a/src/views/panes/market.rs b/src/views/panes/market.rs index e82c3ef..10ce2e4 100644 --- a/src/views/panes/market.rs +++ b/src/views/panes/market.rs @@ -4,13 +4,11 @@ use crate::{ api::Client, data::AppData, message::Message, - views::components::{ - better_btn::{GreenBtn, RedBtn}, - input::Inp, - }, + views::components::better_btn::{green_btn, red_btn}, ws::Websockets, }; +use iced::widget::button::text as btext; use iced::{ widget::{button, column, container, row, text, text_input, Space}, Alignment, Command, Element, Length, @@ -18,13 +16,13 @@ use iced::{ macro_rules! bbtn { ($e: expr) => { - button($e).style(iced::theme::Button::Text).padding(8) + button($e).style(btext).padding(8) }; } macro_rules! tin { ($e: expr, $b: expr) => { - text_input($e, $b).style(iced::theme::TextInput::Custom(Box::new(Inp {}))) + text_input($e, $b) }; } @@ -105,13 +103,13 @@ impl Market { .spacing(4.0) .width(300.0), row![ - button(tb("Buy").style(iced::Color::WHITE).size(12)) - .style(iced::theme::Button::Custom(Box::new(GreenBtn {}))) + button(tb("Buy").color(iced::Color::WHITE).size(12)) + .style(|_t, _s| green_btn()) .padding(8) .on_press(MarketPanelMessage::BuyPressed), Space::new(5.0, 0.0), - button(tb("Sell").style(iced::Color::WHITE).size(12)) - .style(iced::theme::Button::Custom(Box::new(RedBtn {}))) + button(tb("Sell").color(iced::Color::WHITE).size(12)) + .style(|_t, _s| red_btn()) .padding(8) .on_press(MarketPanelMessage::SellPressed) ], diff --git a/src/views/panes/mod.rs b/src/views/panes/mod.rs index ba1056d..05034e9 100644 --- a/src/views/panes/mod.rs +++ b/src/views/panes/mod.rs @@ -31,8 +31,8 @@ pub mod style { use iced::widget::container; use iced::{Color, Theme}; - pub fn pane_active(_: &Theme) -> container::Appearance { - container::Appearance { + pub fn pane_active(_: &Theme) -> container::Style { + container::Style { background: Some(iced::Background::Color(Color::from_rgb(0.07, 0.07, 0.07))), border: iced::Border { width: 0.0, @@ -43,10 +43,10 @@ pub mod style { } } - pub fn pane_focused(theme: &Theme) -> container::Appearance { + pub fn pane_focused(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); - container::Appearance { + container::Style { background: Some(iced::Background::Color(Color::from_rgb(0.07, 0.07, 0.07))), border: iced::Border { width: 0.0, diff --git a/src/views/panes/orders.rs b/src/views/panes/orders.rs index 23b1b0e..577005a 100644 --- a/src/views/panes/orders.rs +++ b/src/views/panes/orders.rs @@ -7,7 +7,7 @@ use crate::{ use binance::rest_model::{OrderSide, OrderType}; use iced::{ - widget::{column, container, row, text, Column, Space}, + widget::{column, container, row, scrollable, text, Column, Space}, Element, Font, Length, }; @@ -18,17 +18,18 @@ macro_rules! fill { } macro_rules! filled { ($($rs:expr),+) => { row![$($rs, fill![]),+] }; } -pub fn t<'a>(s: impl ToString) -> iced::widget::Text<'a> { - text(s).size(14).style(h2c("EEEEEE").unwrap()) +pub fn t<'a>(s: impl ToString + iced::widget::text::IntoFragment<'a>) -> iced::widget::Text<'a> { + text::Text::new(s).size(14).color(h2c("EEEEEE").unwrap()) } -pub fn tb<'a>(s: impl ToString) -> iced::widget::Text<'a> { + +pub fn tb<'a>(s: impl ToString + iced::widget::text::IntoFragment<'a>) -> iced::widget::Text<'a> { t(s).font(Font { family: iced::font::Family::Name("Iosevka"), weight: iced::font::Weight::Bold, ..Default::default() }) .size(14) - .style(h2c("808080").unwrap()) + .color(h2c("808080").unwrap()) } pub(crate) struct OrdersPane {} @@ -70,7 +71,7 @@ impl OrdersPane { let symbol_t = { let s = &b.symbol; - tb(s).style(h2c("11EE11").unwrap()) + tb(s).color(h2c("11EE11").unwrap()) } .width(Length::Fixed(100.0)); let [base, quote] = Client::split_symbol(&b.symbol).unwrap(); @@ -85,7 +86,7 @@ impl OrdersPane { .width(Length::Fixed(100.0)); let side_t = t(format!("{:?}", &b.side)) .width(Length::Fixed(100.0)) - .style( + .color( if b.side == OrderSide::Buy { h2c("11EE11") } else { @@ -107,7 +108,7 @@ impl OrdersPane { }; t(format!("{pnl_value:.0}$")) .width(Length::Fixed(100.0)) - .style( + .color( if pnl_value >= 0.0 { h2c("11EE11") } else { @@ -134,6 +135,6 @@ impl OrdersPane { .into() }); - column![header, Column::with_children(rows).padding(8)].into() + column![header, scrollable(Column::with_children(rows).padding(8))].into() } } diff --git a/src/views/panes/trades.rs b/src/views/panes/trades.rs index ea7702c..90a1d5d 100644 --- a/src/views/panes/trades.rs +++ b/src/views/panes/trades.rs @@ -40,10 +40,10 @@ impl TradesPane { }; container(row![ - t(&b.price).style(c).width(Length::Fill), - t(&b.qty).width(Length::Fill).style(h2c("B7BDB7").unwrap()), + t(&b.price).color(c).width(Length::Fill), + t(&b.qty).width(Length::Fill).color(h2c("B7BDB7").unwrap()), t(&b.trade_order_time_formatted) - .style(h2c("B7BDB7").unwrap()) + .color(h2c("B7BDB7").unwrap()) .width(Length::Fill), ]) .width(Length::Fill) diff --git a/src/views/panes/watchlist.rs b/src/views/panes/watchlist.rs index 0a63267..bc906aa 100644 --- a/src/views/panes/watchlist.rs +++ b/src/views/panes/watchlist.rs @@ -1,8 +1,8 @@ use crate::config::Config; use crate::data::{AppData, PriceFilter}; use crate::theme::h2c; +use crate::views::components::better_btn::unstyled_btn; use crate::views::components::loading::loader; -use crate::views::components::{better_btn::BetterBtn, input::Inp, unstyled_btn::UnstyledBtn}; use crate::views::dashboard::DashboardMessage; use iced::Command; use iced::{ @@ -20,14 +20,19 @@ pub(crate) enum WatchlistFilter { Alts, } +use crate::views::components::better_btn::better_btn; +use iced::widget::button::text as btext; + macro_rules! filter_button { ($label:expr, $filter:expr, $current_filter:expr) => { button($label) .padding(8) - .style(if $filter == $current_filter { - iced::theme::Button::Custom(Box::new(BetterBtn {})) - } else { - iced::theme::Button::Text + .style(|t, s| { + if $filter == $current_filter { + better_btn() + } else { + btext(t, s) + } }) .on_press(DashboardMessage::Watchlist(WatchlistMessage::ApplyFilter( $filter, @@ -36,19 +41,19 @@ macro_rules! filter_button { }; } -fn asset_button<'a>(n: &str, p: f32) -> Element<'a, DashboardMessage> { +fn asset_button(n: &str, p: f32) -> Element<'_, DashboardMessage> { container(row![ - button(tb(n).size(14).style(h2c("EFE1D1").unwrap())) + button(tb(n).size(14).color(h2c("EFE1D1").unwrap())) .on_press(DashboardMessage::CurrencyPairSelected(n.to_string())) - .style(iced::theme::Button::Custom(Box::new(UnstyledBtn {}))), + .style(|_t, _s| unstyled_btn()), Space::new(Length::Fill, 1.0), button( text(format!("{p} ")) .size(14) - .style(h2c("B7BDB76").unwrap()) + .color(h2c("B7BDB76").unwrap()) ) .on_press(DashboardMessage::CurrencyPairSelected(n.to_string())) - .style(iced::theme::Button::Custom(Box::new(UnstyledBtn {}))), + .style(|_t, _s| unstyled_btn()), ]) .width(Length::Fill) .into() @@ -88,11 +93,10 @@ impl WatchlistPane { filter_button!("BTC", WatchlistFilter::Btc, self.filter), filter_button!("ETH", WatchlistFilter::Eth, self.filter), filter_button!("ALTS", WatchlistFilter::Alts, self.filter), - text_input("type to filter", &self.filter_string) - .on_input(|i| WatchlistMessage::FilterInput(i).into()) - .style(iced::theme::TextInput::Custom(Box::new(Inp {}))) ] .spacing(2.0), + text_input("type to filter", &self.filter_string) + .on_input(|i| WatchlistMessage::FilterInput(i).into()), scrollable( Column::with_children( data.prices diff --git a/src/views/settings.rs b/src/views/settings.rs index 6dc7a38..6dff640 100644 --- a/src/views/settings.rs +++ b/src/views/settings.rs @@ -77,7 +77,7 @@ impl SettingsView { .height(Length::Fill) .align_items(iced::Alignment::Center), ) - .style(container::Appearance { + .style(|_t| container::Style { background: Some(iced::Background::Color(Color::from_rgb(0.07, 0.07, 0.07))), border: iced::Border { radius: 16.0.into(),