mirror of
https://github.com/Death916/deathclock.git
synced 2026-04-10 03:04:40 -07:00
add first subscriptions and move image handle creation out of view
This commit is contained in:
parent
618d947f37
commit
6f4570eb5e
4 changed files with 145 additions and 130 deletions
187
rustclock/Cargo.lock
generated
187
rustclock/Cargo.lock
generated
|
|
@ -549,9 +549,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.56"
|
||||
version = "1.2.57"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2"
|
||||
checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423"
|
||||
dependencies = [
|
||||
"find-msvc-tools",
|
||||
"jobserver",
|
||||
|
|
@ -1715,6 +1715,7 @@ dependencies = [
|
|||
"iced_core",
|
||||
"log",
|
||||
"rustc-hash 2.1.1",
|
||||
"tokio",
|
||||
"wasm-bindgen-futures",
|
||||
"wasmtimer",
|
||||
]
|
||||
|
|
@ -1956,9 +1957,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "image"
|
||||
version = "0.25.9"
|
||||
version = "0.25.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a"
|
||||
checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"byteorder-lite",
|
||||
|
|
@ -1974,8 +1975,8 @@ dependencies = [
|
|||
"rayon",
|
||||
"rgb",
|
||||
"tiff",
|
||||
"zune-core 0.5.1",
|
||||
"zune-jpeg 0.5.12",
|
||||
"zune-core",
|
||||
"zune-jpeg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2140,9 +2141,9 @@ checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.182"
|
||||
version = "0.2.183"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112"
|
||||
checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
|
||||
|
||||
[[package]]
|
||||
name = "libfuzzer-sys"
|
||||
|
|
@ -2344,9 +2345,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "moxcms"
|
||||
version = "0.7.11"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97"
|
||||
checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
"pxfm",
|
||||
|
|
@ -2513,9 +2514,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "num_enum"
|
||||
version = "0.7.5"
|
||||
version = "0.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c"
|
||||
checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26"
|
||||
dependencies = [
|
||||
"num_enum_derive",
|
||||
"rustversion",
|
||||
|
|
@ -2523,9 +2524,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "num_enum_derive"
|
||||
version = "0.7.5"
|
||||
version = "0.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7"
|
||||
checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8"
|
||||
dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
|
|
@ -2894,9 +2895,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.21.3"
|
||||
version = "1.21.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
||||
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
||||
|
||||
[[package]]
|
||||
name = "openssl-probe"
|
||||
|
|
@ -2906,9 +2907,9 @@ checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
|
|||
|
||||
[[package]]
|
||||
name = "orbclient"
|
||||
version = "0.3.50"
|
||||
version = "0.3.51"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "52ad2c6bae700b7aa5d1cc30c59bdd3a1c180b09dbaea51e2ae2b8e1cf211fdd"
|
||||
checksum = "59aed3b33578edcfa1bc96a321d590d31832b6ad55a26f0313362ce687e9abd6"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"libredox",
|
||||
|
|
@ -3079,9 +3080,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|||
|
||||
[[package]]
|
||||
name = "portable-atomic-util"
|
||||
version = "0.2.5"
|
||||
version = "0.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5"
|
||||
checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3"
|
||||
dependencies = [
|
||||
"portable-atomic",
|
||||
]
|
||||
|
|
@ -3180,9 +3181,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
|
|||
|
||||
[[package]]
|
||||
name = "quick-xml"
|
||||
version = "0.38.4"
|
||||
version = "0.39.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c"
|
||||
checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
|
@ -3209,9 +3210,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "quinn-proto"
|
||||
version = "0.11.13"
|
||||
version = "0.11.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
|
||||
checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"bytes",
|
||||
|
|
@ -3342,9 +3343,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ravif"
|
||||
version = "0.12.0"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef69c1990ceef18a116855938e74793a5f7496ee907562bd0857b6ac734ab285"
|
||||
checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45"
|
||||
dependencies = [
|
||||
"avif-serialize",
|
||||
"imgref",
|
||||
|
|
@ -3634,9 +3635,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
version = "0.1.28"
|
||||
version = "0.1.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
|
||||
checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
|
@ -3891,12 +3892,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.6.2"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0"
|
||||
checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4043,9 +4044,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.26.0"
|
||||
version = "3.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82a72c767771b47409d2345987fda8628641887d5466101319899796367354a0"
|
||||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.4.2",
|
||||
|
|
@ -4105,16 +4106,16 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tiff"
|
||||
version = "0.10.3"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f"
|
||||
checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"
|
||||
dependencies = [
|
||||
"fax",
|
||||
"flate2",
|
||||
"half",
|
||||
"quick-error",
|
||||
"weezl",
|
||||
"zune-jpeg 0.4.21",
|
||||
"zune-jpeg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4167,9 +4168,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.10.0"
|
||||
version = "1.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
|
||||
checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3"
|
||||
dependencies = [
|
||||
"tinyvec_macros",
|
||||
]
|
||||
|
|
@ -4219,32 +4220,32 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "toml_datetime"
|
||||
version = "1.0.0+spec-1.1.0"
|
||||
version = "1.0.1+spec-1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32c2555c699578a4f59f0cc68e5116c8d7cabbd45e1409b989d4be085b53f13e"
|
||||
checksum = "9b320e741db58cac564e26c607d3cc1fdc4a88fd36c879568c07856ed83ff3e9"
|
||||
dependencies = [
|
||||
"serde_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.25.3+spec-1.1.0"
|
||||
version = "0.25.5+spec-1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a0a07913e63758bc95142d9863a5a45173b71515e68b690cad70cf99c3255ce1"
|
||||
checksum = "8ca1a40644a28bce036923f6a431df0b34236949d111cc07cb6dca830c9ef2e1"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"toml_datetime",
|
||||
"toml_parser",
|
||||
"winnow",
|
||||
"winnow 1.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_parser"
|
||||
version = "1.0.9+spec-1.1.0"
|
||||
version = "1.0.10+spec-1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "702d4415e08923e7e1ef96cd5727c0dfed80b4d2fa25db9647fe5eb6f7c5a4c4"
|
||||
checksum = "7df25b4befd31c4816df190124375d5a20c6b6921e2cad937316de3fccd63420"
|
||||
dependencies = [
|
||||
"winnow",
|
||||
"winnow 1.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4341,9 +4342,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "uds_windows"
|
||||
version = "1.2.0"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51b70b87d15e91f553711b40df3048faf27a7a04e01e0ddc0cf9309f0af7c2ca"
|
||||
checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
|
||||
dependencies = [
|
||||
"memoffset",
|
||||
"tempfile",
|
||||
|
|
@ -4453,9 +4454,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
|
|||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.21.0"
|
||||
version = "1.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb"
|
||||
checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"serde_core",
|
||||
|
|
@ -4631,9 +4632,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-backend"
|
||||
version = "0.3.12"
|
||||
version = "0.3.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9"
|
||||
checksum = "aa75f400b7f719bcd68b3f47cd939ba654cedeef690f486db71331eec4c6a406"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"downcast-rs",
|
||||
|
|
@ -4645,9 +4646,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-client"
|
||||
version = "0.31.12"
|
||||
version = "0.31.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec"
|
||||
checksum = "ab51d9f7c071abeee76007e2b742499e535148035bb835f97aaed1338cf516c3"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"rustix 1.1.4",
|
||||
|
|
@ -4668,9 +4669,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-cursor"
|
||||
version = "0.31.12"
|
||||
version = "0.31.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078"
|
||||
checksum = "4b3298683470fbdc6ca40151dfc48c8f2fd4c41a26e13042f801f85002384091"
|
||||
dependencies = [
|
||||
"rustix 1.1.4",
|
||||
"wayland-client",
|
||||
|
|
@ -4679,9 +4680,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-protocols"
|
||||
version = "0.32.10"
|
||||
version = "0.32.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3"
|
||||
checksum = "b23b5df31ceff1328f06ac607591d5ba360cf58f90c8fad4ac8d3a55a3c4aec7"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"wayland-backend",
|
||||
|
|
@ -4704,9 +4705,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-protocols-misc"
|
||||
version = "0.3.10"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "791c58fdeec5406aa37169dd815327d1e47f334219b523444bc26d70ceb4c34e"
|
||||
checksum = "429b99200febaf95d4f4e46deff6fe4382bcff3280ee16a41cf887b3c3364984"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"wayland-backend",
|
||||
|
|
@ -4717,9 +4718,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-protocols-plasma"
|
||||
version = "0.3.10"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b"
|
||||
checksum = "d392fc283a87774afc9beefcd6f931582bb97fe0e6ced0b306a62cb1d026527c"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"wayland-backend",
|
||||
|
|
@ -4730,9 +4731,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-protocols-wlr"
|
||||
version = "0.3.10"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3"
|
||||
checksum = "78248e4cc0eff8163370ba5c158630dcae1f3497a586b826eca2ef5f348d6235"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"wayland-backend",
|
||||
|
|
@ -4743,9 +4744,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-scanner"
|
||||
version = "0.31.8"
|
||||
version = "0.31.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5423e94b6a63e68e439803a3e153a9252d5ead12fd853334e2ad33997e3889e3"
|
||||
checksum = "c86287151a309799b821ca709b7345a048a2956af05957c89cb824ab919fa4e3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quick-xml",
|
||||
|
|
@ -4754,9 +4755,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wayland-sys"
|
||||
version = "0.31.8"
|
||||
version = "0.31.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e6dbfc3ac5ef974c92a2235805cc0114033018ae1290a72e474aa8b28cbbdfd"
|
||||
checksum = "374f6b70e8e0d6bf9461a32988fd553b59ff630964924dad6e4a4eb6bd538d17"
|
||||
dependencies = [
|
||||
"dlib",
|
||||
"log",
|
||||
|
|
@ -5452,9 +5453,18 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.7.14"
|
||||
version = "0.7.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
|
||||
checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
|
@ -5680,7 +5690,7 @@ dependencies = [
|
|||
"uds_windows",
|
||||
"uuid",
|
||||
"windows-sys 0.61.2",
|
||||
"winnow",
|
||||
"winnow 0.7.15",
|
||||
"zbus_macros",
|
||||
"zbus_names",
|
||||
"zvariant",
|
||||
|
|
@ -5708,7 +5718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"winnow",
|
||||
"winnow 0.7.15",
|
||||
"zvariant",
|
||||
]
|
||||
|
||||
|
|
@ -5720,18 +5730,18 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524"
|
|||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.40"
|
||||
version = "0.8.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a789c6e490b576db9f7e6b6d661bcc9799f7c0ac8352f56ea20193b2681532e5"
|
||||
checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.40"
|
||||
version = "0.8.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f65c489a7071a749c849713807783f70672b28094011623e200cb86dcb835953"
|
||||
checksum = "7e6cc098ea4d3bd6246687de65af3f920c430e236bee1e3bf2e441463f08a02f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -5804,12 +5814,6 @@ version = "1.0.21"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
||||
|
||||
[[package]]
|
||||
name = "zune-core"
|
||||
version = "0.4.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a"
|
||||
|
||||
[[package]]
|
||||
name = "zune-core"
|
||||
version = "0.5.1"
|
||||
|
|
@ -5827,20 +5831,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "zune-jpeg"
|
||||
version = "0.4.21"
|
||||
version = "0.5.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713"
|
||||
checksum = "ec5f41c76397b7da451efd19915684f727d7e1d516384ca6bd0ec43ec94de23c"
|
||||
dependencies = [
|
||||
"zune-core 0.4.12",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zune-jpeg"
|
||||
version = "0.5.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "410e9ecef634c709e3831c2cfdb8d9c32164fae1c67496d5b68fff728eec37fe"
|
||||
dependencies = [
|
||||
"zune-core 0.5.1",
|
||||
"zune-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5852,7 +5847,7 @@ dependencies = [
|
|||
"endi",
|
||||
"enumflags2",
|
||||
"serde",
|
||||
"winnow",
|
||||
"winnow 0.7.15",
|
||||
"zvariant_derive",
|
||||
"zvariant_utils",
|
||||
]
|
||||
|
|
@ -5880,5 +5875,5 @@ dependencies = [
|
|||
"quote",
|
||||
"serde",
|
||||
"syn",
|
||||
"winnow",
|
||||
"winnow 0.7.15",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ edition = "2024"
|
|||
|
||||
[dependencies]
|
||||
chrono = "0.4.44"
|
||||
iced = { version = "0.14.0", features = ["image"] }
|
||||
iced = { version = "0.14.0", features = ["image", "tokio"] }
|
||||
reqwest = "0.13.2"
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
serde_json = "1.0.149"
|
||||
|
|
|
|||
|
|
@ -3,13 +3,19 @@ mod panes;
|
|||
mod sports;
|
||||
use chrono::{DateTime, Local};
|
||||
use iced::Element;
|
||||
use iced::Subscription;
|
||||
use iced::Task;
|
||||
use iced::application;
|
||||
use iced::time;
|
||||
use iced::time::Duration;
|
||||
use iced::widget::image;
|
||||
use iced::widget::image::Handle;
|
||||
use iced::widget::pane_grid;
|
||||
use iced::widget::pane_grid::Configuration;
|
||||
use sports::Game;
|
||||
use std::collections::HashMap;
|
||||
use tokio::time::{Duration, sleep};
|
||||
|
||||
const CLOCK_UPDATE_TIME_MS: u64 = 1500;
|
||||
const UPDATE_SPORTS_TIME_MINS: u64 = 3;
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
iced::application(
|
||||
|
|
@ -18,6 +24,7 @@ pub fn main() -> iced::Result {
|
|||
RustClock::view,
|
||||
)
|
||||
.title("RustClock")
|
||||
.subscription(RustClock::subscription)
|
||||
.run()
|
||||
}
|
||||
|
||||
|
|
@ -36,6 +43,7 @@ enum Message {
|
|||
PaneDragged(pane_grid::DragEvent),
|
||||
PaneResized(pane_grid::ResizeEvent),
|
||||
RunSportsUpdate,
|
||||
UpdateTime,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -47,10 +55,10 @@ struct RustClock {
|
|||
location: String,
|
||||
nba_scores: Vec<Game>,
|
||||
mlb_scores: Vec<Game>,
|
||||
// nfl_scores: Vec<Game>,
|
||||
panes: pane_grid::State<PaneType>,
|
||||
nba_logos: HashMap<String, Vec<u8>>,
|
||||
mlb_logos: HashMap<String, Vec<u8>>,
|
||||
nba_logos: HashMap<String, Handle>,
|
||||
mlb_logos: HashMap<String, Handle>,
|
||||
weather_handle: Option<Handle>,
|
||||
}
|
||||
impl RustClock {
|
||||
fn update(&mut self, message: Message) {
|
||||
|
|
@ -66,9 +74,21 @@ impl RustClock {
|
|||
self.nba_scores = sports::update_nba();
|
||||
self.mlb_scores = sports::update_mlb();
|
||||
}
|
||||
Message::UpdateTime => {
|
||||
self.current_time = Local::now();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn subscription(&self) -> Subscription<Message> {
|
||||
Subscription::batch(vec![
|
||||
iced::time::every(Duration::from_millis(CLOCK_UPDATE_TIME_MS))
|
||||
.map(|_| Message::UpdateTime),
|
||||
iced::time::every(Duration::from_mins(UPDATE_SPORTS_TIME_MINS))
|
||||
.map(|_| Message::RunSportsUpdate),
|
||||
])
|
||||
}
|
||||
|
||||
fn view(state: &RustClock) -> Element<'_, Message> {
|
||||
pane_grid(&state.panes, |_panes, pane_state, _is_maximized| {
|
||||
let content: Element<'_, Message> = match pane_state {
|
||||
|
|
@ -77,7 +97,9 @@ impl RustClock {
|
|||
PaneType::News => panes::render_news_pane(),
|
||||
PaneType::MlbPane => panes::render_mlb_pane(&state.mlb_scores, &state.mlb_logos),
|
||||
PaneType::Clock => panes::render_clock_pane(),
|
||||
PaneType::Weather => panes::render_weather_pane(&state.weather, &state.location),
|
||||
PaneType::Weather => {
|
||||
panes::render_weather_pane(&state.weather_handle, &state.location)
|
||||
}
|
||||
};
|
||||
pane_grid::Content::new(content)
|
||||
})
|
||||
|
|
@ -89,8 +111,6 @@ impl RustClock {
|
|||
|
||||
impl Default for RustClock {
|
||||
fn default() -> Self {
|
||||
sports::get_mlb_logos();
|
||||
|
||||
let text = ureq::get("https://v2.wttr.in/Sacramento.png?u0")
|
||||
.header("User-Agent", "deathclock-app/1.0")
|
||||
.call()
|
||||
|
|
@ -99,19 +119,29 @@ impl Default for RustClock {
|
|||
.read_to_vec()
|
||||
.unwrap();
|
||||
|
||||
let mlb_logos = sports::get_mlb_logos();
|
||||
let nba_logos = sports::get_nba_logos();
|
||||
let mlb_logos_bytes = sports::get_mlb_logos();
|
||||
let nba_logos_bytes = sports::get_nba_logos();
|
||||
|
||||
let mlb_logos: HashMap<String, Handle> = mlb_logos_bytes
|
||||
.into_iter()
|
||||
.map(|(k, v)| (k, Handle::from_bytes(v)))
|
||||
.collect();
|
||||
let nba_logos: HashMap<String, Handle> = nba_logos_bytes
|
||||
.into_iter()
|
||||
.map(|(k, v)| (k, Handle::from_bytes(v)))
|
||||
.collect();
|
||||
|
||||
RustClock {
|
||||
current_time: Local::now(),
|
||||
next_alarm: None,
|
||||
news: Vec::new(),
|
||||
weather: text,
|
||||
weather: text.clone(),
|
||||
location: "Sacramento".to_string(),
|
||||
nba_scores: { sports::update_nba() },
|
||||
mlb_scores: { sports::update_mlb() },
|
||||
mlb_logos,
|
||||
nba_logos,
|
||||
weather_handle: Some(Handle::from_bytes(text)),
|
||||
panes: {
|
||||
let config = Configuration::Split {
|
||||
axis: pane_grid::Axis::Horizontal,
|
||||
|
|
@ -140,12 +170,3 @@ impl Default for RustClock {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn dash_updates() {
|
||||
loop {
|
||||
let mut state = RustClock::default();
|
||||
state.update(Message::RunSportsUpdate);
|
||||
println!("Updated sports scores");
|
||||
tokio::time::sleep(Duration::from_secs(60)).await;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,27 +7,26 @@ use std::collections::HashMap;
|
|||
|
||||
use crate::Message;
|
||||
use crate::sports::Game;
|
||||
use iced::widget::image::Handle;
|
||||
|
||||
pub fn render_nba_pane<'a>(
|
||||
games: &'a [Game],
|
||||
logos: &'a HashMap<String, Vec<u8>>,
|
||||
logos: &'a HashMap<String, Handle>,
|
||||
) -> Element<'a, Message> {
|
||||
column(games.iter().map(|game| {
|
||||
let Some(team1_logo) = logos.get(&game.team1) else {
|
||||
return text(format!("Error: Team 1 logo not found for {}", game.team1)).into();
|
||||
};
|
||||
let team1_handle = image::Handle::from_bytes(team1_logo.clone());
|
||||
let Some(team2_logo) = logos.get(&game.team2) else {
|
||||
return text("Error: Team 2 logo not found").into();
|
||||
};
|
||||
let team2_handle = image::Handle::from_bytes(team2_logo.clone());
|
||||
|
||||
container(
|
||||
column![
|
||||
row![
|
||||
image(team1_handle).width(30).height(30),
|
||||
image(team1_logo.clone()).width(30).height(30),
|
||||
text(&game.team1).size(20).width(Fill),
|
||||
image(team2_handle).width(30).height(30),
|
||||
image(team2_logo.clone()).width(30).height(30),
|
||||
text(&game.team2).size(20).width(Fill),
|
||||
],
|
||||
row![
|
||||
|
|
@ -74,23 +73,21 @@ pub fn render_news_pane<'a>() -> Element<'a, Message> {
|
|||
|
||||
pub fn render_mlb_pane<'a>(
|
||||
games: &'a [Game],
|
||||
logos: &'a HashMap<String, Vec<u8>>,
|
||||
logos: &'a HashMap<String, Handle>,
|
||||
) -> Element<'a, Message> {
|
||||
scrollable(column(games.iter().map(|game| {
|
||||
let Some(team1_logo) = logos.get(&game.team1) else {
|
||||
return text(format!("Error: Team 1 logo not found for {}", game.team1)).into();
|
||||
};
|
||||
let team1_handle = image::Handle::from_bytes(team1_logo.clone());
|
||||
let Some(team2_logo) = logos.get(&game.team2) else {
|
||||
return text("Error: Team 2 logo not found").into();
|
||||
};
|
||||
let team2_handle = image::Handle::from_bytes(team2_logo.clone());
|
||||
container(
|
||||
column![
|
||||
row![
|
||||
image(team1_handle.clone()).width(15).height(15),
|
||||
image(team1_logo.clone()).width(15).height(15),
|
||||
text(&game.team1).size(20).width(Fill),
|
||||
image(team2_handle.clone()).width(15).height(15),
|
||||
image(team2_logo.clone()).width(15).height(15),
|
||||
text(&game.team2).size(20).width(Fill),
|
||||
],
|
||||
row![
|
||||
|
|
@ -133,12 +130,14 @@ pub fn render_clock_pane<'a>() -> Element<'a, Message> {
|
|||
.into()
|
||||
}
|
||||
|
||||
pub fn render_weather_pane<'a>(weather_data: &'a [u8], location: &'a str) -> Element<'a, Message> {
|
||||
let weather_img = image::Handle::from_bytes(weather_data.to_vec());
|
||||
pub fn render_weather_pane<'a>(weather_handle: &'a Option<Handle>, location: &'a str) -> Element<'a, Message> {
|
||||
let Some(weather_img) = weather_handle else {
|
||||
return text("Weather image not loaded").into();
|
||||
};
|
||||
container(
|
||||
column![
|
||||
text("Weather").size(50),
|
||||
image(weather_img).width(Fill),
|
||||
image(weather_img.clone()).width(Fill),
|
||||
text(location).size(30),
|
||||
]
|
||||
.padding(5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue