From 144f38a115e4fc869445dee4704bdd3d126153d7 Mon Sep 17 00:00:00 2001 From: Polesznyák Márk Date: Thu, 2 Oct 2025 23:09:54 +0200 Subject: feat: update according to latest iced and iced_material changes --- Cargo.lock | 484 ++++++++++++--------------------------------- Cargo.toml | 7 +- src/appearance.rs | 50 ++--- src/config.rs | 2 +- src/dialog.rs | 4 +- src/main.rs | 99 +++++++--- src/panes/designer_view.rs | 2 +- src/types.rs | 4 +- src/types/project.rs | 16 +- 9 files changed, 247 insertions(+), 421 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ae5620..bb30ea2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "ab_glyph" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e074464580a518d16a7126262fffaaa47af89d4099d4cb403f8ed938ba12ee7d" +checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -20,9 +20,9 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" [[package]] name = "addr2line" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ "gimli", ] @@ -141,12 +141,6 @@ dependencies = [ "derive_arbitrary", ] -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - [[package]] name = "arg_enum_proc_macro" version = "0.3.4" @@ -185,24 +179,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "ashpd" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3d60bee1a1d38c2077030f4788e1b4e31058d2e79a8cfc8f2b440bd44db290" -dependencies = [ - "async-fs", - "async-net", - "enumflags2", - "futures-channel", - "futures-util", - "rand 0.8.5", - "serde", - "serde_repr", - "url", - "zbus", -] - [[package]] name = "ashpd" version = "0.11.0" @@ -231,23 +207,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "futures-core", "pin-project-lite", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "2.5.0" @@ -285,21 +250,6 @@ dependencies = [ "futures-lite", ] -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.5.0", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", -] - [[package]] name = "async-io" version = "2.6.0" @@ -315,7 +265,7 @@ dependencies = [ "polling", "rustix 1.1.2", "slab", - "windows-sys 0.61.0", + "windows-sys 0.61.1", ] [[package]] @@ -324,7 +274,7 @@ version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] @@ -346,14 +296,14 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-io", "async-lock", "async-signal", "async-task", "blocking", "cfg-if", - "event-listener 5.4.1", + "event-listener", "futures-lite", "rustix 1.1.2", ] @@ -384,33 +334,7 @@ dependencies = [ "rustix 1.1.2", "signal-hook-registry", "slab", - "windows-sys 0.61.0", -] - -[[package]] -name = "async-std" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", + "windows-sys 0.61.1", ] [[package]] @@ -467,9 +391,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.75" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ "addr2line", "cfg-if", @@ -477,7 +401,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-link 0.2.0", ] [[package]] @@ -495,30 +419,15 @@ dependencies = [ "serde", ] -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec 0.6.3", -] - [[package]] name = "bit-set" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec 0.8.0", + "bit-vec", ] -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bit-vec" version = "0.8.0" @@ -591,7 +500,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-task", "futures-io", "futures-lite", @@ -685,15 +594,15 @@ dependencies = [ [[package]] name = "camino" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1de8bc0aa9e9385ceb3bf0c152e3a9b9544f6c4a912c8ae504e80c1f0368603" +checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" [[package]] name = "cc" -version = "1.2.38" +version = "1.2.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" +checksum = "e1354349954c6fc9cb0deab020f27f783cf0b604e8bb754dc4658ecf0d29c35f" dependencies = [ "find-msvc-tools", "jobserver", @@ -1015,20 +924,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" -[[package]] -name = "dark-light" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e1a09f280e29a8b00bc7e81eca5ac87dca0575639c9422a5fa25a07bb884b8" -dependencies = [ - "ashpd 0.10.3", - "async-std", - "objc2 0.5.2", - "objc2-foundation 0.2.2", - "web-sys", - "winreg 0.52.0", -] - [[package]] name = "data-url" version = "0.3.2" @@ -1037,9 +932,9 @@ checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" [[package]] name = "deflate64" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" +checksum = "26bf8fc351c5ed29b5c2f0cbbac1b209b74f60ecd62e675a998df72c49af5204" [[package]] name = "deranged" @@ -1149,7 +1044,7 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dpi" version = "0.1.1" -source = "git+https://github.com/iced-rs/winit.git?rev=11414b6aa45699f038114e61b4ddf5102b2d3b4b#11414b6aa45699f038114e61b4ddf5102b2d3b4b" +source = "git+https://github.com/iced-rs/winit.git?rev=05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed#05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed" [[package]] name = "drm" @@ -1207,7 +1102,7 @@ dependencies = [ "rustc_version", "toml 0.9.7", "vswhom", - "winreg 0.55.0", + "winreg", ] [[package]] @@ -1279,7 +1174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.0", + "windows-sys 0.61.1", ] [[package]] @@ -1307,12 +1202,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.4.1" @@ -1330,7 +1219,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.1", + "event-listener", "pin-project-lite", ] @@ -1351,12 +1240,13 @@ dependencies = [ [[package]] name = "fancy-regex" -version = "0.11.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +checksum = "998b056554fbe42e03ae0e152895cd1a7e1002aec800fdc6635d20270260c46f" dependencies = [ - "bit-set 0.5.3", - "regex", + "bit-set", + "regex-automata", + "regex-syntax", ] [[package]] @@ -1431,9 +1321,9 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "font-types" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a596f5713680923a2080d86de50fe472fb290693cf0f701187a1c8b36996b7" +checksum = "511e2c18a516c666d27867d2f9821f76e7d591f762e9fc41dd6cc5c90fe54b0b" dependencies = [ "bytemuck", ] @@ -1693,9 +1583,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "gl_generator" @@ -1714,18 +1604,6 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "glow" version = "0.16.0" @@ -2015,7 +1893,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "iced_core", "iced_debug", @@ -2025,13 +1903,13 @@ dependencies = [ "iced_widget", "iced_winit", "image", - "thiserror 1.0.69", + "thiserror 2.0.17", ] [[package]] name = "iced_anim" version = "0.2.1" -source = "git+https://github.com/pml68/iced_anim?branch=main#b88f6daed2cefdb77b006e13e1785e07e0853a13" +source = "git+https://github.com/pml68/iced_anim?branch=main#0a3844e08dd0e988cd534ad2e93178c8c8e1d88c" dependencies = [ "iced", "iced_anim_derive", @@ -2040,7 +1918,7 @@ dependencies = [ [[package]] name = "iced_anim_derive" version = "0.2.0" -source = "git+https://github.com/pml68/iced_anim?branch=main#b88f6daed2cefdb77b006e13e1785e07e0853a13" +source = "git+https://github.com/pml68/iced_anim?branch=main#0a3844e08dd0e988cd534ad2e93178c8c8e1d88c" dependencies = [ "quote", "syn 2.0.106", @@ -2064,7 +1942,7 @@ dependencies = [ "rust-format", "serde", "serde_json", - "thiserror 2.0.16", + "thiserror 2.0.17", "tokio", "tokio-stream", "toml 0.9.7", @@ -2075,25 +1953,24 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "bitflags 2.9.4", "bytes", - "dark-light", "glam", "lilt", "log", "num-traits", "rustc-hash 2.1.1", "smol_str", - "thiserror 1.0.69", + "thiserror 2.0.17", "web-time", ] [[package]] name = "iced_custom_highlighter" version = "0.1.0" -source = "git+https://github.com/pml68/iced_custom_highlighter#c14309113052ec2592b4c79435b12f02e9a79042" +source = "git+https://git.sr.ht/~pml68/iced_custom_highlighter#a0cd6e9c9f73edd2c1e89e28a8d6d3dbefbcfbf4" dependencies = [ "iced_core", "syntect", @@ -2103,7 +1980,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "iced_core", "iced_futures", @@ -2113,7 +1990,7 @@ dependencies = [ [[package]] name = "iced_dialog" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced_dialog?branch=iced%2Fpersonal#de4421c60fae7514eb76c48572ac5855a89e84ca" +source = "git+https://git.sr.ht/~pml68/iced_dialog?branch=iced%2Fpersonal#dc1a734bfad4efc691e8aae799ebf7af3743be44" dependencies = [ "iced_core", "iced_widget", @@ -2122,7 +1999,7 @@ dependencies = [ [[package]] name = "iced_drop" version = "0.1.0" -source = "git+https://github.com/pml68/iced_drop?branch=iced%2Fpersonal#c8c6c06f6f55e8d113f4ceb3d3ecf1d9d2696d3b" +source = "git+https://github.com/pml68/iced_drop?branch=iced%2Fpersonal#41c0ec7ee48cae30a3f0c16d832e043a8abb3cd8" dependencies = [ "iced", ] @@ -2142,7 +2019,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "futures", "iced_core", @@ -2156,7 +2033,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "bitflags 2.9.4", "bytemuck", @@ -2169,27 +2046,26 @@ dependencies = [ "log", "raw-window-handle", "rustc-hash 2.1.1", - "thiserror 1.0.69", + "thiserror 2.0.17", "unicode-segmentation", ] [[package]] name = "iced_material" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced_material?branch=iced%2Fpersonal#bc1dfc9fe3241a4035669ae29d22c0774435d6a6" +source = "git+https://git.sr.ht/~pml68/iced_material?branch=iced%2Fpersonal#c26b21a1d0ab1a8a73b2dab40879e063c044502e" dependencies = [ - "arc-swap", "iced_anim", "iced_dialog", "iced_widget", - "mundy", + "iced_winit", "serde", ] [[package]] name = "iced_program" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "iced_graphics", "iced_runtime", @@ -2198,32 +2074,32 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "iced_graphics", "iced_tiny_skia", "iced_wgpu", "log", - "thiserror 1.0.69", + "thiserror 2.0.17", ] [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "bytes", "iced_core", "iced_debug", "iced_futures", "raw-window-handle", - "thiserror 1.0.69", + "thiserror 2.0.17", ] [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "bytemuck", "cosmic-text", @@ -2240,7 +2116,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "bitflags 2.9.4", "bytemuck", @@ -2253,35 +2129,35 @@ dependencies = [ "log", "resvg", "rustc-hash 2.1.1", - "thiserror 1.0.69", + "thiserror 2.0.17", "wgpu", ] [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "iced_renderer", - "iced_runtime", "log", "num-traits", "ouroboros", "rustc-hash 2.1.1", - "thiserror 1.0.69", + "thiserror 2.0.17", "unicode-segmentation", ] [[package]] name = "iced_winit" version = "0.14.0-dev" -source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#e634a87a0aaf923ed1cf6bd940af8e0b43d38799" +source = "git+https://github.com/pml68/iced?branch=feat%2Frehighlight-on-redraw#eae40b675de20f45f4db69977af3f799d0624b31" dependencies = [ "iced_debug", "iced_program", "log", + "mundy", "rustc-hash 2.1.1", - "thiserror 1.0.69", + "thiserror 2.0.17", "tracing", "wasm-bindgen-futures", "web-sys", @@ -2609,15 +2485,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lebe" version = "0.5.3" @@ -2736,9 +2603,6 @@ name = "log" version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" -dependencies = [ - "value-bag", -] [[package]] name = "loop9" @@ -2914,7 +2778,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "916cbc7cb27db60be930a4e2da243cf4bc39569195f22fd8ee419cd31d5b662c" dependencies = [ "arrayvec", - "bit-set 0.8.0", + "bit-set", "bitflags 2.9.4", "cfg-if", "cfg_aliases", @@ -2929,7 +2793,7 @@ dependencies = [ "once_cell", "rustc-hash 1.1.0", "spirv", - "thiserror 2.0.16", + "thiserror 2.0.17", "unicode-ident", ] @@ -3437,9 +3301,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.7" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "memchr", ] @@ -3698,7 +3562,7 @@ dependencies = [ "hermit-abi", "pin-project-lite", "rustix 1.1.2", - "windows-sys 0.61.0", + "windows-sys 0.61.1", ] [[package]] @@ -3853,9 +3717,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" dependencies = [ "proc-macro2", ] @@ -4015,9 +3879,9 @@ dependencies = [ [[package]] name = "read-fonts" -version = "0.29.3" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ca636dac446b5664bd16c069c00a9621806895b8bb02c2dc68542b23b8f25d" +checksum = "6717cf23b488adf64b9d711329542ba34de147df262370221940dfabc2c91358" dependencies = [ "bytemuck", "font-types", @@ -4052,18 +3916,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "regex" -version = "1.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - [[package]] name = "regex-automata" version = "0.4.11" @@ -4152,7 +4004,7 @@ version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed" dependencies = [ - "ashpd 0.11.0", + "ashpd", "block2 0.6.1", "dispatch2", "js-sys", @@ -4260,7 +4112,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.61.0", + "windows-sys 0.61.1", ] [[package]] @@ -4287,9 +4139,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.6" +version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8572f3c2cb9934231157b45499fc41e1f58c589fdfb81a844ba873265e80f8eb" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ "ring", "rustls-pki-types", @@ -4340,7 +4192,7 @@ version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.61.0", + "windows-sys 0.61.1", ] [[package]] @@ -4405,9 +4257,9 @@ checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.226" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dca6411025b24b60bfa7ec1fe1f8e710ac09782dca409ee8237ba74b51295fd" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", "serde_derive", @@ -4415,18 +4267,18 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.226" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2ba63999edb9dac981fb34b3e5c0d111a69b0924e253ed29d83f7c99e966a4" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.226" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8db53ae22f34573731bafa1db20f04027b2d25e02d8205921b569171699cdb33" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -4556,9 +4408,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "skrifa" -version = "0.31.3" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbeb4ca4399663735553a09dd17ce7e49a0a0203f03b706b39628c4d913a8607" +checksum = "8c31071dedf532758ecf3fed987cdb4bd9509f900e026ab684b4ecb81ea49841" dependencies = [ "bytemuck", "read-fonts", @@ -4726,9 +4578,9 @@ dependencies = [ [[package]] name = "swash" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f745de914febc7c9ab4388dfaf94bbc87e69f57bb41133a9b0c84d4be49856f3" +checksum = "47846491253e976bdd07d0f9cc24b7daf24720d11309302ccbbc6e6b6e53550a" dependencies = [ "skrifa", "yazi", @@ -4778,12 +4630,11 @@ dependencies = [ [[package]] name = "syntect" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" +checksum = "656b45c05d95a5704399aeef6bd0ddec7b2b3531b7c9e900abbf7c4d2190c925" dependencies = [ "bincode", - "bitflags 1.3.2", "fancy-regex", "flate2", "fnv", @@ -4791,8 +4642,7 @@ dependencies = [ "regex-syntax", "serde", "serde_derive", - "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.17", "walkdir", ] @@ -4855,7 +4705,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix 1.1.2", - "windows-sys 0.61.0", + "windows-sys 0.61.1", ] [[package]] @@ -4878,11 +4728,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.16" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.16", + "thiserror-impl 2.0.17", ] [[package]] @@ -4898,9 +4748,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.16" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", @@ -5033,9 +4883,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f63835928ca123f1bef57abbcd23bb2ba0ac9ae1235f1e65bda0d06e7786bd" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls", "tokio", @@ -5252,20 +5102,20 @@ checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" [[package]] name = "two-face" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384eda438ddf62e2c6f39a174452d952d9d9df5a8ad5ade22198609f8dcaf852" +checksum = "3d112cfd41c1387546416bcf49c4ae2a1fcacda0d42c9e97120e9798c90c0923" dependencies = [ - "once_cell", "serde", + "serde_derive", "syntect", ] [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "uds_windows" @@ -5412,12 +5262,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "value-bag" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" - [[package]] name = "vcpkg" version = "0.2.15" @@ -5756,8 +5600,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f62f1053bd28c2268f42916f31588f81f64796e2ff91b81293515017ca8bd9" dependencies = [ "arrayvec", - "bit-set 0.8.0", - "bit-vec 0.8.0", + "bit-set", + "bit-vec", "bitflags 2.9.4", "cfg_aliases", "document-features", @@ -5772,7 +5616,7 @@ dependencies = [ "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror 2.0.16", + "thiserror 2.0.17", "wgpu-core-deps-apple", "wgpu-core-deps-emscripten", "wgpu-core-deps-windows-linux-android", @@ -5816,7 +5660,7 @@ dependencies = [ "android_system_properties", "arrayvec", "ash", - "bit-set 0.8.0", + "bit-set", "bitflags 2.9.4", "block", "bytemuck", @@ -5847,7 +5691,7 @@ dependencies = [ "raw-window-handle", "renderdoc-sys", "smallvec", - "thiserror 2.0.16", + "thiserror 2.0.17", "wasm-bindgen", "web-sys", "wgpu-types", @@ -5865,7 +5709,7 @@ dependencies = [ "bytemuck", "js-sys", "log", - "thiserror 2.0.16", + "thiserror 2.0.17", "web-sys", ] @@ -5891,7 +5735,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.0", + "windows-sys 0.61.1", ] [[package]] @@ -5965,8 +5809,8 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.0", - "windows-interface 0.59.1", + "windows-implement 0.60.1", + "windows-interface 0.59.2", "windows-link 0.1.3", "windows-result 0.3.4", "windows-strings 0.4.2", @@ -5996,9 +5840,9 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.60.0" +version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +checksum = "edb307e42a74fb6de9bf3a02d9712678b22399c87e6fa869d6dfcd8c1b7754e0" dependencies = [ "proc-macro2", "quote", @@ -6018,9 +5862,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.1" +version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +checksum = "c0abd1ddbc6964ac14db11c7213d6532ef34bd9aa042c2e5935f59d7908b46a5" dependencies = [ "proc-macro2", "quote", @@ -6106,15 +5950,6 @@ dependencies = [ "windows-targets 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -6139,14 +5974,14 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.3", + "windows-targets 0.53.4", ] [[package]] name = "windows-sys" -version = "0.61.0" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +checksum = "6f109e41dd4a3c848907eb83d5a42ea98b3769495597450cf6d153507b166f0f" dependencies = [ "windows-link 0.2.0", ] @@ -6166,21 +6001,6 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -6199,11 +6019,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.3" +version = "0.53.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +checksum = "2d42b7b7f66d2a06854650af09cfdf8713e427a439c97ad65a6375318033ac4b" dependencies = [ - "windows-link 0.1.3", + "windows-link 0.2.0", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -6229,12 +6049,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -6253,12 +6067,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -6287,12 +6095,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -6323,12 +6125,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -6347,12 +6143,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -6371,12 +6161,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -6395,12 +6179,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -6416,7 +6194,7 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winit" version = "0.30.8" -source = "git+https://github.com/iced-rs/winit.git?rev=11414b6aa45699f038114e61b4ddf5102b2d3b4b#11414b6aa45699f038114e61b4ddf5102b2d3b4b" +source = "git+https://github.com/iced-rs/winit.git?rev=05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed#05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed" dependencies = [ "ahash", "android-activity", @@ -6473,16 +6251,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "winreg" version = "0.55.0" @@ -6632,7 +6400,7 @@ dependencies = [ "async-trait", "blocking", "enumflags2", - "event-listener 5.4.1", + "event-listener", "futures-core", "futures-lite", "hex", @@ -6725,9 +6493,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 032e86c..ee104dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,7 +76,7 @@ iced.default-features = false iced_widget = "0.14.0-dev" -iced_material.git = "https://github.com/pml68/iced_material" +iced_material.git = "https://git.sr.ht/~pml68/iced_material" iced_material.branch = "iced/personal" iced_material.features = ["animate", "serde", "dialog", "svg"] @@ -84,13 +84,13 @@ iced_anim.git = "https://github.com/pml68/iced_anim" iced_anim.branch = "main" iced_anim.features = ["derive"] -iced_dialog.git = "https://github.com/pml68/iced_dialog" +iced_dialog.git = "https://git.sr.ht/~pml68/iced_dialog" iced_dialog.branch = "iced/personal" iced_drop.git = "https://github.com/pml68/iced_drop" iced_drop.branch = "iced/personal" -iced_custom_highlighter.git = "https://github.com/pml68/iced_custom_highlighter" +iced_custom_highlighter.git = "https://git.sr.ht/~pml68/iced_custom_highlighter" serde = { version = "1.0.219", features = ["derive"] } serde_json = "1.0.140" @@ -150,4 +150,5 @@ clone_on_copy = "deny" [patch.crates-io] iced_core = { git = "https://github.com/pml68/iced", branch = "feat/rehighlight-on-redraw" } iced_widget = { git = "https://github.com/pml68/iced", branch = "feat/rehighlight-on-redraw" } +iced_winit = { git = "https://github.com/pml68/iced", branch = "feat/rehighlight-on-redraw" } iced = { git = "https://github.com/pml68/iced", branch = "feat/rehighlight-on-redraw" } diff --git a/src/appearance.rs b/src/appearance.rs index 4d73ec5..0af9879 100644 --- a/src/appearance.rs +++ b/src/appearance.rs @@ -2,31 +2,31 @@ use std::sync::Arc; use iced_material::Theme; -pub fn iced_theme_from_str(theme_name: &str) -> iced::Theme { +pub fn iced_theme_from_str(theme_name: &str) -> Option { match theme_name { - "Light" => iced::Theme::Light, - "Dark" => iced::Theme::Dark, - "Dracula" => iced::Theme::Dracula, - "Nord" => iced::Theme::Nord, - "Solarized Light" => iced::Theme::SolarizedLight, - "Solarized Dark" => iced::Theme::SolarizedDark, - "Gruvbox Light" => iced::Theme::GruvboxLight, - "Gruvbox Dark" => iced::Theme::GruvboxDark, - "Catppuccin Latte" => iced::Theme::CatppuccinLatte, - "Catppuccin Frappé" => iced::Theme::CatppuccinFrappe, - "Catppuccin Macchiato" => iced::Theme::CatppuccinMacchiato, - "Catppuccin Mocha" => iced::Theme::CatppuccinMocha, - "Tokyo Night" => iced::Theme::TokyoNight, - "Tokyo Night Storm" => iced::Theme::TokyoNightStorm, - "Tokyo Night Light" => iced::Theme::TokyoNightLight, - "Kanagawa Wave" => iced::Theme::KanagawaWave, - "Kanagawa Dragon" => iced::Theme::KanagawaDragon, - "Kanagawa Lotus" => iced::Theme::KanagawaLotus, - "Moonfly" => iced::Theme::Moonfly, - "Nightfly" => iced::Theme::Nightfly, - "Oxocarbon" => iced::Theme::Oxocarbon, - "Ferra" => iced::Theme::Ferra, - _ => iced::Theme::default(), + "Light" => Some(iced::Theme::Light), + "Dark" => Some(iced::Theme::Dark), + "Dracula" => Some(iced::Theme::Dracula), + "Nord" => Some(iced::Theme::Nord), + "Solarized Light" => Some(iced::Theme::SolarizedLight), + "Solarized Dark" => Some(iced::Theme::SolarizedDark), + "Gruvbox Light" => Some(iced::Theme::GruvboxLight), + "Gruvbox Dark" => Some(iced::Theme::GruvboxDark), + "Catppuccin Latte" => Some(iced::Theme::CatppuccinLatte), + "Catppuccin Frappé" => Some(iced::Theme::CatppuccinFrappe), + "Catppuccin Macchiato" => Some(iced::Theme::CatppuccinMacchiato), + "Catppuccin Mocha" => Some(iced::Theme::CatppuccinMocha), + "Tokyo Night" => Some(iced::Theme::TokyoNight), + "Tokyo Night Storm" => Some(iced::Theme::TokyoNightStorm), + "Tokyo Night Light" => Some(iced::Theme::TokyoNightLight), + "Kanagawa Wave" => Some(iced::Theme::KanagawaWave), + "Kanagawa Dragon" => Some(iced::Theme::KanagawaDragon), + "Kanagawa Lotus" => Some(iced::Theme::KanagawaLotus), + "Moonfly" => Some(iced::Theme::Moonfly), + "Nightfly" => Some(iced::Theme::Nightfly), + "Oxocarbon" => Some(iced::Theme::Oxocarbon), + "Ferra" => Some(iced::Theme::Ferra), + _ => None, } } @@ -39,7 +39,7 @@ pub struct Appearance { impl Default for Appearance { fn default() -> Self { Self { - selected: Theme::default(), + selected: Theme::Dark, all: Theme::ALL.into(), } } diff --git a/src/config.rs b/src/config.rs index 0ef094c..98140e6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -104,7 +104,7 @@ impl Config { Some(theme) }; - let mut selected = Theme::default(); + let mut selected = Theme::Dark; let mut all = Theme::ALL.to_owned(); if let Some(index) = diff --git a/src/dialog.rs b/src/dialog.rs index c5e008c..2aefb50 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use iced::widget::{Space, text}; +use iced::widget::{space, text}; use iced_dialog::button; use iced_material::button::filled_tonal; @@ -34,7 +34,7 @@ impl From for Vec> { Action::Close => vec![button("Close", Message::DialogYes).into()], Action::UnsavedChanges(_) => vec![ button("Don't Save", Message::DialogNo).style(danger).into(), - Space::with_width(20).into(), + space().width(20).into(), button("Save", Message::DialogYes) .style(filled_tonal) .into(), diff --git a/src/main.rs b/src/main.rs index d04183a..add73ec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,13 +20,19 @@ use config::Config; use dialog::{Dialog, UnsavedChanges}; use error::Error; use iced::advanced::widget::Id; -use iced::widget::{column, container, pane_grid, pick_list, row, text_editor}; +use iced::system::theme_changes; +use iced::theme::{self, Base}; +use iced::time::Duration; +use iced::widget::{ + checkbox, column, container, pane_grid, pick_list, row, text, text_editor, +}; use iced::{ - Alignment, Length, Subscription, Task, clipboard, keyboard, window, + Alignment, Length, Subscription, Task, border, clipboard, keyboard, window, }; use iced_anim::transition::Easing; use iced_anim::{Animated, Animation}; use iced_material::Theme; +use iced_material::utils::{disabled_container, disabled_text}; use panes::{code_view, designer_view, element_list}; use types::{ Action, ConfigChangeType, DesignerPane, Element, Message, Panes, Project, @@ -79,6 +85,8 @@ struct IcedBuilder { project: Project, config: Config, theme: Animated, + theme_mode: theme::Mode, + use_system_theme: bool, pane_state: pane_grid::State, focus: Option, designer_page: DesignerPane, @@ -119,7 +127,10 @@ impl IcedBuilder { project_path, project: Project::new(), config, - theme: Animated::new(theme, Easing::EASE_IN), + theme: Animated::new(theme, Easing::EASE_IN) + .with_duration(Duration::from_millis(300)), + theme_mode: theme::Mode::Dark, + use_system_theme: false, pane_state: state, focus: None, designer_page: DesignerPane::DesignerView, @@ -203,10 +214,25 @@ impl IcedBuilder { Message::SwitchTheme(event) => { self.theme.update(event); - return self.update(ConfigChangeType::SelectedTheme.into()); + if !self.use_system_theme { + return self.update(ConfigChangeType::SelectedTheme.into()); + } } - Message::SystemThemeChanged(theme) => { - Theme::update_system_theme(theme); + Message::SystemThemeChanged(mode) => { + self.theme_mode = mode; + + if self.use_system_theme { + self.theme.set_target(Theme::default(mode)); + } + } + Message::UseSystemTheme(use_system_theme) => { + self.use_system_theme = use_system_theme; + + self.theme.set_target(if use_system_theme { + Theme::default(self.theme_mode) + } else { + self.config.selected_theme() + }); } Message::CopyCode => { return clipboard::write(self.editor_content.text()); @@ -217,13 +243,15 @@ impl IcedBuilder { self.editor_content.perform(action); } } - Message::RefreshEditorContent => match self.project.app_code() { - Ok(code) => { - self.editor_content = - text_editor::Content::with_text(&code); + Message::RefreshEditorContent => { + match self.project.app_code(self.theme_mode) { + Ok(code) => { + self.editor_content = + text_editor::Content::with_text(&code); + } + Err(error) => self.dialog = Dialog::error(error), } - Err(error) => self.dialog = Dialog::error(error), - }, + } Message::DropNewElement(name, point, _) => { return iced_drop::zones_on_point( move |zones| Message::HandleNew(name.clone(), zones), @@ -434,7 +462,7 @@ impl IcedBuilder { } } Message::CloseApp => { - return window::get_latest().and_then(window::close); + return iced::exit(); } Message::EscapePressed if self.dialog.action() == dialog::Action::Close => @@ -485,19 +513,46 @@ impl IcedBuilder { let window_events = window::events().map(|(_id, event)| Message::WindowEvent(event)); - let system_theme = - Theme::subscription().map(Message::SystemThemeChanged); + let system_theme = theme_changes().map(Message::SystemThemeChanged); Subscription::batch([keyboard, window_events, system_theme]) } fn view(&self) -> Element<'_, Message> { - let header = row![pick_list( - self.config.themes(), - Some(self.theme.target()), - |theme| Message::SwitchTheme(theme.into()) - )] - .width(200); + let header = row![ + if self.use_system_theme { + Element::from( + container(text(self.config.selected_theme().to_string())) + .padding([5, 10]) + .width(Length::Fill) + .style(|theme: &Theme| { + let color = theme.colors().surface.on_surface; + container::Style { + background: Some( + disabled_container(color).into(), + ), + text_color: Some(disabled_text(color)), + border: border::rounded(4), + ..Default::default() + } + }), + ) + } else { + Element::from( + pick_list( + self.config.themes(), + Some(self.theme.target()), + |theme| Message::SwitchTheme(theme.into()), + ) + .width(Length::Fill), + ) + }, + checkbox("Use system theme", self.use_system_theme) + .on_toggle(Message::UseSystemTheme) + ] + .spacing(10) + .align_y(Alignment::Center) + .width(500); let pane_grid = pane_grid(&self.pane_state, |id, pane, _is_maximized| { let is_focused = Some(id) == self.focus; @@ -505,7 +560,7 @@ impl IcedBuilder { Panes::Designer => match &self.designer_page { DesignerPane::DesignerView => designer_view::view( self.project.element_tree.as_ref(), - self.project.get_theme(), + self.project.get_theme(self.theme_mode), is_focused, ), DesignerPane::CodeView => { diff --git a/src/panes/designer_view.rs b/src/panes/designer_view.rs index 92364bf..48a8304 100644 --- a/src/panes/designer_view.rs +++ b/src/panes/designer_view.rs @@ -29,7 +29,7 @@ pub fn view<'a>( None => center("Open a project or begin creating one").into(), }; - let content = container(themer(designer_theme, el_tree)) + let content = container(themer(Some(designer_theme), el_tree)) .id("drop_zone") .height(Length::Fill) .width(Length::Fill); diff --git a/src/types.rs b/src/types.rs index d998d61..0014090 100644 --- a/src/types.rs +++ b/src/types.rs @@ -6,6 +6,7 @@ use std::path::PathBuf; pub use element_name::ElementName; use iced::advanced::widget::Id; +use iced::theme::Mode; use iced::widget::{pane_grid, text_editor}; use iced::window; use iced_anim::Event; @@ -25,7 +26,8 @@ pub enum Message { ConfigWrite(Result<(), Error>), SaveConfigChanges(ConfigChangeType), SwitchTheme(Event), - SystemThemeChanged(Theme), + SystemThemeChanged(Mode), + UseSystemTheme(bool), CopyCode, SwitchPane(DesignerPane), EditorAction(text_editor::Action), diff --git a/src/types/project.rs b/src/types/project.rs index ceb4f84..aac9bca 100644 --- a/src/types/project.rs +++ b/src/types/project.rs @@ -1,7 +1,7 @@ use std::path::{Path, PathBuf}; extern crate fxhash; -use iced::Theme; +use iced::theme::{Base, Mode, Theme}; use rust_format::{Formatter, PostProcess, PrettyPlease}; use serde::{Deserialize, Serialize}; @@ -31,11 +31,11 @@ impl Project { } } - pub fn get_theme(&self) -> Theme { - match &self.theme { - Some(theme) => iced_theme_from_str(theme), - None => iced::Theme::default(), - } + pub fn get_theme(&self, mode: Mode) -> Theme { + self.theme + .as_ref() + .and_then(|theme| iced_theme_from_str(theme)) + .unwrap_or_else(|| Theme::default(mode)) } pub async fn from_path(path: PathBuf) -> Result<(PathBuf, Self), Error> { @@ -90,14 +90,14 @@ impl Project { Ok(path) } - pub fn app_code(&mut self) -> Result { + pub fn app_code(&mut self, theme_mode: Mode) -> Result { use iced::debug; let codegen = debug::time("Code Generation"); let result = match self.element_tree { Some(ref element_tree) => { let (imports, view) = element_tree.codegen(); - let theme = self.get_theme(); + let theme = self.get_theme(theme_mode); let app_code = format!( r#"// Automatically generated by iced Builder -- cgit v1.2.3