1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Try out egui subsecond (doesn't seem to work yet :/)

This commit is contained in:
lucasmerlin
2025-08-12 10:50:07 +02:00
parent 53d8c48b4f
commit 3a36861c07
7 changed files with 489 additions and 153 deletions

View File

@@ -588,6 +588,15 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
"generic-array",
]
[[package]]
name = "block2"
version = "0.5.1"
@@ -670,9 +679,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
[[package]]
name = "bytes"
version = "1.8.0"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da"
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
[[package]]
name = "calloop"
@@ -897,6 +906,26 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "const_format"
version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd"
dependencies = [
"const_format_proc_macros",
]
[[package]]
name = "const_format_proc_macros"
version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
name = "core-foundation"
version = "0.9.4"
@@ -946,6 +975,15 @@ dependencies = [
"libm",
]
[[package]]
name = "cpufeatures"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
dependencies = [
"libc",
]
[[package]]
name = "crc32fast"
version = "1.4.2"
@@ -1029,6 +1067,16 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "crypto-common"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
"typenum",
]
[[package]]
name = "cursor-icon"
version = "1.1.0"
@@ -1087,6 +1135,12 @@ dependencies = [
"env_logger",
]
[[package]]
name = "data-encoding"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
[[package]]
name = "data-url"
version = "0.3.1"
@@ -1115,6 +1169,96 @@ dependencies = [
"rayon",
]
[[package]]
name = "digest"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer",
"crypto-common",
]
[[package]]
name = "dioxus-cli-config"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8cec511d8a05ed60071bb0088f07ec40325faf27a608fa19d65befdd842b57f"
[[package]]
name = "dioxus-core"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07b55eccaa5c4f35f1755ea18a5716fe8ecba60ff1f25c52be6ceda2e6a52eb6"
dependencies = [
"const_format",
"dioxus-core-types",
"futures-channel",
"futures-util",
"generational-box",
"longest-increasing-subsequence",
"rustc-hash 2.1.1",
"rustversion",
"serde",
"slab",
"slotmap",
"subsecond",
"tracing",
"warnings",
]
[[package]]
name = "dioxus-core-types"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0ef2a94b4ceb8f7a39f56a539d07e82b0358a49a0b95028ad48635975df29d7"
[[package]]
name = "dioxus-devtools"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60af4e129968ab1713471ed0b29c3eefa4e8e09252429487d7a581e93c7ecfe5"
dependencies = [
"dioxus-cli-config",
"dioxus-core",
"dioxus-devtools-types",
"dioxus-signals",
"serde",
"serde_json",
"subsecond",
"thiserror 2.0.14",
"tracing",
"tungstenite",
"warnings",
]
[[package]]
name = "dioxus-devtools-types"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64274704b6a8d018112473cdce0b3db1dcccfa79bde445223592fe4e396ff5ef"
dependencies = [
"dioxus-core",
"serde",
"subsecond-types",
]
[[package]]
name = "dioxus-signals"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1d0e70a8da969c0404f5ef8cf6f47042bea55608b582079f3ea3d9fff46125c"
dependencies = [
"dioxus-core",
"futures-channel",
"futures-util",
"generational-box",
"parking_lot",
"rustc-hash 2.1.1",
"tracing",
"warnings",
]
[[package]]
name = "directories"
version = "5.0.1"
@@ -1311,6 +1455,7 @@ version = "0.32.0"
dependencies = [
"bytemuck",
"chrono",
"dioxus-devtools",
"eframe",
"egui",
"egui_demo_lib",
@@ -1327,6 +1472,7 @@ dependencies = [
"puffin_http",
"rfd",
"serde",
"subsecond",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
@@ -1808,6 +1954,26 @@ dependencies = [
"slab",
]
[[package]]
name = "generational-box"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb058e0358ff765e719ab3e61629c5090fedb6a6ccf66479de21440a33d7f084"
dependencies = [
"parking_lot",
"tracing",
]
[[package]]
name = "generic-array"
version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
]
[[package]]
name = "gethostname"
version = "0.4.3"
@@ -2097,6 +2263,23 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "http"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]]
name = "httparse"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "humantime"
version = "2.1.0"
@@ -2384,9 +2567,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
[[package]]
name = "js-sys"
version = "0.3.74"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
@@ -2446,15 +2629,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.168"
version = "0.2.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d"
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
[[package]]
name = "libloading"
version = "0.8.5"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
dependencies = [
"cfg-if",
"windows-targets 0.52.6",
@@ -2519,9 +2702,9 @@ checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5"
[[package]]
name = "lock_api"
version = "0.4.12"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765"
dependencies = [
"autocfg",
"scopeguard",
@@ -2533,6 +2716,12 @@ version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "longest-increasing-subsequence"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86"
[[package]]
name = "lz4_flex"
version = "0.11.3"
@@ -2554,6 +2743,15 @@ version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "memfd"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64"
dependencies = [
"rustix 0.38.38",
]
[[package]]
name = "memmap2"
version = "0.9.5"
@@ -2665,10 +2863,10 @@ dependencies = [
"log",
"num-traits",
"once_cell",
"rustc-hash",
"rustc-hash 1.1.0",
"spirv",
"strum",
"thiserror 2.0.11",
"thiserror 2.0.14",
"unicode-ident",
]
@@ -3093,9 +3291,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]]
name = "parking_lot"
version = "0.12.3"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13"
dependencies = [
"lock_api",
"parking_lot_core",
@@ -3103,9 +3301,9 @@ dependencies = [
[[package]]
name = "parking_lot_core"
version = "0.9.10"
version = "0.9.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5"
dependencies = [
"cfg-if",
"libc",
@@ -3620,6 +3818,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc-hash"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]]
name = "rustix"
version = "0.38.38"
@@ -3680,9 +3884,9 @@ dependencies = [
[[package]]
name = "rustversion"
version = "1.0.19"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "rustybuzz"
@@ -3753,18 +3957,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.214"
version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.214"
version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [
"proc-macro2",
"quote",
@@ -3773,9 +3977,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.132"
version = "1.0.142"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03"
checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7"
dependencies = [
"itoa",
"memchr",
@@ -3803,6 +4007,17 @@ dependencies = [
"log",
]
[[package]]
name = "sha1"
version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
dependencies = [
"cfg-if",
"cpufeatures",
"digest",
]
[[package]]
name = "shlex"
version = "1.3.0"
@@ -3861,12 +4076,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
[[package]]
name = "slab"
version = "0.4.9"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
dependencies = [
"autocfg",
]
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
[[package]]
name = "slotmap"
@@ -3874,6 +4086,7 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a"
dependencies = [
"serde",
"version_check",
]
@@ -3990,6 +4203,34 @@ dependencies = [
"syn",
]
[[package]]
name = "subsecond"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b14ed4d86ab065ffbfdb994fd3e44daf5244b02cb643bd52949d74b703f36605"
dependencies = [
"js-sys",
"libc",
"libloading",
"memfd",
"memmap2",
"serde",
"subsecond-types",
"thiserror 2.0.14",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "subsecond-types"
version = "0.7.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "275920a8a5634e47e12253971db85946798795bbe4d9dfc1debf23533d823983"
dependencies = [
"serde",
]
[[package]]
name = "subtle"
version = "2.6.1"
@@ -4124,11 +4365,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.11"
version = "2.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc"
checksum = "0b0949c3a6c842cbde3f1686d6eea5a010516deb7085f79db747562d4102f41e"
dependencies = [
"thiserror-impl 2.0.11",
"thiserror-impl 2.0.14",
]
[[package]]
@@ -4144,9 +4385,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.11"
version = "2.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2"
checksum = "cc5b44b4ab9c2fdd0e0512e6bece8388e214c0749f5862b114cc5b7a25daf227"
dependencies = [
"proc-macro2",
"quote",
@@ -4289,9 +4530,9 @@ dependencies = [
[[package]]
name = "tracing"
version = "0.1.40"
version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
dependencies = [
"pin-project-lite",
"tracing-attributes",
@@ -4300,9 +4541,9 @@ dependencies = [
[[package]]
name = "tracing-attributes"
version = "0.1.27"
version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
dependencies = [
"proc-macro2",
"quote",
@@ -4311,9 +4552,9 @@ dependencies = [
[[package]]
name = "tracing-core"
version = "0.1.32"
version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
dependencies = [
"once_cell",
]
@@ -4327,15 +4568,38 @@ dependencies = [
"core_maths",
]
[[package]]
name = "tungstenite"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eadc29d668c91fcc564941132e17b28a7ceb2f3ebf0b9dae3e03fd7a6748eb0d"
dependencies = [
"bytes",
"data-encoding",
"http",
"httparse",
"log",
"rand",
"sha1",
"thiserror 2.0.14",
"utf-8",
]
[[package]]
name = "type-map"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f"
dependencies = [
"rustc-hash",
"rustc-hash 1.1.0",
]
[[package]]
name = "typenum"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
[[package]]
name = "uds_windows"
version = "1.1.0"
@@ -4407,6 +4671,12 @@ version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
[[package]]
name = "unicode-xid"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "unicode_names2"
version = "0.6.0"
@@ -4488,6 +4758,12 @@ dependencies = [
"xmlwriter",
]
[[package]]
name = "utf-8"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
[[package]]
name = "utf16_iter"
version = "1.0.5"
@@ -4516,6 +4792,28 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "warnings"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64f68998838dab65727c9b30465595c6f7c953313559371ca8bf31759b3680ad"
dependencies = [
"pin-project",
"tracing",
"warnings-macro",
]
[[package]]
name = "warnings-macro"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59195a1db0e95b920366d949ba5e0d3fc0e70b67c09be15ce5abb790106b0571"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@@ -4533,24 +4831,24 @@ dependencies = [
[[package]]
name = "wasm-bindgen"
version = "0.2.97"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.97"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
"syn",
@@ -4559,21 +4857,22 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.45"
version = "0.4.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b"
checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
dependencies = [
"cfg-if",
"js-sys",
"once_cell",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.97"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -4581,9 +4880,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.97"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
@@ -4594,9 +4893,12 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.97"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "wayland-backend"
@@ -4709,9 +5011,9 @@ dependencies = [
[[package]]
name = "web-sys"
version = "0.3.74"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c"
checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -4808,9 +5110,9 @@ dependencies = [
"portable-atomic",
"profiling",
"raw-window-handle 0.6.2",
"rustc-hash",
"rustc-hash 1.1.0",
"smallvec",
"thiserror 2.0.11",
"thiserror 2.0.14",
"wgpu-core-deps-apple",
"wgpu-core-deps-emscripten",
"wgpu-core-deps-wasm",
@@ -4894,7 +5196,7 @@ dependencies = [
"raw-window-handle 0.6.2",
"renderdoc-sys",
"smallvec",
"thiserror 2.0.11",
"thiserror 2.0.14",
"wasm-bindgen",
"web-sys",
"wgpu-types",
@@ -4912,7 +5214,7 @@ dependencies = [
"bytemuck",
"js-sys",
"log",
"thiserror 2.0.11",
"thiserror 2.0.14",
"web-sys",
]
@@ -4938,7 +5240,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.48.0",
"windows-sys 0.59.0",
]
[[package]]

View File

@@ -79,6 +79,8 @@ poll-promise = { version = "0.3", optional = true, default-features = false }
# feature "persistence":
serde = { workspace = true, optional = true }
dioxus-devtools = "0.7.0-rc.0"
subsecond = "0.7.0-rc.0"
# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
@@ -91,7 +93,7 @@ rfd = { version = "0.15.3", optional = true }
# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "=0.2.97"
wasm-bindgen = "=0.2.100"
wasm-bindgen-futures.workspace = true
web-sys.workspace = true

View File

@@ -24,7 +24,8 @@ impl Custom3d {
impl eframe::App for Custom3d {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
subsecond::call(|| {
egui::CentralPanel::default().show(ctx, |ui| {
egui::ScrollArea::both()
.auto_shrink(false)
.show(ui, |ui| {
@@ -43,6 +44,7 @@ impl eframe::App for Custom3d {
ui.add(egui_demo_lib::egui_github_link_file!());
});
});
});
}
fn on_exit(&mut self, gl: Option<&glow::Context>) {

View File

@@ -9,23 +9,26 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; // Much faster allocator
// When compiling natively:
fn main() -> eframe::Result {
for arg in std::env::args().skip(1) {
match arg.as_str() {
"--profile" => {
#[cfg(feature = "puffin")]
start_puffin_server();
#[cfg(not(feature = "puffin"))]
panic!(
"Unknown argument: {arg} - you need to enable the 'puffin' feature to use this."
);
}
dioxus_devtools::connect_subsecond();
_ => {
panic!("Unknown argument: {arg}");
}
}
}
// for arg in std::env::args().skip(1) {
// match arg.as_str() {
// "--profile" => {
// #[cfg(feature = "puffin")]
// start_puffin_server();
//
// #[cfg(not(feature = "puffin"))]
// panic!(
// "Unknown argument: {arg} - you need to enable the 'puffin' feature to use this."
// );
// }
//
// _ => {
// panic!("Unknown argument: {arg}");
// }
// }
// }
{
// Silence wgpu log spam (https://github.com/gfx-rs/wgpu/issues/3206)
@@ -62,11 +65,13 @@ fn main() -> eframe::Result {
..Default::default()
};
eframe::run_native(
"egui demo app",
options,
Box::new(|cc| Ok(Box::new(egui_demo_app::WrapApp::new(cc)))),
)
subsecond::call(|| {
eframe::run_native(
"egui demo app",
options.clone(),
Box::new(|cc| Ok(Box::new(egui_demo_app::WrapApp::new(cc)))),
)
})
}
#[cfg(feature = "puffin")]

View File

@@ -5,6 +5,7 @@ use eframe::glow;
#[cfg(target_arch = "wasm32")]
use core::any::Any;
use std::sync::Arc;
#[derive(Default)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
@@ -185,6 +186,11 @@ pub struct WrapApp {
impl WrapApp {
pub fn new(cc: &eframe::CreationContext<'_>) -> Self {
{
let ctx = cc.egui_ctx.clone();
subsecond::register_handler(Arc::new(move || ctx.request_repaint()));
}
// This gives us image support:
egui_extras::install_image_loaders(&cc.egui_ctx);
@@ -277,47 +283,49 @@ impl eframe::App for WrapApp {
}
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
#[cfg(target_arch = "wasm32")]
if let Some(anchor) = frame
.info()
.web_info
.location
.hash
.strip_prefix('#')
.and_then(Anchor::from_str_case_insensitive)
{
self.state.selected_anchor = anchor;
}
subsecond::call(|| {
#[cfg(target_arch = "wasm32")]
if let Some(anchor) = frame
.info()
.web_info
.location
.hash
.strip_prefix('#')
.and_then(Anchor::from_str_case_insensitive)
{
self.state.selected_anchor = anchor;
}
#[cfg(not(target_arch = "wasm32"))]
if ctx.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::F11)) {
let fullscreen = ctx.input(|i| i.viewport().fullscreen.unwrap_or(false));
ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(!fullscreen));
}
#[cfg(not(target_arch = "wasm32"))]
if ctx.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::F11)) {
let fullscreen = ctx.input(|i| i.viewport().fullscreen.unwrap_or(false));
ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(!fullscreen));
}
let mut cmd = Command::Nothing;
egui::TopBottomPanel::top("wrap_app_top_bar")
.frame(egui::Frame::new().inner_margin(4))
.show(ctx, |ui| {
ui.horizontal_wrapped(|ui| {
ui.visuals_mut().button_frame = false;
self.bar_contents(ui, frame, &mut cmd);
let mut cmd = Command::Nothing;
egui::TopBottomPanel::top("wrap_app_top_bar")
.frame(egui::Frame::new().inner_margin(4))
.show(ctx, |ui| {
ui.horizontal_wrapped(|ui| {
ui.visuals_mut().button_frame = false;
self.bar_contents(ui, frame, &mut cmd);
});
});
});
self.state.backend_panel.update(ctx, frame);
self.state.backend_panel.update(ctx, frame);
if !is_mobile(ctx) {
cmd = self.backend_panel(ctx, frame);
}
if !is_mobile(ctx) {
cmd = self.backend_panel(ctx, frame);
}
self.show_selected_app(ctx, frame);
self.show_selected_app(ctx, frame);
self.state.backend_panel.end_of_frame(ctx);
self.state.backend_panel.end_of_frame(ctx);
self.ui_file_drag_and_drop(ctx);
self.ui_file_drag_and_drop(ctx);
self.run_cmd(ctx, cmd);
self.run_cmd(ctx, cmd);
});
}
#[cfg(feature = "glow")]
@@ -395,57 +403,61 @@ impl WrapApp {
}
fn show_selected_app(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
let selected_anchor = self.state.selected_anchor;
for (_name, anchor, app) in self.apps_iter_mut() {
if anchor == selected_anchor || ctx.memory(|mem| mem.everything_is_visible()) {
app.update(ctx, frame);
subsecond::call(|| {
let selected_anchor = self.state.selected_anchor;
for (_name, anchor, app) in self.apps_iter_mut() {
if anchor == selected_anchor || ctx.memory(|mem| mem.everything_is_visible()) {
app.update(ctx, frame);
}
}
}
});
}
fn bar_contents(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame, cmd: &mut Command) {
egui::widgets::global_theme_preference_switch(ui);
subsecond::call(|| {
egui::widgets::global_theme_preference_switch(ui);
ui.separator();
ui.separator();
if is_mobile(ui.ctx()) {
ui.menu_button("💻 Backend", |ui| {
ui.set_style(ui.ctx().style()); // ignore the "menu" style set by `menu_button`.
self.backend_panel_contents(ui, frame, cmd);
});
} else {
ui.toggle_value(&mut self.state.backend_panel.open, "💻 Backend");
}
ui.separator();
let mut selected_anchor = self.state.selected_anchor;
for (name, anchor, _app) in self.apps_iter_mut() {
if ui
.selectable_label(selected_anchor == anchor, name)
.clicked()
{
selected_anchor = anchor;
if frame.is_web() {
ui.ctx()
.open_url(egui::OpenUrl::same_tab(format!("#{anchor}")));
}
if is_mobile(ui.ctx()) {
ui.menu_button("💻 Backend 2", |ui| {
ui.set_style(ui.ctx().style()); // ignore the "menu" style set by `menu_button`.
self.backend_panel_contents(ui, frame, cmd);
});
} else {
ui.toggle_value(&mut self.state.backend_panel.open, "💻 Backend");
}
}
self.state.selected_anchor = selected_anchor;
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if false {
// TODO(emilk): fix the overlap on small screens
if clock_button(ui, crate::seconds_since_midnight()).clicked() {
self.state.selected_anchor = Anchor::Clock;
ui.separator();
let mut selected_anchor = self.state.selected_anchor;
for (name, anchor, _app) in self.apps_iter_mut() {
if ui
.selectable_label(selected_anchor == anchor, name)
.clicked()
{
selected_anchor = anchor;
if frame.is_web() {
ui.ctx().open_url(egui::OpenUrl::same_tab("#clock"));
ui.ctx()
.open_url(egui::OpenUrl::same_tab(format!("#{anchor}")));
}
}
}
self.state.selected_anchor = selected_anchor;
egui::warn_if_debug_build(ui);
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if false {
// TODO(emilk): fix the overlap on small screens
if clock_button(ui, crate::seconds_since_midnight()).clicked() {
self.state.selected_anchor = Anchor::Clock;
if frame.is_web() {
ui.ctx().open_url(egui::OpenUrl::same_tab("#clock"));
}
}
}
egui::warn_if_debug_build(ui);
});
});
}

View File

@@ -73,6 +73,9 @@ impl ImageLoader for GifLoader {
}
fn load(&self, ctx: &egui::Context, frame_uri: &str, _: SizeHint) -> ImageLoadResult {
let time = ctx.input(|i| i.time);
let (image_uri, frame_index) =
decode_animated_image_uri(frame_uri).map_err(|_err| LoadError::NotSupported)?;
let mut cache = self.cache.lock();

View File

@@ -2,6 +2,7 @@
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
use eframe::egui;
use eframe::egui::{Align, Color32, TextEdit, vec2};
fn main() -> eframe::Result {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
@@ -28,6 +29,15 @@ fn main() -> eframe::Result {
age += 1;
}
ui.label(format!("Hello '{name}', age {age}"));
ui.add_sized(
vec2(100.0, 100.0),
TextEdit::multiline(&mut String::from("Select me!"))
.horizontal_align(Align::Center)
.vertical_align(Align::Max)
.background_color(Color32::WHITE)
.text_color(Color32::BLACK),
);
});
})
}