From d6dae7d0c465edcfbe72d6a2f0bb8ae006aa355a Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 3 Aug 2026 19:33:35 -0400 Subject: [PATCH] fix: include missed files from rewrite --- Cargo.lock | 813 +++++++++++++++++++++++++ Cargo.toml | 2 +- __pycache__/config.cpython-314.pyc | Bin 3408 -> 0 bytes __pycache__/gui.cpython-314.pyc | Bin 9351 -> 0 bytes __pycache__/svg_parser.cpython-314.pyc | Bin 3796 -> 0 bytes src/ui/editor.rs | 153 +++++ 6 files changed, 967 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock delete mode 100644 __pycache__/config.cpython-314.pyc delete mode 100644 __pycache__/gui.cpython-314.pyc delete mode 100644 __pycache__/svg_parser.cpython-314.pyc create mode 100644 src/ui/editor.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..a43c1d4 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,813 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "cairo-rs" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc8d9aa793480744cd9a0524fef1a2e197d9eaa0f739cde19d16aba530dcb95" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8b4985713047f5faee02b8db6a6ef32bbb50269ff53c1aee716d1d195b76d54" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "cfg-expr" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb693542bcafa528e198be0ebd9d3632ca5b7c93dbe7237460e199910835997c" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "futures-channel" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" + +[[package]] +name = "futures-executor" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6754879cc9f2c66f88c6e5c35344bb0bdb0708b0352b1201815667c7eabc7458" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" + +[[package]] +name = "futures-macro" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "futures-task" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" + +[[package]] +name = "futures-util" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f420376dbee041b2db374ce4573892a36222bb3f6c0c43e24f0d67eae9b646" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f31b37b1fc4b48b54f6b91b7ef04c18e00b4585d98359dd7b998774bbd91fb" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk4" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d81e2a6c6ecba2aab60633a98df1868b03fa0bfdce8105edc27c1bccf71f0e39" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk4-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk4-sys" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d8f608d8d7d229975c4d0d026f5d3071598c4ddab3c5262b0a31840fec78d13" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gio" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b3e1f669909c326b9413bde5a742097b8c90a7d78f45326db13668984769ded" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "pin-project-lite", + "smallvec", +] + +[[package]] +name = "gio-sys" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353fdc7da7cd16da916104b1e0e4e7de380ec9c8aaa20d4d742d66310ab4b0d5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "windows-sys", +] + +[[package]] +name = "glib" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddbcf514bd1881fc1b960e4e52b4e82873f4da3bceddbd58d42827b508888100" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "smallvec", +] + +[[package]] +name = "glib-macros" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "506d23499707c7142898429757e8d9a3871d965239a2cb66dfa05052be6d6f19" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "glib-sys" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030967459f9f676851872c6304adea7825c6d462ec9b72554c733cf0c5952233" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "gobject-sys" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a861859b887a79cf461359c192c97a57d8fb0229dd291232e57aa11f6fa72c" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "graphene-rs" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb856b9c558971c3f13ab692358926da710b046932a4e087aedcc35b040d7dff" +dependencies = [ + "glib", + "graphene-sys", +] + +[[package]] +name = "graphene-sys" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7ffdfde88f3570d3705e0d8a2433e036d387a1f2930bbf47eafcb5f569fd04" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gsk4" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b867be1c5f14dcb8f552c0eff6e9a9b1da5f8b43943e8efc3a63c889d84952ff" +dependencies = [ + "cairo-rs", + "gdk4", + "glib", + "graphene-rs", + "gsk4-sys", + "libc", + "pango", +] + +[[package]] +name = "gsk4-sys" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b7c7eb2e681ee896646cfb8872b431f24d09f53ba9283289d9b10caa6707088" +dependencies = [ + "cairo-sys-rs", + "gdk4-sys", + "glib-sys", + "gobject-sys", + "graphene-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk4" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98a0a0466484f64b07b5b8184d43fa46be78eb0b8e04ae4e179af31d770b76d9" +dependencies = [ + "cairo-rs", + "field-offset", + "futures-channel", + "gdk-pixbuf", + "gdk4", + "gio", + "glib", + "graphene-rs", + "gsk4", + "gtk4-macros", + "gtk4-sys", + "libc", + "pango", +] + +[[package]] +name = "gtk4-macros" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac7179400a36a04de039c24206bb841c5596992b907b43b23ee8d5bdc40d00e" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "gtk4-sys" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f954786af0b1984425c4446b77f5ff6594346181316be3f850caab1c6f01" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk4-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "graphene-sys", + "gsk4-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "icon-color-tool" +version = "0.1.0" +dependencies = [ + "anyhow", + "gtk4", + "regex", + "serde", + "toml 0.8.23", + "walkdir", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pango" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d800d8d0de2ad5d0fb046f5344dbaba14a003cf3dd27cc21d85893d35ea316c" +dependencies = [ + "gio", + "glib", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd111a20ca90fedf03e09c59783c679c00900f1d8491cca5399f5e33609d5d6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.13+spec-1.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-deps" +version = "7.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396a35feb67335377e0251fcbc1092fc85c484bd4e3a7a54319399da127796e7" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 1.1.4+spec-1.1.0", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml" +version = "1.1.4+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.4", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_write", + "winnow 0.7.15", +] + +[[package]] +name = "toml_edit" +version = "0.25.13+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" +dependencies = [ + "indexmap", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + +[[package]] +name = "toml_parser" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +dependencies = [ + "winnow 1.0.4", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "toml_writer" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] diff --git a/Cargo.toml b/Cargo.toml index b8e5732..99982a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -gtk = { package = "gtk4", version = "0.11" } +gtk = { package = "gtk4", version = "0.11", features = ["v4_12"] } anyhow = "1" regex = "1" serde = { version = "1", features = ["derive"] } diff --git a/__pycache__/config.cpython-314.pyc b/__pycache__/config.cpython-314.pyc deleted file mode 100644 index 0df73e55deda1210b0b0e91faca08bab203f0727..0000000000000000000000000000000000000000 GIT binary patch literal 0 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mJu>A$>wCP-EN E8|<-#^8f$< diff --git a/__pycache__/gui.cpython-314.pyc b/__pycache__/gui.cpython-314.pyc deleted file mode 100644 index dca7e7f0f88c326ef2cbdcd540b37eca6999bfdd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9351 zcmdT~+ix3JdLP~o#Stm%YKf#o$&w=4x;Tz4C$W=Qw&Tz@g`&K)Q_JGg~2;+e{|LoFQlFZiM-Pp$Ccuc5Ha&2lNnX)fWA z90{l7Ot>Uh!Y#QI9?6sNO5TJ|@+F8w5`M{_XpkCu@O$U!K!TU}M5EN02ueX#=Q^{9K(JVEyvgdS5qE%|`;o7)fF6HguQobv`gD!0iQX8u!Q0u?qH)`8c4STqF z;1Bpwyg~I%T`c711xXD|rH_|yoy*=XFX2nVeDO}5%U%_VDnE6iTrAU*g>11r51&lu zXt`LNph8ylPMxCJMM3pXO;?HqNfIcupU)Ob7Yn6)`6j*yqL`f*VAQw^K4&Ar-YUj$1H20Px<>=swL~^H`9h~GzxghtZ+>$TtkVu+4;*k7sG#)j; zrkTE(m2wL?w`CqI!|9S2PhrBNFv*P3IPFPuKZV;rSgYybE;g0)WpNi{rP{54-0UwI zW2U)ez!<_P%breSuWoY; zz4Rk`#q@8@=MQ>~nDu%|KieKaAy5R@A5bnXOvXD@kGNC;ohF$~p;VAE8Pz3a=T(0W z@gTDx+)_!ol*ttfx$A19C`b$prls3Of%;(x)ib@2tq5v>Rppb}5}=6}>JS>dscbbUn>B1dBZG)Z@ zOH%n%p;$bg&0U|T<)uyTx2PecKLh*Ciee@s;@Sow#g^5Pv4!%YFh=cJ>(}ECk3Kl6gx`|GZ~boW?-&1eQ5ioYkDvLc@R=$(yMv!~%A|9xw@M<< zc17+-SG-VpFSr`~>_(MzKkJCDFineZ*}g4a`0Ju!~UkGV0Duc@U|RL2FI- zgKjn|^uncXlkf}JK9@5v6kbp&82ILDJL=ml+@-QWtUJwK+?xct#svk5=6IK!TI5D}xfe|-D#_05UPn|(9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?}{2MO( iuiU_Q?q0{cpACM;!Q;DAj#-Ce&u8I(=kUpn<-Y+gN4HY| diff --git a/__pycache__/svg_parser.cpython-314.pyc b/__pycache__/svg_parser.cpython-314.pyc deleted file mode 100644 index 0b8ed1ade6d5eed56c898f996481e68c262fb16c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3796 zcmeHK-BTOa6~8O3q!n6WLW~5KY`zl08YFN`VkgDK6zqn8u|{^4P7U6!R|~8WTKVpk ziE%yQtzyO#$C>G1HxGukGuUrUr!#3D`yZf+R`NETcBXmhTMC_~ee1bbp9se7Lmztw z&YpYExnJjZKCb#2y$uMOuaLU=hJestXs6ux60;WuW))pWQEmbe`n64P@7jp19krlN z6t(+NlpnGcwTV5-btB2~SK6JHIE#-cWI-(oipZdhkOBMn z5#ggYpbok^aYlKduBZd35Oo4|M_r^LhKMIBz;14<@yhM_F(YB%h=NTGtEJPho#;L6 z2nl;~=&r1VX|FPy z^_*o{3`LHV`RaG5#I}Q_yU{cIiX%O__;|9(WmWdXH> zc>%~O`m#0n=zE_wX88NwfCw5rmf64og$ z#=TY=j{g9mAox^-TCuKOuXtL@R&yd2d;3-4L|n{Pj;547W^Y2@<$M(Eb~ zi`S3whstebPrqTCd=()#IsxmYc<{{1?WnKO|1`ukmFY;bubdq=$(@9D?fS^<$#?Yl zxh^%0F?d$V159;6Thh9ic%(Oc@*Qb-fK3=#IX@HbWf6IW>4dH+p_S3l_Xk67&Gtz% z=E<46K$suB4NPx0$md2w7peU2>HatGNz;sntRdT_>%%!h_C!S3HWOBQAaeHYc7rdLf^!!`z=8jE#aqbt&lQWOcY@GV^?TuSo z%bUwjZ~biLw}De%oXZ}Y$c%q9`8PKb{r}n(P~bhzq=5bARq5Nuc(vq(Fn|!f2J`zb zncu(P6k)^r$y*?cgH{myzMFdfelhFCxc+0+Ver8JIv;{&#ha=tls&JV?gurdzC|do zb*-8KXDG0&MHF^8PiN&2?(ftwbCT5!7-}{(i@ycPmv2h@%P? zpm}gQ1q=8O3ahsTdE1NR6g7#Pmb}d0F?C4Gsiaa`GS1=yQyW8Z>g16f4{PviRH!^Is>=jNM* zX5V_>!@fuA@0z-x}Q#*nLqj{k%E41Z>_N>spBXs^oJ% zo1fhLdGl7=PurfJ$#tIoRrK@O&t`MJu?$p=uJsQeez>vxx%iow^Pi(75Nrz2Iw=6r8JXPxSnEyqV>jlxz55AL&)pMJPrgb3-|G^dGkU?R_NF`x)t0E zLQxeuelMIqctd)2_!sv6!R8)*!%CH#XI1WhnG;~w`gT|iD@RFftif4dm_0yFW2CN? zR|5M(Jkj^+GuzdRl8eO?3nAPIQ;HSGo-$IH-kyaB9t5ri4U11FL&7$HVzRUpCN}3xqP`_oqPj z!Nl6c{YlD9u1(&*^!#Q2^CL(94-{7~zO>svI0fhNLe>Tvc4-94lgSo)#{}DvUx3szy zGdF!TRvmC!66sqysVr&mmTr*cB_p0rP+pYfTWKXxk{prcIUSoMp(nMZA#A=aclPE-2Wk};#zmX=I32VM2%j{Vc*HxlwiG(b}Zw+tFAWWkf=zK8) z(UgcOq4~``3FMzY0vqkxoDSb^lgsfQx7+Lm_5|k`<#wGeN6R Result { + let scheme = ColorScheme::load(icon_path)?; + let scheme = Rc::new(RefCell::new(scheme)); + + let root = GtkBox::new(Orientation::Vertical, 8); + root.set_margin_top(8); + root.set_margin_bottom(8); + root.set_margin_start(8); + root.set_margin_end(8); + + let toolbar = GtkBox::new(Orientation::Horizontal, 8); + let back_button = gtk::Button::with_label("← Choose another icon"); + back_button.connect_clicked(move |_| on_back()); + toolbar.append(&back_button); + + let undo_button = gtk::Button::with_label("Undo"); + let redo_button = gtk::Button::with_label("Redo"); + toolbar.append(&undo_button); + toolbar.append(&redo_button); + root.append(&toolbar); + + if scheme.borrow().colors.is_empty() { + let info = InfoBar::new(); + info.set_message_type(MessageType::Warning); + info.add_child(&Label::new(Some( + "No ColorScheme tags were found in this SVG.", + ))); + root.append(&info); + } + + let content = GtkBox::new(Orientation::Horizontal, 8); + content.set_vexpand(true); + + let swatches_scroller = ScrolledWindow::new(); + swatches_scroller.set_min_content_width(300); + let swatches_box = GtkBox::new(Orientation::Vertical, 4); + swatches_scroller.set_child(Some(&swatches_box)); + content.append(&swatches_scroller); + + let preview = Picture::new(); + preview.set_hexpand(true); + content.append(&preview); + + root.append(&content); + + let refresh_preview = { + let scheme = Rc::clone(&scheme); + let preview = preview.clone(); + move || { + let bytes = glib::Bytes::from_owned(scheme.borrow().content.clone().into_bytes()); + match gtk::gdk::Texture::from_bytes(&bytes) { + Ok(texture) => preview.set_paintable(Some(&texture)), + Err(_) => preview.set_paintable(gtk::gdk::Paintable::NONE), + } + } + }; + refresh_preview(); + + let rebuild_swatches: Rc>> = Rc::new(RefCell::new(Box::new(|| {}))); + { + let scheme = Rc::clone(&scheme); + let swatches_box = swatches_box.clone(); + let refresh_preview = refresh_preview.clone(); + let rebuild_swatches_for_closure = Rc::clone(&rebuild_swatches); + + let build_fn = move || { + while let Some(child) = swatches_box.first_child() { + swatches_box.remove(&child); + } + + let tags: Vec<(String, String)> = scheme.borrow().colors.clone(); + for (tag, hex) in tags { + let row = GtkBox::new(Orientation::Horizontal, 8); + let label = Label::new(Some(&tag)); + label.set_hexpand(true); + label.set_xalign(0.0); + + let rgba = gtk::gdk::RGBA::parse(&hex).unwrap_or(gtk::gdk::RGBA::BLACK); + let dialog = ColorDialog::builder().with_alpha(false).build(); + let button = ColorDialogButton::new(Some(dialog)); + button.set_rgba(&rgba); + + { + let scheme = Rc::clone(&scheme); + let tag = tag.clone(); + let refresh_preview = refresh_preview.clone(); + let rebuild_swatches_for_closure = Rc::clone(&rebuild_swatches_for_closure); + button.connect_rgba_notify(move |btn| { + let new_rgba = btn.rgba(); + let new_hex = format!( + "#{:02x}{:02x}{:02x}", + (new_rgba.red() * 255.0).round() as u8, + (new_rgba.green() * 255.0).round() as u8, + (new_rgba.blue() * 255.0).round() as u8, + ); + let changed = scheme + .borrow_mut() + .update_color(&tag, &new_hex) + .unwrap_or(false); + if changed { + refresh_preview(); + (rebuild_swatches_for_closure.borrow())(); + } + }); + } + + row.append(&label); + row.append(&button); + swatches_box.append(&row); + } + }; + + *rebuild_swatches.borrow_mut() = Box::new(build_fn); + } + (rebuild_swatches.borrow())(); + + { + let scheme = Rc::clone(&scheme); + let refresh_preview = refresh_preview.clone(); + let rebuild_swatches = Rc::clone(&rebuild_swatches); + undo_button.connect_clicked(move |_| { + if scheme.borrow_mut().undo().unwrap_or(false) { + refresh_preview(); + (rebuild_swatches.borrow())(); + } + }); + } + { + let scheme = Rc::clone(&scheme); + let refresh_preview = refresh_preview.clone(); + let rebuild_swatches = Rc::clone(&rebuild_swatches); + redo_button.connect_clicked(move |_| { + if scheme.borrow_mut().redo().unwrap_or(false) { + refresh_preview(); + (rebuild_swatches.borrow())(); + } + }); + } + + Ok(root.upcast()) +}