diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index ffc8b0c..f1b3ee8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.direnv /target packages packages/* diff --git a/Cargo.lock b/Cargo.lock index cb27206..9b49efb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,15 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -98,6 +107,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -148,7 +172,7 @@ checksum = "5fe233b960f12f8007e3db2d136e3cb1c291bfd7396e384ee76025fc1a3932b4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -182,12 +206,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "chrono" version = "0.4.23" @@ -294,6 +312,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "com-rs" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" + [[package]] name = "const_panic" version = "0.2.7" @@ -458,7 +482,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.107", ] [[package]] @@ -475,14 +499,14 @@ checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "d3d12" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759" +checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" dependencies = [ "bitflags", "libloading", @@ -510,7 +534,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.107", ] [[package]] @@ -521,7 +545,7 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -532,7 +556,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -652,7 +676,7 @@ checksum = "0f2f4de457d974f548d2c2a16f709ebd81013579e543bd1a9b19ced88132c2cf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -736,7 +760,7 @@ checksum = "c8469d0d40519bc608ec6863f1cc88f3f1deee15913f2f3b3e573d81ed38cccc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -830,7 +854,7 @@ checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -893,6 +917,12 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "glam" version = "0.21.3" @@ -901,9 +931,9 @@ checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815" [[package]] name = "glow" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" dependencies = [ "js-sys", "slotmap", @@ -969,6 +999,19 @@ dependencies = [ "bitflags", ] +[[package]] +name = "gpu-allocator" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +dependencies = [ + "backtrace", + "log", + "thiserror", + "winapi", + "windows", +] + [[package]] name = "gpu-descriptor" version = "0.2.3" @@ -1008,6 +1051,21 @@ dependencies = [ "ahash", ] +[[package]] +name = "hassle-rs" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85" +dependencies = [ + "bitflags", + "com-rs", + "libc", + "libloading", + "thiserror", + "widestring", + "winapi", +] + [[package]] name = "heck" version = "0.4.0" @@ -1061,9 +1119,9 @@ dependencies = [ [[package]] name = "iced" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df71e87f8211b57a439d0764131d2c421a9195036dd4b6608033b05f2f16c196" +checksum = "efbddf356d01e9d41cd394a9d04d62bfd89650a30f12fda5839cabb8c4591c88" dependencies = [ "iced_core", "iced_futures", @@ -1076,9 +1134,9 @@ dependencies = [ [[package]] name = "iced_aw" -version = "0.3.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a108808b3a5753ca85f460cffef776c33aa2e0dd557aab9261c7d2c60bbdb6d" +checksum = "b0068dfea60d5767a8e15d691c425c550a8e9e06b8d9cea559a26a3ccb4b6d77" dependencies = [ "iced_graphics", "iced_native", @@ -1087,9 +1145,9 @@ dependencies = [ [[package]] name = "iced_core" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ade666613eb8b621971a59cfae9e11ec051f32afc5ed4d8e8915d5abfaf2cee" +checksum = "11e1942e28dedee756cc27e67e7a838cdc1e59fb6bf9627ec9f709ab3b135782" dependencies = [ "bitflags", "instant", @@ -1098,9 +1156,9 @@ dependencies = [ [[package]] name = "iced_futures" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc3a9fd79b857228dde2a3e923a04ade4095abeda33248c6230e8c909749366" +checksum = "215d51fa4f70dbb63775d7141243c4d98d4d525d8949695601f8fbac7dcbc04e" dependencies = [ "futures", "log", @@ -1110,9 +1168,9 @@ dependencies = [ [[package]] name = "iced_graphics" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54177b85fdae36a8a1a4f052a5c65c5006565dc27f1feead13eeeed10fd0975a" +checksum = "338a6aff7db906537074ad0fe8b720cfdb9512cdfea43c628c76bd1cf50fdcc0" dependencies = [ "bitflags", "bytemuck", @@ -1126,23 +1184,24 @@ dependencies = [ [[package]] name = "iced_native" -version = "0.8.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d57c8e8672e90c55d4f9f55511b03e5a74af9d296be9693e9c07cd9eed4563" +checksum = "d012eb06da490fe46a695b39721c20da9643f35cf2ecb9d30618fdeb96170616" dependencies = [ "iced_core", "iced_futures", "iced_style", "num-traits", + "thiserror", "twox-hash", "unicode-segmentation", ] [[package]] name = "iced_style" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b992f5e1828c61af3661fc0e7bf141ef5284007a41fa6667c5e79d047a03daf4" +checksum = "0e37333dc2991201140302cd0d4cea051bd37ca3671d5008ec85df86d232ff30" dependencies = [ "iced_core", "once_cell", @@ -1151,9 +1210,9 @@ dependencies = [ [[package]] name = "iced_wgpu" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4bb296363d1b18d4f57e1c69bb19591405e61d47764e43078bba31c6689fca5" +checksum = "478803c56061f567ce5ddf223b20d11d3c118cc46bb0d0552370dc65cdc4cb9c" dependencies = [ "bitflags", "bytemuck", @@ -1172,9 +1231,9 @@ dependencies = [ [[package]] name = "iced_winit" -version = "0.7.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d528f882781c5594cb3d2416fe18787b4364e0cdd39f03d077ccc0becac1f9bd" +checksum = "8a59ea3a85149a6a1f9e92b6c740ce90f04e5c7d848cfd05742336863fceb955" dependencies = [ "iced_futures", "iced_graphics", @@ -1229,9 +1288,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -1421,9 +1480,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707" +checksum = "6c3d4269bcb7d50121097702fde1afb75f4ea8083aeb7a55688dcf289a853271" dependencies = [ "bit-set", "bitflags", @@ -1505,7 +1564,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1612,7 +1671,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1654,6 +1713,15 @@ dependencies = [ "objc", ] +[[package]] +name = "object" +version = "0.30.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.17.0" @@ -1708,7 +1776,7 @@ dependencies = [ "find-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1795,7 +1863,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1856,9 +1924,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1871,9 +1939,9 @@ checksum = "74605f360ce573babfe43964cbe520294dcb081afbf8c108fc6e23036b4da2df" [[package]] name = "quote" -version = "1.0.23" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -1990,6 +2058,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -2074,7 +2148,7 @@ checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2237,7 +2311,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.107", ] [[package]] @@ -2257,6 +2331,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "termcolor" version = "1.2.0" @@ -2283,7 +2368,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2427,9 +2512,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2437,24 +2522,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.27", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -2464,9 +2549,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2474,22 +2559,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-timer" @@ -2581,9 +2666,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -2601,15 +2686,17 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.14.2" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f643110d228fd62a60c5ed2ab56c4d5b3704520bd50561174ec4ec74932937" +checksum = "d745a1b6d91d85c33defbb29f0eee0450e1d2614d987e14bf6baf26009d132d7" dependencies = [ "arrayvec 0.7.2", + "cfg-if", "js-sys", "log", "naga", "parking_lot 0.12.1", + "profiling", "raw-window-handle 0.5.0", "smallvec", "static_assertions", @@ -2623,14 +2710,13 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.14.2" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6000d1284ef8eec6076fd5544a73125fd7eb9b635f18dceeb829d826f41724ca" +checksum = "7131408d940e335792645a98f03639573b0480e9e2e7cddbbab74f7c6d9f3fff" dependencies = [ "arrayvec 0.7.2", "bit-vec", "bitflags", - "cfg_aliases", "codespan-reporting", "fxhash", "log", @@ -2647,9 +2733,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.14.1" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc320a61acb26be4f549c9b1b53405c10a223fbfea363ec39474c32c348d12f" +checksum = "bdcf61a283adc744bb5453dd88ea91f3f86d5ca6b027661c6c73c7734ae0288b" dependencies = [ "android_system_properties", "arrayvec 0.7.2", @@ -2663,9 +2749,12 @@ dependencies = [ "fxhash", "glow", "gpu-alloc", + "gpu-allocator", "gpu-descriptor", + "hassle-rs", "js-sys", "khronos-egl", + "libc", "libloading", "log", "metal", @@ -2686,18 +2775,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.14.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb6b28ef22cac17b9109b25b3bf8c9a103eeb293d7c5f78653979b09140375f6" +checksum = "32444e121b0bd00cb02c0de32fde457a9491bd44e03e7a5db6df9b1da2f6f110" dependencies = [ "bitflags", + "js-sys", + "web-sys", ] [[package]] name = "wgpu_glyph" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cafb82773e0f124a33674dab5de4dff73175aeb921949047ab014efb58fb446" +checksum = "e25440d5f32ec39de49c57c15c2d3f9133a7939b069b5ad07e5afd8b78fb8adc" dependencies = [ "bytemuck", "glyph_brush", @@ -2716,6 +2807,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + [[package]] name = "winapi" version = "0.3.9" @@ -2770,6 +2867,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "windows" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.36.1" @@ -2790,19 +2896,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.42.2", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" @@ -2812,9 +2933,9 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" @@ -2824,9 +2945,9 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" @@ -2836,9 +2957,9 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" @@ -2848,15 +2969,15 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" @@ -2866,9 +2987,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winit" diff --git a/Cargo.toml b/Cargo.toml index 4858291..2bed5e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,9 @@ authors = ["Salman"] anyhow = "1.0.65" chrono = "0.4.23" dirs = "4.0.0" -iced = "0.7.0" -iced_aw = { version = "0.3.0", features = ["tabs", "modal", "card"], default-features = false } -iced_native = "0.8.0" +iced = { version = "0.9.0" } +iced_aw = { version = "0.5.0", features = ["tabs", "modal", "card"], default-features = false } +iced_native = "0.10.0" log = "0.4.17" log4rs = "1.2.0" native-dialog = "0.6.3" diff --git a/flake.lock b/flake.lock index ef14b59..6432723 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", "owner": "numtide", "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", "type": "github" }, "original": { @@ -17,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1679553901, - "narHash": "sha256-OhmJc18XNIj0wVC4ZoPnCVoY3SGfcPxaeKJOz1WHo5M=", + "lastModified": 1690083312, + "narHash": "sha256-I3egwgNXavad1eIjWu1kYyi0u73di/sMmlnQIuzQASk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "09ad6a72359f6aff0f96ce8e4d1ec2d1271ad15d", + "rev": "af8cd5ded7735ca1df1a1174864daab75feeb64a", "type": "github" }, "original": { @@ -36,6 +39,21 @@ "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 3c1ef8b..60baebe 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,6 @@ }; outputs = { - self, nixpkgs, flake-utils, ... @@ -16,25 +15,44 @@ let rustOverlay = builtins.fetchTarball { url = "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"; - sha256 = "0vzbfcn291hp2ksw4anrddqhqsz75ydwzc2z2gswv695m58yl862"; + sha256 = "1cr3ph1ww4scgw3hdhnag2qpqx36xplvlsjwa3z6rmrf424zqx9z"; }; pkgs = import nixpkgs { inherit system; overlays = [ (import rustOverlay) ]; }; + libPath = with pkgs; lib.makeLibraryPath [ + libGL + bzip2 + fontconfig + freetype + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXi + ]; in with pkgs; { devShell = mkShell rec { - buildInputs = [ + packages = [ rust-bin.stable.latest.default rust-analyzer + ]; + nativeBuildInputs = with pkgs; [ + glibc + pkg-config cmake + mesa + makeWrapper + ]; + + buildInputs = with pkgs; [ fontconfig - pkg-config + freetype - # vulkan-headers + vulkan-headers vulkan-loader + libGL - # libxkbcommon - + libxkbcommon # WINIT_UNIX_BACKEND=wayland - # wayland + wayland # WINIT_UNIX_BACKEND=x11 xorg.libXcursor @@ -42,7 +60,7 @@ xorg.libXi xorg.libX11 ]; - LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; + LD_LIBRARY_PATH = "${libPath}"; }; }); } diff --git a/src/lib.rs b/src/lib.rs index f4757d3..b72e7be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,6 +45,7 @@ const SPACING: u16 = 10; #[derive(Debug, Clone)] pub enum Message { + None, InputChanged(String), TogglePlaylist(bool), SelectedVideoFormat(VideoFormat), @@ -336,6 +337,7 @@ impl Application for YtGUI { String::from("Playlist box needs to be checked to download a playlist"); return iced::Command::none(); } + info!("{progress}"); } Message::Ready(sender) => { @@ -353,6 +355,7 @@ impl Application for YtGUI { )); } } + Message::None => {} } iced::Command::none() @@ -362,7 +365,8 @@ impl Application for YtGUI { let content: widgets::Element = column![ row![ text("Enter URL: "), - text_input("Download link", &self.download_link, Message::InputChanged,) + text_input("Download link", &self.download_link) + .on_input(Message::InputChanged) .size(FONT_SIZE) .width(Length::Fill), checkbox("Playlist", self.is_playlist, Message::TogglePlaylist) @@ -386,10 +390,9 @@ impl Application for YtGUI { ], ) .height(Length::Shrink) - .width(Length::Units(1)) - .tab_bar_width(Length::Units(1)), + .width(Length::FillPortion(1)) + .tab_bar_width(Length::FillPortion(1)), row![ - button("Browse").on_press(Message::SelectFolder), text_input( "", self.config @@ -397,18 +400,21 @@ impl Application for YtGUI { .clone() .unwrap_or_else(|| "~/Videos".into()) .to_str() - .unwrap(), - Message::SelectFolderTextInput, - ), - button(text("Download")).on_press(Message::Command(command::Message::Run( - self.download_link.clone(), - ))), + .expect("download folder as str"), + ) + .on_input(Message::SelectFolderTextInput), + button("Browse").on_press(Message::SelectFolder), ] .spacing(SPACING) .align_items(iced::Alignment::Center), + row![ + button("Download").on_press(Message::Command(command::Message::Run( + self.download_link.clone(), + ))), + ] ] .width(Length::Fill) - .align_items(iced::Alignment::Fill) + .align_items(iced::Alignment::Center) .spacing(20) .padding(20) .into(); @@ -427,8 +433,8 @@ impl Application for YtGUI { .align_items(iced::Alignment::Center), ) .width(Length::Fill) - .max_height(70) - .max_width(300) + .max_height(70.) + .max_width(300.) .on_close(Message::Command(command::Message::Stop)) .into() }); @@ -473,5 +479,5 @@ pub fn setup_logger() { ) .expect("logger config"); - log4rs::init_config(config).unwrap(); + log4rs::init_config(config).expect("Initialize logging config"); } diff --git a/src/main.rs b/src/main.rs index f74bbda..db15ded 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,9 +33,9 @@ fn main() -> iced::Result { let config = toml::from_str::(&config_file).expect("Deserialize config file"); let settings = Settings { - id: Some("ytdlp-gui".to_string()), + id: Some(String::from("ytdlp-gui")), window: window::Settings { - size: (600, 275), + size: (600, 320), resizable: false, ..Default::default() }, diff --git a/src/media_options.rs b/src/media_options.rs index 8fa7e4d..ceb4900 100644 --- a/src/media_options.rs +++ b/src/media_options.rs @@ -1,8 +1,7 @@ use std::path::PathBuf; -use iced::widget::{radio, row, text}; +use iced::widget::{pick_list, row, text}; use serde::{Deserialize, Serialize}; -use strum::Display; use crate::{widgets, Message, FONT_SIZE, SPACING}; @@ -24,6 +23,18 @@ pub enum VideoResolution { Sd, } +impl core::fmt::Display for VideoResolution { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + VideoResolution::FourK => write!(f, "4K"), + VideoResolution::TwoK => write!(f, "1440p"), + VideoResolution::FullHD => write!(f, "1080p"), + VideoResolution::Hd => write!(f, "720p"), + VideoResolution::Sd => write!(f, "480p"), + } + } +} + #[derive(Deserialize, Serialize, Default, Debug, Copy, Clone, PartialEq, Eq)] pub enum VideoFormat { #[default] @@ -33,7 +44,17 @@ pub enum VideoFormat { // Flv, } -#[derive(Deserialize, Serialize, Display, Default, Debug, Copy, Clone, PartialEq, Eq)] +impl core::fmt::Display for VideoFormat { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + VideoFormat::Mp4 => write!(f, "MP4"), + VideoFormat::Mkv => write!(f, "MKV"), + VideoFormat::Webm => write!(f, "WEBM"), + } + } +} + +#[derive(Deserialize, Serialize, Default, Debug, Copy, Clone, PartialEq, Eq)] pub enum AudioQuality { Best, #[default] @@ -42,7 +63,18 @@ pub enum AudioQuality { Low, } -#[derive(Deserialize, Serialize, Display, Default, Debug, Copy, Clone, PartialEq, Eq)] +impl core::fmt::Display for AudioQuality { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + AudioQuality::Best => write!(f, "Best"), + AudioQuality::Good => write!(f, "Good"), + AudioQuality::Medium => write!(f, "Medium"), + AudioQuality::Low => write!(f, "Low"), + } + } +} + +#[derive(Deserialize, Serialize, Default, Debug, Copy, Clone, PartialEq, Eq)] pub enum AudioFormat { #[default] Mp3, @@ -52,6 +84,18 @@ pub enum AudioFormat { Opus, } +impl core::fmt::Display for AudioFormat { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + AudioFormat::Mp3 => write!(f, "MP3"), + AudioFormat::Wav => write!(f, "WAV"), + AudioFormat::Vorbis => write!(f, "VORBIS"), + AudioFormat::M4a => write!(f, "M4A"), + AudioFormat::Opus => write!(f, "OPUS"), + } + } +} + impl VideoResolution { pub fn options(&self) -> &str { match self { @@ -75,14 +119,6 @@ impl VideoFormat { } impl AudioFormat { - const ALL: [AudioFormat; 5] = [ - AudioFormat::Mp3, - AudioFormat::Wav, - AudioFormat::Vorbis, - AudioFormat::Opus, - AudioFormat::M4a, - ]; - pub fn options(&self) -> String { match self { AudioFormat::Mp3 => String::from("mp3"), @@ -95,13 +131,6 @@ impl AudioFormat { } impl AudioQuality { - const ALL: [AudioQuality; 4] = [ - AudioQuality::Best, - AudioQuality::Good, - AudioQuality::Medium, - AudioQuality::Low, - ]; - pub fn options(&self) -> String { match self { AudioQuality::Best => String::from("0"), @@ -112,51 +141,21 @@ impl AudioQuality { } } -const RADIO_DOT_SIZE: u16 = 15; - impl Options { pub fn video_resolutions(resolution: VideoResolution) -> widgets::Row<'static, Message> { row![ text("Resolution: ").size(FONT_SIZE), - radio( - "4K", - VideoResolution::FourK, + pick_list( + vec![ + VideoResolution::FourK, + VideoResolution::TwoK, + VideoResolution::FullHD, + VideoResolution::Hd, + VideoResolution::Sd + ], Some(resolution), - Message::SelectedResolution, + Message::SelectedResolution ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - radio( - "1440p", - VideoResolution::TwoK, - Some(resolution), - Message::SelectedResolution, - ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - radio( - "1080p", - VideoResolution::FullHD, - Some(resolution), - Message::SelectedResolution, - ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - radio( - "720p", - VideoResolution::Hd, - Some(resolution), - Message::SelectedResolution, - ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - radio( - "480p", - VideoResolution::Sd, - Some(resolution), - Message::SelectedResolution, - ) - .size(RADIO_DOT_SIZE) .text_size(FONT_SIZE), ] .spacing(SPACING) @@ -168,31 +167,14 @@ impl Options { pub fn video_formats(format: VideoFormat) -> widgets::Row<'static, Message> { row![ text("Preferred Format: ").size(FONT_SIZE), - radio( - "MP4", - VideoFormat::Mp4, + pick_list( + vec![VideoFormat::Mp4, VideoFormat::Mkv, VideoFormat::Webm], Some(format), - Message::SelectedVideoFormat, + Message::SelectedVideoFormat ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - radio( - "WEBM", - VideoFormat::Webm, - Some(format), - Message::SelectedVideoFormat, - ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - radio( - "MKV", - VideoFormat::Mkv, - Some(format), - Message::SelectedVideoFormat, - ) - .size(RADIO_DOT_SIZE) .text_size(FONT_SIZE), ] + .width(iced::Length::Fill) .spacing(SPACING) .align_items(iced::Alignment::Center) .padding(12) @@ -201,23 +183,20 @@ impl Options { pub fn audio_formats(format: AudioFormat) -> widgets::Row<'static, Message> { row![ text("Preferred Format: ").size(FONT_SIZE), - AudioFormat::ALL - .iter() - .cloned() - .fold(row![], |row, audio_format| { - row.push( - radio( - audio_format.to_string().to_ascii_uppercase(), - audio_format, - Some(format), - Message::SelectedAudioFormat, - ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - ) - .spacing(SPACING) - }), + pick_list( + vec![ + AudioFormat::Mp3, + AudioFormat::Wav, + AudioFormat::Vorbis, + AudioFormat::M4a, + AudioFormat::Opus, + ], + Some(format), + Message::SelectedAudioFormat + ) + .text_size(FONT_SIZE), ] + .width(iced::Length::Fill) .spacing(SPACING) .align_items(iced::Alignment::Center) .padding(12) @@ -226,23 +205,19 @@ impl Options { pub fn audio_qualities(quality: AudioQuality) -> widgets::Row<'static, Message> { row![ text("Quality: ").size(FONT_SIZE), - AudioQuality::ALL - .iter() - .cloned() - .fold(row![], |row, audio_quality| { - row.push( - radio( - audio_quality.to_string(), - audio_quality, - Some(quality), - Message::SelectedAudioQuality, - ) - .size(RADIO_DOT_SIZE) - .text_size(FONT_SIZE), - ) - .spacing(SPACING) - }), + pick_list( + vec![ + AudioQuality::Best, + AudioQuality::Good, + AudioQuality::Medium, + AudioQuality::Low, + ], + Some(quality), + Message::SelectedAudioQuality + ) + .text_size(FONT_SIZE) ] + .width(iced::Length::Fill) .spacing(SPACING) .align_items(iced::Alignment::Center) .padding(12) diff --git a/src/progress.rs b/src/progress.rs index e7c4b2e..4442f61 100644 --- a/src/progress.rs +++ b/src/progress.rs @@ -19,25 +19,25 @@ pub fn bind() -> Subscription { ProgressState::Starting => { let (sender, receiver) = mpsc::unbounded(); - (Some(Message::Ready(sender)), ProgressState::Ready(receiver)) + (Message::Ready(sender), ProgressState::Ready(receiver)) } ProgressState::Ready(mut progress_receiver) => { let received = progress_receiver.next().await; if let Some(progress) = received { if progress.contains("Finished") { return ( - Some(Message::Command(command::Message::Finished)), + Message::Command(command::Message::Finished), ProgressState::Ready(progress_receiver), ); } return ( - Some(Message::ProgressEvent(progress)), + Message::ProgressEvent(progress), ProgressState::Ready(progress_receiver), ); } - (None, ProgressState::Ready(progress_receiver)) + (Message::None, ProgressState::Ready(progress_receiver)) } } }, diff --git a/src/theme.rs b/src/theme.rs index 337bdf7..ba90bda 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -1,6 +1,10 @@ -use iced::widget::{button, checkbox, container, progress_bar, radio, text, text_input}; +use iced::overlay::menu; +use iced::widget::{ + button, checkbox, container, pick_list, progress_bar, radio, scrollable, text, text_input, +}; use iced::{application, theme, Color}; use iced_aw::{modal, style::card, tabs}; +use iced_native::Background; #[derive(Debug, Clone, Copy, Default)] pub struct Theme; @@ -11,6 +15,14 @@ const SURFACE: Color = Color::from_rgb( 0x4B as f32 / 255.0, ); +const DISABLED: Color = Color::from_rgb( + 0x30 as f32 / 255.0, + 0x34 as f32 / 255.0, + 0x3B as f32 / 255.0, +); + +const PLACEHOLDER: Color = Color::from_rgb(0.4, 0.4, 0.4); + const ACCENT: Color = Color::from_rgb( 0x6F as f32 / 255.0, 0xFF as f32 / 255.0, @@ -181,6 +193,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 0.0, border_color: Color::TRANSPARENT, + icon_color: Color::TRANSPARENT, } } @@ -193,7 +206,7 @@ impl text_input::StyleSheet for Theme { } fn placeholder_color(&self, _style: &Self::Style) -> Color { - Color::from_rgb(0.4, 0.4, 0.4) + PLACEHOLDER } fn value_color(&self, _style: &Self::Style) -> Color { @@ -203,6 +216,16 @@ impl text_input::StyleSheet for Theme { fn selection_color(&self, _style: &Self::Style) -> Color { ACTIVE } + + fn disabled_color(&self, _style: &Self::Style) -> Color { + DISABLED + } + + fn disabled(&self, style: &Self::Style) -> text_input::Appearance { + text_input::Appearance { + ..self.active(style) + } + } } impl button::StyleSheet for Theme { @@ -252,11 +275,11 @@ impl checkbox::StyleSheet for Theme { fn active(&self, _style: &Self::Style, is_checked: bool) -> checkbox::Appearance { checkbox::Appearance { background: if is_checked { ACTIVE } else { SURFACE }.into(), - checkmark_color: Color::WHITE, border_radius: 2.0, border_width: 1.0, border_color: ACTIVE, text_color: None, + icon_color: Color::WHITE, } } @@ -271,3 +294,83 @@ impl checkbox::StyleSheet for Theme { } } } + +impl pick_list::StyleSheet for Theme { + type Style = (); + + fn active(&self, _style: &::Style) -> pick_list::Appearance { + pick_list::Appearance { + text_color: Color::WHITE, + placeholder_color: PLACEHOLDER, + handle_color: Color::WHITE, + background: Background::Color(SURFACE), + border_radius: 2.0, + border_width: 0.0, + border_color: Color::TRANSPARENT, + } + } + + fn hovered(&self, style: &::Style) -> pick_list::Appearance { + pick_list::Appearance { + border_color: HOVERED, + background: Background::Color(HOVERED), + ..self.active(style) + } + } +} + +impl scrollable::StyleSheet for Theme { + type Style = (); + + fn active(&self, _style: &Self::Style) -> scrollable::Scrollbar { + scrollable::Scrollbar { + background: None, + border_radius: 2., + border_width: 0., + border_color: Color::TRANSPARENT, + scroller: scrollable::Scroller { + color: ACCENT, + border_radius: 0., + border_width: 0., + border_color: Color::TRANSPARENT, + }, + } + } + + fn hovered(&self, style: &Self::Style, is_mouse_over_scrollbar: bool) -> scrollable::Scrollbar { + if is_mouse_over_scrollbar { + scrollable::Scrollbar { + scroller: scrollable::Scroller { + color: HOVERED, + border_width: 1., + ..self.active(style).scroller + }, + ..self.active(style) + } + } else { + scrollable::Scrollbar { + scroller: scrollable::Scroller { + color: HOVERED, + ..self.active(style).scroller + }, + ..self.active(style) + } + } + } +} + +impl menu::StyleSheet for Theme { + type Style = (); + + fn appearance(&self, _style: &Self::Style) -> menu::Appearance { + menu::Appearance { + text_color: Color::WHITE, + background: Background::Color(ACCENT), + border_width: 0., + border_radius: 0., + border_color: Color::TRANSPARENT, + selected_text_color: Color::BLACK, + selected_background: Background::Color(ACTIVE), + } + } +}