From 89e1dcb83a91bb9f2718e971d2f8e1e6d4c9c021 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 09:55:46 -0700 Subject: [PATCH 01/25] Color Schemes (#142) * WIP: Color Schemes * Import/export using color_schemes config * Finish color scheme implementation * Add color scheme rename --- Cargo.lock | 1493 ++++++++++++++++++++++----- Cargo.toml | 20 +- color-schemes/COSMIC Dark.ron | 37 + color-schemes/COSMIC Light.ron | 37 + color-schemes/Linux Console.ron | 38 + color-schemes/OneHalfDark.ron | 38 + color-schemes/Pop Dark.ron | 38 + color-schemes/Rxvt Dark.ron | 38 + color-schemes/Rxvt Light.ron | 38 + color-schemes/Selenized Black.ron | 37 + color-schemes/Selenized Dark.ron | 37 + color-schemes/Selenized Light.ron | 37 + color-schemes/Selenized White.ron | 37 + color-schemes/Solarized Dark.ron | 38 + color-schemes/Solarized Light.ron | 38 + color-schemes/Tango Dark.ron | 38 + color-schemes/Tango Light.ron | 38 + color-schemes/XTerm Dark.ron | 38 + color-schemes/XTerm Light.ron | 38 + color-schemes/gruvbox-dark.ron | 38 + i18n/en/cosmic_term.ftl | 9 + res/icons/dialog-error-symbolic.svg | 11 + res/icons/view-more-symbolic.svg | 10 + src/config.rs | 157 ++- src/icon_cache.rs | 2 + src/main.rs | 331 +++++- src/menu.rs | 35 +- src/terminal_theme.rs | 745 +++---------- 28 files changed, 2630 insertions(+), 861 deletions(-) create mode 100644 color-schemes/COSMIC Dark.ron create mode 100644 color-schemes/COSMIC Light.ron create mode 100644 color-schemes/Linux Console.ron create mode 100644 color-schemes/OneHalfDark.ron create mode 100644 color-schemes/Pop Dark.ron create mode 100644 color-schemes/Rxvt Dark.ron create mode 100644 color-schemes/Rxvt Light.ron create mode 100644 color-schemes/Selenized Black.ron create mode 100644 color-schemes/Selenized Dark.ron create mode 100644 color-schemes/Selenized Light.ron create mode 100644 color-schemes/Selenized White.ron create mode 100644 color-schemes/Solarized Dark.ron create mode 100644 color-schemes/Solarized Light.ron create mode 100644 color-schemes/Tango Dark.ron create mode 100644 color-schemes/Tango Light.ron create mode 100644 color-schemes/XTerm Dark.ron create mode 100644 color-schemes/XTerm Light.ron create mode 100644 color-schemes/gruvbox-dark.ron create mode 100644 res/icons/dialog-error-symbolic.svg create mode 100644 res/icons/view-more-symbolic.svg diff --git a/Cargo.lock b/Cargo.lock index 4c75619..bae32f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser", + "owned_ttf_parser 0.20.0", ] [[package]] @@ -84,7 +84,7 @@ dependencies = [ "accesskit_unix", "accesskit_windows", "raw-window-handle 0.6.0", - "winit", + "winit 0.29.10", ] [[package]] @@ -103,12 +103,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "ahash" -version = "0.8.8" +name = "adler32" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "ahash" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "getrandom", "once_cell", "version_check", @@ -135,7 +141,7 @@ dependencies = [ "home", "libc", "log", - "miow", + "miow 0.6.0", "parking_lot 0.12.1", "piper", "polling 3.4.0", @@ -166,6 +172,19 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3aa2999eb46af81abb65c2d30d446778d7e613b60bbf4e174a027e80f90a3c14" +[[package]] +name = "andrew" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" +dependencies = [ + "bitflags 1.3.2", + "rusttype", + "walkdir", + "xdg", + "xml-rs", +] + [[package]] name = "android-activity" version = "0.5.2" @@ -180,10 +199,10 @@ dependencies = [ "jni-sys", "libc", "log", - "ndk", + "ndk 0.8.0", "ndk-context", - "ndk-sys", - "num_enum", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.2", "thiserror", ] @@ -193,6 +212,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -202,6 +227,54 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "any_ascii" version = "0.1.7" @@ -235,6 +308,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "arrayvec" version = "0.7.4" @@ -291,7 +370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 5.0.0", + "event-listener 5.1.0", "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", @@ -331,7 +410,7 @@ checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock 2.8.0", "autocfg", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "futures-lite 1.13.0", "log", @@ -350,7 +429,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" dependencies = [ "async-lock 3.3.0", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "futures-io", "futures-lite 2.2.0", @@ -392,7 +471,7 @@ dependencies = [ "async-lock 2.8.0", "async-signal", "blocking", - "cfg-if", + "cfg-if 1.0.0", "event-listener 3.1.0", "futures-lite 1.13.0", "rustix 0.38.28", @@ -407,7 +486,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -419,7 +498,7 @@ dependencies = [ "async-io 2.3.1", "async-lock 2.8.0", "atomic-waker", - "cfg-if", + "cfg-if 1.0.0", "futures-core", "futures-io", "rustix 0.38.28", @@ -442,7 +521,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -535,9 +614,9 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.7.2", "object", "rustc-demangle", ] @@ -646,9 +725,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "c764d619ca78fccbf3069b37bd7af92577f044bb15236036662d79b6559f25b7" [[package]] name = "bytemuck" @@ -667,7 +746,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -692,6 +771,16 @@ dependencies = [ "system-deps", ] +[[package]] +name = "calloop" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" +dependencies = [ + "log", + "nix 0.18.0", +] + [[package]] name = "calloop" version = "0.12.4" @@ -712,10 +801,10 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ - "calloop", + "calloop 0.12.4", "rustix 0.38.28", "wayland-backend", - "wayland-client", + "wayland-client 0.31.2", ] [[package]] @@ -744,6 +833,12 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -763,10 +858,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f" [[package]] -name = "clipboard-win" -version = "5.1.0" +name = "chrono" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec832972fefb8cf9313b45a0d1945e29c9c251f1d4c6eafc5fe2124c02d2e81" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "pure-rust-locales", + "wasm-bindgen", + "windows-targets 0.52.0", +] + +[[package]] +name = "clipboard-win" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9a0700e0127ba15d1d52dd742097f821cd9c65939303a44d970465040a297" dependencies = [ "error-code", ] @@ -784,23 +894,39 @@ dependencies = [ [[package]] name = "clipboard_wayland" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8134163bd07c47ae3cc29babc42c255fdb315facc790950ae2d0e561ea6f2ec0" +checksum = "003f886bc4e2987729d10c1db3424e7f80809f3fc22dbc16c685738887cb37b8" dependencies = [ "smithay-clipboard", ] [[package]] name = "clipboard_x11" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf45b436634fee64c6d3981639b46a87eeea3c64e422643273fcefd1baef56c" +checksum = "4274ea815e013e0f9f04a2633423e14194e408a0576c943ce3d14ca56c50031c" dependencies = [ "thiserror", "x11rb", ] +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation 0.9.4", + "core-graphics 0.22.3", + "foreign-types 0.3.2", + "libc", + "objc", +] + [[package]] name = "cocoa" version = "0.25.0" @@ -810,9 +936,9 @@ dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types", + "core-foundation 0.9.4", + "core-graphics 0.23.1", + "foreign-types 0.5.0", "libc", "objc", ] @@ -825,7 +951,7 @@ checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" dependencies = [ "bitflags 1.3.2", "block", - "core-foundation", + "core-foundation 0.9.4", "core-graphics-types", "libc", "objc", @@ -847,6 +973,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "com" version = "0.6.0" @@ -917,22 +1049,63 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys 0.7.0", + "libc", +] + [[package]] name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.8.6", "libc", ] +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + [[package]] name = "core-foundation-sys" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "core-graphics" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.7.0", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "core-graphics-types", + "foreign-types 0.3.2", + "libc", +] + [[package]] name = "core-graphics" version = "0.23.1" @@ -940,9 +1113,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -953,14 +1126,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "libc", ] +[[package]] +name = "core-video-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +dependencies = [ + "cfg-if 0.1.10", + "core-foundation-sys 0.7.0", + "core-graphics 0.19.2", + "libc", + "objc", +] + [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -977,22 +1163,49 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "quote", "syn 1.0.109", ] +[[package]] +name = "cosmic-files" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-files#4f1912384711665f5f7fca4d187434985ba8a130" +dependencies = [ + "chrono", + "dirs", + "env_logger 0.11.2", + "fork", + "i18n-embed 0.14.1", + "i18n-embed-fl 0.7.0", + "lexical-sort", + "libcosmic", + "log", + "notify", + "once_cell", + "paste", + "rust-embed 8.2.0", + "serde", + "smol_str", + "systemicons", + "tokio", + "trash", +] + [[package]] name = "cosmic-term" version = "0.1.0" dependencies = [ "alacritty_terminal", + "cosmic-files", "cosmic-text", - "env_logger", + "env_logger 0.10.2", "fork", - "i18n-embed", - "i18n-embed-fl", + "hex_color", + "i18n-embed 0.13.9", + "i18n-embed-fl 0.6.7", "indexmap", "lazy_static", "lexical-sort", @@ -1000,7 +1213,8 @@ dependencies = [ "log", "palette", "paste", - "rust-embed", + "ron", + "rust-embed 6.8.1", "serde", "shlex", "smol_str", @@ -1010,7 +1224,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.11.2" -source = "git+https://github.com/pop-os/cosmic-text.git#0cb6eba6e708e2743313ee0016162de7a0146353" +source = "git+https://github.com/pop-os/cosmic-text.git#85821731285bf88d712dce8e7410453d908bc038" dependencies = [ "bitflags 2.4.2", "fontdb", @@ -1022,7 +1236,7 @@ dependencies = [ "self_cell 1.0.3", "swash", "sys-locale", - "ttf-parser", + "ttf-parser 0.20.0", "unicode-bidi", "unicode-linebreak", "unicode-script", @@ -1032,7 +1246,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "almost", "cosmic-config", @@ -1058,7 +1272,20 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", ] [[package]] @@ -1089,6 +1316,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -1113,9 +1349,9 @@ dependencies = [ [[package]] name = "css-color" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d101c65424c856131a3cb818da2ddde03500dc3656972269cdf79f018ef77eb4" +checksum = "42aaeae719fd78ce501d77c6cdf01f7e96f26bcd5617a4903a1c2b97e388543a" [[package]] name = "csscolorparser" @@ -1134,9 +1370,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.50", ] +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + [[package]] name = "cursor-icon" version = "1.1.0" @@ -1155,37 +1397,72 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.5" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.10.2", + "darling_macro 0.10.2", +] + +[[package]] +name = "darling" +version = "0.20.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" +dependencies = [ + "darling_core 0.20.6", + "darling_macro 0.20.6", ] [[package]] name = "darling_core" -version = "0.20.5" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.48", + "strsim 0.9.3", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 2.0.50", ] [[package]] name = "darling_macro" -version = "0.20.5" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ - "darling_core", + "darling_core 0.10.2", "quote", - "syn 2.0.48", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" +dependencies = [ + "darling_core 0.20.6", + "quote", + "syn 2.0.50", ] [[package]] @@ -1194,7 +1471,7 @@ version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "hashbrown", "lock_api", "once_cell", @@ -1207,6 +1484,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" +[[package]] +name = "deflate" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" +dependencies = [ + "adler32", + "byteorder", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1224,10 +1511,10 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" dependencies = [ - "darling", + "darling 0.20.6", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -1249,6 +1536,16 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" version = "0.4.1" @@ -1261,6 +1558,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -1275,7 +1583,16 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", +] + +[[package]] +name = "dlib" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" +dependencies = [ + "libloading 0.6.7", ] [[package]] @@ -1365,7 +1682,17 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", +] + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", ] [[package]] @@ -1381,6 +1708,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1452,9 +1792,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" +checksum = "b7ad6fd685ce13acd6d9541a30f6db6567a7a24c9ffd4ba2955d29e3f22c8b27" dependencies = [ "concurrent-queue", "parking", @@ -1477,7 +1817,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" dependencies = [ - "event-listener 5.0.0", + "event-listener 5.1.0", "pin-project-lite", ] @@ -1491,7 +1831,7 @@ dependencies = [ "flume", "half", "lebe", - "miniz_oxide", + "miniz_oxide 0.7.2", "rayon-core", "smallvec", "zune-inflate", @@ -1533,7 +1873,7 @@ version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall 0.4.1", "windows-sys 0.52.0", @@ -1555,7 +1895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.7.2", ] [[package]] @@ -1646,16 +1986,25 @@ dependencies = [ [[package]] name = "fontdb" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3890d0893c8253d3eb98337af18b3e1a10a9b2958f2a164b53a93fb3a3049e72" +checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" dependencies = [ "fontconfig-parser", "log", - "memmap2", + "memmap2 0.9.4", "slotmap", "tinyvec", - "ttf-parser", + "ttf-parser 0.20.0", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", ] [[package]] @@ -1665,7 +2014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared", + "foreign-types-shared 0.3.1", ] [[package]] @@ -1676,9 +2025,15 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -1715,9 +2070,9 @@ dependencies = [ [[package]] name = "freedesktop-icons" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5339cbd60b2ff6b95ef212ab96bc80bf1a9dff2821b9966c417cdfae2808796" +checksum = "a8ef34245e0540c9a3ce7a28340b98d2c12b75da0d446da4e8224923fcaa0c16" dependencies = [ "dirs", "once_cell", @@ -1820,7 +2175,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -1909,11 +2264,21 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi", ] +[[package]] +name = "gif" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gif" version = "0.12.0" @@ -1970,6 +2335,12 @@ dependencies = [ "system-deps", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "glow" version = "0.13.1" @@ -2105,7 +2476,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crunchy", ] @@ -2142,9 +2513,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -2152,6 +2523,17 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex_color" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37f101bf4c633f7ca2e4b5e136050314503dd198e78e325ea602c327c484ef0" +dependencies = [ + "arrayvec 0.7.4", + "rand", + "serde", +] + [[package]] name = "hexf-parse" version = "0.2.1" @@ -2203,7 +2585,29 @@ dependencies = [ "locale_config", "log", "parking_lot 0.12.1", - "rust-embed", + "rust-embed 6.8.1", + "thiserror", + "unic-langid", + "walkdir", +] + +[[package]] +name = "i18n-embed" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94205d95764f5bb9db9ea98fa77f89653365ca748e27161f5bbea2ffd50e459c" +dependencies = [ + "arc-swap", + "fluent", + "fluent-langneg", + "fluent-syntax", + "i18n-embed-impl", + "intl-memoizer", + "lazy_static", + "locale_config", + "log", + "parking_lot 0.12.1", + "rust-embed 8.2.0", "thiserror", "unic-langid", "walkdir", @@ -2220,13 +2624,34 @@ dependencies = [ "fluent", "fluent-syntax", "i18n-config", - "i18n-embed", + "i18n-embed 0.13.9", "lazy_static", "proc-macro-error", "proc-macro2", "quote", - "strsim", - "syn 2.0.48", + "strsim 0.10.0", + "syn 2.0.50", + "unic-langid", +] + +[[package]] +name = "i18n-embed-fl" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc1f8715195dffc4caddcf1cf3128da15fe5d8a137606ea8856c9300047d5a2" +dependencies = [ + "dashmap", + "find-crate", + "fluent", + "fluent-syntax", + "i18n-config", + "i18n-embed 0.14.1", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 2.0.50", "unic-langid", ] @@ -2240,13 +2665,36 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys 0.8.6", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", ] [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "iced_accessibility", "iced_core", @@ -2254,14 +2702,14 @@ dependencies = [ "iced_renderer", "iced_widget", "iced_winit", - "image", + "image 0.24.8", "thiserror", ] [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "accesskit", "accesskit_winit", @@ -2270,7 +2718,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "bitflags 1.3.2", "log", @@ -2287,7 +2735,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "futures", "iced_core", @@ -2300,7 +2748,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2309,7 +2757,7 @@ dependencies = [ "half", "iced_core", "iced_futures", - "image", + "image 0.24.8", "kamadak-exif", "log", "lyon_path", @@ -2324,7 +2772,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2336,7 +2784,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "iced_core", "iced_futures", @@ -2346,7 +2794,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "iced_core", "once_cell", @@ -2356,7 +2804,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "bytemuck", "cosmic-text", @@ -2373,7 +2821,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2392,7 +2840,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "iced_renderer", "iced_runtime", @@ -2406,7 +2854,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "iced_graphics", "iced_runtime", @@ -2417,7 +2865,7 @@ dependencies = [ "web-sys", "winapi", "window_clipboard", - "winit", + "winit 0.29.10", ] [[package]] @@ -2457,6 +2905,25 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "image" +version = "0.23.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "gif 0.11.4", + "jpeg-decoder 0.1.22", + "num-iter", + "num-rational 0.3.2", + "num-traits", + "png 0.16.8", + "scoped_threadpool", + "tiff 0.6.1", +] + [[package]] name = "image" version = "0.24.8" @@ -2467,12 +2934,12 @@ dependencies = [ "byteorder", "color_quant", "exr", - "gif", - "jpeg-decoder", + "gif 0.12.0", + "jpeg-decoder 0.3.1", "num-traits", - "png", + "png 0.17.13", "qoi", - "tiff", + "tiff 0.9.1", ] [[package]] @@ -2517,7 +2984,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -2574,7 +3041,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", - "cfg-if", + "cfg-if 1.0.0", "combine", "jni-sys", "log", @@ -2598,6 +3065,15 @@ dependencies = [ "libc", ] +[[package]] +name = "jpeg-decoder" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" +dependencies = [ + "rayon", +] + [[package]] name = "jpeg-decoder" version = "0.3.1" @@ -2677,7 +3153,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", ] [[package]] @@ -2692,6 +3168,19 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" +[[package]] +name = "lexical-core" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" +dependencies = [ + "arrayvec 0.5.2", + "bitflags 1.3.2", + "cfg-if 1.0.0", + "ryu", + "static_assertions", +] + [[package]] name = "lexical-sort" version = "0.3.1" @@ -2709,7 +3198,7 @@ source = "git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox_0.2. [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355" +source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" dependencies = [ "apply", "ashpd", @@ -2742,13 +3231,23 @@ dependencies = [ "zbus", ] +[[package]] +name = "libloading" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + [[package]] name = "libloading" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "winapi", ] @@ -2758,7 +3257,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] @@ -2872,7 +3371,7 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edecfb8d234a2b0be031ab02ebcdd9f3b9ee418fb35e265f7a540a48d197bff9" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "euclid", "num-traits", ] @@ -2913,6 +3412,15 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +[[package]] +name = "memmap2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +dependencies = [ + "libc", +] + [[package]] name = "memmap2" version = "0.9.4" @@ -2949,12 +3457,37 @@ dependencies = [ "bitflags 2.4.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "log", "objc", "paste", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +dependencies = [ + "adler32", +] + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + [[package]] name = "miniz_oxide" version = "0.7.2" @@ -2965,6 +3498,19 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow 0.3.7", + "ntapi", + "winapi", +] + [[package]] name = "mio" version = "0.8.10" @@ -2977,6 +3523,27 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio-misc" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47412f3a52115b936ff2a229b803498c7b4d332adeb87c2f1498c9da54c398c" +dependencies = [ + "crossbeam", + "crossbeam-queue", + "log", + "mio 0.7.14", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + [[package]] name = "miow" version = "0.6.0" @@ -2997,7 +3564,7 @@ name = "naga" version = "0.19.0" source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "bit-set", "bitflags 2.4.2", "codespan-reporting", @@ -3012,6 +3579,18 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "ndk" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" +dependencies = [ + "jni-sys", + "ndk-sys 0.2.2", + "num_enum 0.5.11", + "thiserror", +] + [[package]] name = "ndk" version = "0.8.0" @@ -3021,8 +3600,8 @@ dependencies = [ "bitflags 2.4.2", "jni-sys", "log", - "ndk-sys", - "num_enum", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.2", "raw-window-handle 0.6.0", "thiserror", ] @@ -3033,6 +3612,39 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" +[[package]] +name = "ndk-glue" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.3.0", + "ndk-macro", + "ndk-sys 0.2.2", +] + +[[package]] +name = "ndk-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling 0.10.2", + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ndk-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" + [[package]] name = "ndk-sys" version = "0.5.0+25.2.9519653" @@ -3042,6 +3654,30 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "nix" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if 0.1.10", + "libc", +] + +[[package]] +name = "nix" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if 1.0.0", + "libc", +] + [[package]] name = "nix" version = "0.26.4" @@ -3049,11 +3685,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", - "cfg-if", + "cfg-if 1.0.0", "libc", "memoffset 0.7.1", ] +[[package]] +name = "nom" +version = "5.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" +dependencies = [ + "lexical-core", + "memchr", + "version_check", +] + [[package]] name = "notify" version = "6.1.1" @@ -3068,11 +3715,20 @@ dependencies = [ "kqueue", "libc", "log", - "mio", + "mio 0.8.10", "walkdir", "windows-sys 0.48.0", ] +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi", +] + [[package]] name = "num" version = "0.4.1" @@ -3083,7 +3739,7 @@ dependencies = [ "num-complex", "num-integer", "num-iter", - "num-rational", + "num-rational 0.4.1", "num-traits", ] @@ -3127,6 +3783,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.1" @@ -3159,13 +3826,34 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive 0.5.11", +] + [[package]] name = "num_enum" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.7.2", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -3177,7 +3865,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -3328,7 +4016,16 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e6affeb1632d6ff6a23d2cd40ffed138e82f1532571a26f527c8a284bb2fbb" +dependencies = [ + "ttf-parser 0.15.2", ] [[package]] @@ -3337,7 +4034,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" dependencies = [ - "ttf-parser", + "ttf-parser 0.20.0", ] [[package]] @@ -3361,7 +4058,7 @@ checksum = "e05d1c929301fee6830dafa764341118829b2535c216b0571e3821ecac5c885b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -3409,7 +4106,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "instant", "libc", "redox_syscall 0.2.16", @@ -3423,7 +4120,7 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall 0.4.1", "smallvec", @@ -3472,7 +4169,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -3515,21 +4212,33 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "png" -version = "0.17.11" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "deflate", + "miniz_oxide 0.3.7", +] + +[[package]] +name = "png" +version = "0.17.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.2", ] [[package]] @@ -3540,7 +4249,7 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "libc", "log", @@ -3554,7 +4263,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "pin-project-lite", "rustix 0.38.28", @@ -3574,6 +4283,15 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml 0.5.11", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -3628,9 +4346,15 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0f7f43585c34e4fdd7497d746bc32e14458cf11c69341cc0587b1d825dde42" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" + +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" [[package]] name = "qoi" @@ -3701,6 +4425,25 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "795915a3930a5d6bafd9053d37602fea3e61be2e5d4d788983a8ba9654c1c6f2" +[[package]] +name = "raw-window-handle" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" +dependencies = [ + "libc", + "raw-window-handle 0.4.3", +] + +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + [[package]] name = "raw-window-handle" version = "0.5.2" @@ -3741,9 +4484,9 @@ checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" [[package]] name = "read-fonts" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70252c718fb23d41771a4f927e924700edefc2a91ecd52a2ee6f2461d4e6b64" +checksum = "c044ab88c43e2eae05b34a17fc13598736679fdb03d71b49fcfe114443ec8a86" dependencies = [ "font-types", ] @@ -3827,11 +4570,11 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadccb3d99a9efb8e5e00c16fbb732cbe400db2ec7fc004697ee7d97d86cf1f4" dependencies = [ - "gif", - "jpeg-decoder", + "gif 0.12.0", + "jpeg-decoder 0.3.1", "log", "pico-args", - "png", + "png 0.17.13", "rgb", "svgtypes", "tiny-skia", @@ -3895,8 +4638,19 @@ version = "6.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" dependencies = [ - "rust-embed-impl", - "rust-embed-utils", + "rust-embed-impl 6.8.1", + "rust-embed-utils 7.8.1", + "walkdir", +] + +[[package]] +name = "rust-embed" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" +dependencies = [ + "rust-embed-impl 8.2.0", + "rust-embed-utils 8.2.0", "walkdir", ] @@ -3908,8 +4662,21 @@ checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" dependencies = [ "proc-macro2", "quote", - "rust-embed-utils", - "syn 2.0.48", + "rust-embed-utils 7.8.1", + "syn 2.0.50", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils 8.2.0", + "syn 2.0.50", "walkdir", ] @@ -3923,13 +4690,23 @@ dependencies = [ "walkdir", ] +[[package]] +name = "rust-embed-utils" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" +dependencies = [ + "sha2", + "walkdir", +] + [[package]] name = "rust-ini" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "ordered-multimap", ] @@ -3984,6 +4761,16 @@ dependencies = [ "rustix 0.38.28", ] +[[package]] +name = "rusttype" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff8374aa04134254b7995b63ad3dc41c7f7236f69528b28553da7d72efaa967" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser 0.15.2", +] + [[package]] name = "rustybuzz" version = "0.12.1" @@ -3994,13 +4781,19 @@ dependencies = [ "bytemuck", "libm", "smallvec", - "ttf-parser", + "ttf-parser 0.20.0", "unicode-bidi-mirroring", "unicode-ccc", "unicode-properties", "unicode-script", ] +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + [[package]] name = "same-file" version = "1.0.6" @@ -4016,6 +4809,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" + [[package]] name = "scopeguard" version = "1.2.0" @@ -4030,8 +4829,8 @@ checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" dependencies = [ "ab_glyph", "log", - "memmap2", - "smithay-client-toolkit", + "memmap2 0.9.4", + "smithay-client-toolkit 0.18.1", "tiny-skia", ] @@ -4052,22 +4851,22 @@ checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -4078,7 +4877,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -4096,7 +4895,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -4107,7 +4906,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -4182,6 +4981,25 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +[[package]] +name = "smithay-client-toolkit" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" +dependencies = [ + "andrew", + "bitflags 1.3.2", + "calloop 0.6.5", + "dlib 0.4.2", + "lazy_static", + "log", + "memmap2 0.1.0", + "nix 0.18.0", + "wayland-client 0.28.6", + "wayland-cursor 0.28.6", + "wayland-protocols 0.28.6", +] + [[package]] name = "smithay-client-toolkit" version = "0.18.1" @@ -4189,32 +5007,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ "bitflags 2.4.2", - "calloop", + "calloop 0.12.4", "calloop-wayland-source", "cursor-icon", "libc", "log", - "memmap2", + "memmap2 0.9.4", "rustix 0.38.28", "thiserror", "wayland-backend", - "wayland-client", + "wayland-client 0.31.2", "wayland-csd-frame", - "wayland-cursor", - "wayland-protocols", + "wayland-cursor 0.31.1", + "wayland-protocols 0.31.2", "wayland-protocols-wlr", - "wayland-scanner", + "wayland-scanner 0.31.1", "xkeysym", ] [[package]] name = "smithay-clipboard" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb62b280ce5a5cba847669933a0948d00904cf83845c944eae96a4738cea1a6" +checksum = "c091e7354ea8059d6ad99eace06dd13ddeedbb0ac72d40a9a6e7ff790525882d" dependencies = [ "libc", - "smithay-client-toolkit", + "smithay-client-toolkit 0.18.1", "wayland-backend", ] @@ -4255,14 +5073,14 @@ dependencies = [ "as-raw-xcb-connection", "bytemuck", "cfg_aliases 0.2.0", - "cocoa", - "core-graphics", + "cocoa 0.25.0", + "core-graphics 0.23.1", "drm", "fastrand 2.0.1", - "foreign-types", + "foreign-types 0.5.0", "js-sys", "log", - "memmap2", + "memmap2 0.9.4", "objc", "raw-window-handle 0.6.0", "redox_syscall 0.4.1", @@ -4270,8 +5088,8 @@ dependencies = [ "tiny-xlib", "wasm-bindgen", "wayland-backend", - "wayland-client", - "wayland-sys", + "wayland-client 0.31.2", + "wayland-sys 0.31.1", "web-sys", "windows-sys 0.52.0", "x11rb", @@ -4310,6 +5128,12 @@ dependencies = [ "float-cmp", ] +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "strsim" version = "0.10.0" @@ -4356,9 +5180,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -4387,12 +5211,27 @@ dependencies = [ "version-compare", ] +[[package]] +name = "systemicons" +version = "0.7.0" +source = "git+https://github.com/jackpot51/systemicons#501887629ebf3f9b9d3384383da62d352af3fbd7" +dependencies = [ + "cocoa 0.24.1", + "freedesktop-icons", + "image 0.23.14", + "lazy_static", + "objc", + "winapi", + "winit 0.25.0", + "xdg-mime", +] + [[package]] name = "taffy" version = "0.3.11" source = "git+https://github.com/DioxusLabs/taffy?rev=7781c70#7781c70241f7f572130c13106f2a869a9cf80885" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "grid", "num-traits", "slotmap", @@ -4410,7 +5249,7 @@ version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand 2.0.1", "redox_syscall 0.4.1", "rustix 0.38.28", @@ -4443,7 +5282,18 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", +] + +[[package]] +name = "tiff" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" +dependencies = [ + "jpeg-decoder 0.1.22", + "miniz_oxide 0.4.4", + "weezl", ] [[package]] @@ -4453,7 +5303,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" dependencies = [ "flate2", - "jpeg-decoder", + "jpeg-decoder 0.3.1", "weezl", ] @@ -4473,11 +5323,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.7.4", "bytemuck", - "cfg-if", + "cfg-if 1.0.0", "log", - "png", + "png 0.17.13", "tiny-skia-path", ] @@ -4537,7 +5387,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio", + "mio 0.8.10", "num_cpus", "pin-project-lite", "signal-hook-registry", @@ -4564,7 +5414,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.4", + "toml_edit 0.22.6", ] [[package]] @@ -4584,7 +5434,7 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -4595,20 +5445,20 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.2", ] [[package]] @@ -4630,7 +5480,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] @@ -4642,6 +5492,28 @@ dependencies = [ "once_cell", ] +[[package]] +name = "trash" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c658458d46d9d5a153a3b5cdd88d8579ad50d4fb85d53961e4526c8fc7c55a57" +dependencies = [ + "chrono", + "libc", + "log", + "objc", + "once_cell", + "scopeguard", + "url", + "windows 0.44.0", +] + +[[package]] +name = "ttf-parser" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" + [[package]] name = "ttf-parser" version = "0.20.0" @@ -4693,6 +5565,15 @@ dependencies = [ "tinystr", ] +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4725,9 +5606,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -4740,9 +5621,9 @@ checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" [[package]] name = "unicode-script" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" +checksum = "ad8d71f5726e5f285a935e9fe8edfd53f0491eb6e9a5774097fdabee7cd8c9cd" [[package]] name = "unicode-segmentation" @@ -4911,7 +5792,7 @@ version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] @@ -4926,7 +5807,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", "wasm-bindgen-shared", ] @@ -4936,7 +5817,7 @@ version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -4960,7 +5841,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4997,7 +5878,23 @@ dependencies = [ "rustix 0.38.28", "scoped-tls", "smallvec", - "wayland-sys", + "wayland-sys 0.31.1", +] + +[[package]] +name = "wayland-client" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" +dependencies = [ + "bitflags 1.3.2", + "downcast-rs", + "libc", + "nix 0.20.0", + "scoped-tls", + "wayland-commons", + "wayland-scanner 0.28.6", + "wayland-sys 0.28.6", ] [[package]] @@ -5009,7 +5906,19 @@ dependencies = [ "bitflags 2.4.2", "rustix 0.38.28", "wayland-backend", - "wayland-scanner", + "wayland-scanner 0.31.1", +] + +[[package]] +name = "wayland-commons" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" +dependencies = [ + "nix 0.20.0", + "once_cell", + "smallvec", + "wayland-sys 0.28.6", ] [[package]] @@ -5023,6 +5932,17 @@ dependencies = [ "wayland-backend", ] +[[package]] +name = "wayland-cursor" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" +dependencies = [ + "nix 0.20.0", + "wayland-client 0.28.6", + "xcursor", +] + [[package]] name = "wayland-cursor" version = "0.31.1" @@ -5030,10 +5950,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ "rustix 0.38.28", - "wayland-client", + "wayland-client 0.31.2", "xcursor", ] +[[package]] +name = "wayland-protocols" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" +dependencies = [ + "bitflags 1.3.2", + "wayland-client 0.28.6", + "wayland-commons", + "wayland-scanner 0.28.6", +] + [[package]] name = "wayland-protocols" version = "0.31.2" @@ -5042,8 +5974,8 @@ checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ "bitflags 2.4.2", "wayland-backend", - "wayland-client", - "wayland-scanner", + "wayland-client 0.31.2", + "wayland-scanner 0.31.1", ] [[package]] @@ -5054,9 +5986,9 @@ checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ "bitflags 2.4.2", "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-scanner", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.1", ] [[package]] @@ -5067,9 +5999,20 @@ checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ "bitflags 2.4.2", "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-scanner", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.1", +] + +[[package]] +name = "wayland-scanner" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" +dependencies = [ + "proc-macro2", + "quote", + "xml-rs", ] [[package]] @@ -5083,13 +6026,24 @@ dependencies = [ "quote", ] +[[package]] +name = "wayland-sys" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" +dependencies = [ + "dlib 0.5.2", + "lazy_static", + "pkg-config", +] + [[package]] name = "wayland-sys" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ - "dlib", + "dlib 0.5.2", "log", "once_cell", "pkg-config", @@ -5126,8 +6080,8 @@ name = "wgpu" version = "0.19.0" source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109" dependencies = [ - "arrayvec", - "cfg-if", + "arrayvec 0.7.4", + "cfg-if 1.0.0", "cfg_aliases 0.1.1", "js-sys", "log", @@ -5150,7 +6104,7 @@ name = "wgpu-core" version = "0.19.0" source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", "bit-vec", "bitflags 2.4.2", "cfg_aliases 0.1.1", @@ -5176,7 +6130,7 @@ version = "0.19.0" source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109" dependencies = [ "android_system_properties", - "arrayvec", + "arrayvec 0.7.4", "ash", "bit-set", "bitflags 2.4.2", @@ -5262,9 +6216,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a197337269a469b5b2583d65dd7dfe475fd79a525be0aa647ff6d37ac6612c" +checksum = "f6d692d46038c433f9daee7ad8757e002a4248c20b0a3fbc991d99521d3bcb6d" dependencies = [ "clipboard-win", "clipboard_macos", @@ -5274,6 +6228,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "windows" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows" version = "0.48.0" @@ -5524,6 +6487,38 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winit" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" +dependencies = [ + "bitflags 1.3.2", + "cocoa 0.24.1", + "core-foundation 0.9.4", + "core-graphics 0.22.3", + "core-video-sys", + "dispatch", + "instant", + "lazy_static", + "libc", + "log", + "mio 0.7.14", + "mio-misc", + "ndk 0.3.0", + "ndk-glue", + "ndk-sys 0.2.2", + "objc", + "parking_lot 0.11.2", + "percent-encoding", + "raw-window-handle 0.3.4", + "scopeguard", + "smithay-client-toolkit 0.12.3", + "wayland-client 0.28.6", + "winapi", + "x11-dl", +] + [[package]] name = "winit" version = "0.29.10" @@ -5534,18 +6529,18 @@ dependencies = [ "atomic-waker", "bitflags 2.4.2", "bytemuck", - "calloop", + "calloop 0.12.4", "cfg_aliases 0.1.1", - "core-foundation", - "core-graphics", + "core-foundation 0.9.4", + "core-graphics 0.23.1", "cursor-icon", "icrate 0.0.4", "js-sys", "libc", "log", - "memmap2", - "ndk", - "ndk-sys", + "memmap2 0.9.4", + "ndk 0.8.0", + "ndk-sys 0.5.0+25.2.9519653", "objc2 0.4.1", "once_cell", "orbclient", @@ -5554,14 +6549,14 @@ dependencies = [ "redox_syscall 0.3.5", "rustix 0.38.28", "sctk-adwaita", - "smithay-client-toolkit", + "smithay-client-toolkit 0.18.1", "smol_str", "unicode-segmentation", "wasm-bindgen", "wasm-bindgen-futures", "wayland-backend", - "wayland-client", - "wayland-protocols", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", "wayland-protocols-plasma", "web-sys", "web-time", @@ -5573,9 +6568,18 @@ dependencies = [ [[package]] name = "winnow" -version = "0.5.39" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" dependencies = [ "memchr", ] @@ -5634,6 +6638,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "xdg-mime" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87bf7b69bb50588d70a36e467be29d3df3e8c32580276d62eded9738c1a797aa" +dependencies = [ + "dirs-next", + "glob", + "mime", + "nom", + "unicase", +] + [[package]] name = "xkbcommon-dl" version = "0.4.2" @@ -5641,7 +6658,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ "bitflags 2.4.2", - "dlib", + "dlib 0.5.2", "log", "once_cell", "xkeysym", @@ -5667,9 +6684,9 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" [[package]] name = "xxhash-rust" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53be06678ed9e83edb1745eb72efc0bbcd7b5c3c35711a860906aed827a13d61" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" [[package]] name = "yazi" @@ -5701,7 +6718,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix", + "nix 0.26.4", "once_cell", "ordered-stream", "rand", @@ -5767,7 +6784,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.50", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2426e1c..ebdc77b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,13 @@ rust-version = "1.71" [dependencies] alacritty_terminal = "0.20" env_logger = "0.10" -lazy_static = "1" +hex_color = { version = "3", features = ["serde"] } indexmap = "2" +lazy_static = "1" lexical-sort = "0.3.1" log = "0.4" +palette = { version = "0.7", features = ["serde"] } +ron = "0.8" serde = { version = "1", features = ["serde_derive"] } shlex = "1" tokio = { version = "1", features = ["sync"] } @@ -21,11 +24,10 @@ i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester i18n-embed-fl = "0.6" rust-embed = "6" paste = "1.0" -palette = "0.7" -[dependencies.smol_str] -version = "0.2.1" -features = ["serde"] +[dependencies.cosmic-files] +git = "https://github.com/pop-os/cosmic-files" +default-features = false [dependencies.cosmic-text] git = "https://github.com/pop-os/cosmic-text.git" @@ -34,11 +36,15 @@ features = ["shape-run-cache"] [dependencies.libcosmic] git = "https://github.com/pop-os/libcosmic.git" default-features = false -features = ["tokio", "winit"] +features = ["multi-window", "tokio", "winit"] + +[dependencies.smol_str] +version = "0.2.1" +features = ["serde"] [features] default = ["wgpu"] -wgpu = ["libcosmic/wgpu"] +wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"] [patch.crates-io] # https://github.com/rust-lang/libc/pull/3512 diff --git a/color-schemes/COSMIC Dark.ron b/color-schemes/COSMIC Dark.ron new file mode 100644 index 0000000..3fd7863 --- /dev/null +++ b/color-schemes/COSMIC Dark.ron @@ -0,0 +1,37 @@ +( + name: "COSMIC Dark", + foreground: "#C4C4C4", + cursor: "#C4C4C4", + bright_foreground: "#C4C4C4", + dim_foreground: "#8E8E8E", + normal: ( + black: "#1B1B1B", + red: "#F16161", + green: "#7CB987", + yellow: "#DDC74C", + blue: "#6296BE", + magenta: "#BE6DEE", + cyan: "#49BAC8", + white: "#BEBEBE", + ), + bright: ( + black: "#808080", + red: "#FF8985", + green: "#97D5A0", + yellow: "#FAE365", + blue: "#7DB1DA", + magenta: "#D68EFF", + cyan: "#49BAC8", + white: "#C4C4C4", + ), + dim: ( + black: "#000000", + red: "#A04040", + green: "#5D7D62", + yellow: "#9E914A", + blue: "#486073", + magenta: "#7F46A1", + cyan: "#3F7F87", + white: "#898989", + ), +) \ No newline at end of file diff --git a/color-schemes/COSMIC Light.ron b/color-schemes/COSMIC Light.ron new file mode 100644 index 0000000..37d0334 --- /dev/null +++ b/color-schemes/COSMIC Light.ron @@ -0,0 +1,37 @@ +( + name: "COSMIC Light", + foreground: "#292929", + cursor: "#292929", + bright_foreground: "#808080", + dim_foreground: "#181818", + normal: ( + black: "#292929", + red: "#8C151F", + green: "#145129", + yellow: "#624000", + blue: "#003F5F", + magenta: "#6D169C", + cyan: "#004F57", + white: "#BEBEBE", + ), + bright: ( + black: "#808080", + red: "#9D2329", + green: "#235D34", + yellow: "#714B00", + blue: "#054B6F", + magenta: "#7A28A9", + cyan: "#005C5D", + white: "#D7D7D7", + ), + dim: ( + black: "#181818", + red: "#652020", + green: "#183C22", + yellow: "#4A320A", + blue: "#072D44", + magenta: "#50256D", + cyan: "#0B3C41", + white: "#ABABAB", + ), +) \ No newline at end of file diff --git a/color-schemes/Linux Console.ron b/color-schemes/Linux Console.ron new file mode 100644 index 0000000..d760c01 --- /dev/null +++ b/color-schemes/Linux Console.ron @@ -0,0 +1,38 @@ +( + name: "Linux Console", + foreground: "#FFFFFF", + background: "#000000", + cursor: "#FFFFFF", + bright_foreground: "#AAAAAA", + dim_foreground: "#E2E2E2", + normal: ( + black: "#000000", + red: "#AA0000", + green: "#00AA00", + yellow: "#AA5500", + blue: "#0000AA", + magenta: "#AA00AA", + cyan: "#00AAAA", + white: "#AAAAAA", + ), + bright: ( + black: "#555555", + red: "#FF5555", + green: "#55FF55", + yellow: "#FFFF55", + blue: "#5555FF", + magenta: "#FF55FF", + cyan: "#55FFFF", + white: "#FFFFFF", + ), + dim: ( + black: "#000000", + red: "#70221A", + green: "#458340", + yellow: "#814514", + blue: "#0A1B44", + magenta: "#7E1B7E", + cyan: "#278B8B", + white: "#8F8F8F", + ), +) \ No newline at end of file diff --git a/color-schemes/OneHalfDark.ron b/color-schemes/OneHalfDark.ron new file mode 100644 index 0000000..c721103 --- /dev/null +++ b/color-schemes/OneHalfDark.ron @@ -0,0 +1,38 @@ +( + name: "OneHalfDark", + foreground: "#DCDFE4", + background: "#282C34", + cursor: "#FBFBFC", + bright_foreground: "#FBFBFC", + dim_foreground: "#A8A8A8", + normal: ( + black: "#282C34", + red: "#E06C75", + green: "#98C379", + yellow: "#E5C07B", + blue: "#61AFEF", + magenta: "#C678DD", + cyan: "#56B6C2", + white: "#DCDFE4", + ), + bright: ( + black: "#5D677A", + red: "#EE9397", + green: "#B6DE9B", + yellow: "#F4DFB8", + blue: "#94C9F8", + magenta: "#D89EE9", + cyan: "#74D2DE", + white: "#FBFBFC", + ), + dim: ( + black: "#000000", + red: "#904A4F", + green: "#6F885F", + yellow: "#A68C5D", + blue: "#3E79A8", + magenta: "#855194", + cyan: "#467B82", + white: "#A8A8A8", + ), +) \ No newline at end of file diff --git a/color-schemes/Pop Dark.ron b/color-schemes/Pop Dark.ron new file mode 100644 index 0000000..f877000 --- /dev/null +++ b/color-schemes/Pop Dark.ron @@ -0,0 +1,38 @@ +( + name: "Pop Dark", + foreground: "#F2F2F2", + background: "#333333", + cursor: "#EEEEEC", + bright_foreground: "#EEEEEC", + dim_foreground: "#E4E4E4", + normal: ( + black: "#333333", + red: "#CC0000", + green: "#4E9A06", + yellow: "#C4A000", + blue: "#3465A4", + magenta: "#75507B", + cyan: "#06989A", + white: "#D3D7CF", + ), + bright: ( + black: "#88807C", + red: "#F15D22", + green: "#73C48F", + yellow: "#FFCE51", + blue: "#48B9C7", + magenta: "#AD7FA8", + cyan: "#34E2E2", + white: "#EEEEEC", + ), + dim: ( + black: "#272727", + red: "#A1362B", + green: "#558737", + yellow: "#B1942D", + blue: "#3B5981", + magenta: "#5D4D5F", + cyan: "#288889", + white: "#C7C7C7", + ), +) \ No newline at end of file diff --git a/color-schemes/Rxvt Dark.ron b/color-schemes/Rxvt Dark.ron new file mode 100644 index 0000000..f6fcdb7 --- /dev/null +++ b/color-schemes/Rxvt Dark.ron @@ -0,0 +1,38 @@ +( + name: "Rxvt Dark", + foreground: "#FFFFFF", + background: "#000000", + cursor: "#FFFFFF", + bright_foreground: "#FAEBD7", + dim_foreground: "#DDDDDD", + normal: ( + black: "#000000", + red: "#CD0000", + green: "#00CD00", + yellow: "#CDCD00", + blue: "#0000CD", + magenta: "#CD00CD", + cyan: "#00CDCD", + white: "#FAEBD7", + ), + bright: ( + black: "#404040", + red: "#FF0000", + green: "#00FF00", + yellow: "#FFFF00", + blue: "#0000FF", + magenta: "#FF00FF", + cyan: "#00FFFF", + white: "#FFFFFF", + ), + dim: ( + black: "#000000", + red: "#872B22", + green: "#549E4E", + yellow: "#AAAB34", + blue: "#0F2353", + magenta: "#972596", + cyan: "#31A7A6", + white: "#E3C7A1", + ), +) \ No newline at end of file diff --git a/color-schemes/Rxvt Light.ron b/color-schemes/Rxvt Light.ron new file mode 100644 index 0000000..cd274ea --- /dev/null +++ b/color-schemes/Rxvt Light.ron @@ -0,0 +1,38 @@ +( + name: "Rxvt Light", + foreground: "#000000", + background: "#FFFFFF", + cursor: "#000000", + bright_foreground: "#404040", + dim_foreground: "#000000", + normal: ( + black: "#000000", + red: "#CD0000", + green: "#00CD00", + yellow: "#CDCD00", + blue: "#0000CD", + magenta: "#CD00CD", + cyan: "#00CDCD", + white: "#FAEBD7", + ), + bright: ( + black: "#404040", + red: "#FF0000", + green: "#00FF00", + yellow: "#FFFF00", + blue: "#0000FF", + magenta: "#FF00FF", + cyan: "#00FFFF", + white: "#FFFFFF", + ), + dim: ( + black: "#000000", + red: "#691F18", + green: "#468742", + yellow: "#94952C", + blue: "#051130", + magenta: "#7A1A7A", + cyan: "#288F8F", + white: "#D2B081", + ), +) \ No newline at end of file diff --git a/color-schemes/Selenized Black.ron b/color-schemes/Selenized Black.ron new file mode 100644 index 0000000..f7ec9ad --- /dev/null +++ b/color-schemes/Selenized Black.ron @@ -0,0 +1,37 @@ +( + name: "Selenized Black", + foreground: "#B9B9B9", + background: "#181818", + cursor: "#777777", + dim_foreground: "#848484", + normal: ( + black: "#252525", + red: "#ED4A46", + green: "#70B433", + yellow: "#DBB32D", + blue: "#368AEB", + magenta: "#EB6EB7", + cyan: "#3FC5B7", + white: "#777777", + ), + bright: ( + black: "#3B3B3B", + red: "#FF5E56", + green: "#83C746", + yellow: "#EFC541", + blue: "#4F9CFE", + magenta: "#FF81CA", + cyan: "#56D8C9", + white: "#DEDEDE", + ), + dim: ( + black: "#000000", + red: "#923833", + green: "#527736", + yellow: "#988038", + blue: "#285892", + magenta: "#A2497D", + cyan: "#3E877F", + white: "#464646", + ), +) \ No newline at end of file diff --git a/color-schemes/Selenized Dark.ron b/color-schemes/Selenized Dark.ron new file mode 100644 index 0000000..e766c79 --- /dev/null +++ b/color-schemes/Selenized Dark.ron @@ -0,0 +1,37 @@ +( + name: "Selenized Dark", + foreground: "#ADBCBC", + background: "#103C48", + cursor: "#72898F", + dim_foreground: "#838383", + normal: ( + black: "#184956", + red: "#FA5750", + green: "#75B938", + yellow: "#DBB32D", + blue: "#4695F7", + magenta: "#F275BE", + cyan: "#41C7B9", + white: "#72898F", + ), + bright: ( + black: "#2D5B69", + red: "#FF665C", + green: "#84C747", + yellow: "#EBC13D", + blue: "#58A3FF", + magenta: "#FF84CD", + cyan: "#53D6C7", + white: "#CAD8D9", + ), + dim: ( + black: "#061519", + red: "#A63A35", + green: "#567C39", + yellow: "#988038", + blue: "#2B62A6", + magenta: "#AF4885", + cyan: "#3F8981", + white: "#525252", + ), +) \ No newline at end of file diff --git a/color-schemes/Selenized Light.ron b/color-schemes/Selenized Light.ron new file mode 100644 index 0000000..63ef4b5 --- /dev/null +++ b/color-schemes/Selenized Light.ron @@ -0,0 +1,37 @@ +( + name: "Selenized Light", + foreground: "#53676D", + background: "#FBF3DB", + cursor: "#ECE3CC", + dim_foreground: "#333333", + normal: ( + black: "#ECE3CC", + red: "#D2212D", + green: "#489100", + yellow: "#AD8900", + blue: "#0072D4", + magenta: "#CA4898", + cyan: "#009C8F", + white: "#909995", + ), + bright: ( + black: "#D5CDB6", + red: "#CC1729", + green: "#428B00", + yellow: "#A78300", + blue: "#006DCE", + magenta: "#C44392", + cyan: "#00978A", + white: "#3A4D53", + ), + dim: ( + black: "#B5AC95", + red: "#722423", + green: "#335520", + yellow: "#6E5917", + blue: "#124276", + magenta: "#75365B", + cyan: "#1A6159", + white: "#636363", + ), +) \ No newline at end of file diff --git a/color-schemes/Selenized White.ron b/color-schemes/Selenized White.ron new file mode 100644 index 0000000..33084e4 --- /dev/null +++ b/color-schemes/Selenized White.ron @@ -0,0 +1,37 @@ +( + name: "Selenized White", + foreground: "#474747", + background: "#FFFFFF", + cursor: "#EBEBEB", + dim_foreground: "#181818", + normal: ( + black: "#EBEBEB", + red: "#D6000C", + green: "#1D9700", + yellow: "#C49700", + blue: "#0064E4", + magenta: "#DD0F9D", + cyan: "#00AD9C", + white: "#878787", + ), + bright: ( + black: "#CDCDCD", + red: "#BF0000", + green: "#008400", + yellow: "#AF8500", + blue: "#0054CF", + magenta: "#C7008B", + cyan: "#009A8A", + white: "#282828", + ), + dim: ( + black: "#B3B3B3", + red: "#71221B", + green: "#2D5727", + yellow: "#82661D", + blue: "#153B75", + magenta: "#841D5F", + cyan: "#207166", + white: "#555555", + ), +) \ No newline at end of file diff --git a/color-schemes/Solarized Dark.ron b/color-schemes/Solarized Dark.ron new file mode 100644 index 0000000..8b6291a --- /dev/null +++ b/color-schemes/Solarized Dark.ron @@ -0,0 +1,38 @@ +( + name: "Solarized Dark", + foreground: "#839496", + background: "#002B36", + cursor: "#839496", + bright_foreground: "#268BD2", + dim_foreground: "#5D5D5D", + normal: ( + black: "#073642", + red: "#DC322F", + green: "#859900", + yellow: "#B58900", + blue: "#268BD2", + magenta: "#D33682", + cyan: "#2AA198", + white: "#EEE8D5", + ), + bright: ( + black: "#002B36", + red: "#CB4B16", + green: "#586E75", + yellow: "#657B83", + blue: "#839496", + magenta: "#6C71C4", + cyan: "#93A1A1", + white: "#FDF6E3", + ), + dim: ( + black: "#000000", + red: "#7D2C26", + green: "#56621A", + yellow: "#745918", + blue: "#23577E", + magenta: "#792E4E", + cyan: "#296661", + white: "#B7B09C", + ), +) \ No newline at end of file diff --git a/color-schemes/Solarized Light.ron b/color-schemes/Solarized Light.ron new file mode 100644 index 0000000..5b1ee8b --- /dev/null +++ b/color-schemes/Solarized Light.ron @@ -0,0 +1,38 @@ +( + name: "Solarized Light", + foreground: "#657B83", + background: "#FDF6E3", + cursor: "#657B83", + bright_foreground: "#B58900", + dim_foreground: "#454545", + normal: ( + black: "#073642", + red: "#DC322F", + green: "#859900", + yellow: "#B58900", + blue: "#268BD2", + magenta: "#D33682", + cyan: "#2AA198", + white: "#EEE8D5", + ), + bright: ( + black: "#002B36", + red: "#CB4B16", + green: "#586E75", + yellow: "#657B83", + blue: "#839496", + magenta: "#6C71C4", + cyan: "#93A1A1", + white: "#FDF6E3", + ), + dim: ( + black: "#000000", + red: "#7D2C26", + green: "#56621A", + yellow: "#745918", + blue: "#23577E", + magenta: "#792E4E", + cyan: "#296661", + white: "#B7B09C", + ), +) \ No newline at end of file diff --git a/color-schemes/Tango Dark.ron b/color-schemes/Tango Dark.ron new file mode 100644 index 0000000..e45560c --- /dev/null +++ b/color-schemes/Tango Dark.ron @@ -0,0 +1,38 @@ +( + name: "Tango Dark", + foreground: "#D3D7CF", + background: "#2E3436", + cursor: "#D3D7CF", + bright_foreground: "#EEEEEC", + dim_foreground: "#BABABA", + normal: ( + black: "#2E3436", + red: "#CC0000", + green: "#4E9A06", + yellow: "#C4A000", + blue: "#3465A4", + magenta: "#75507B", + cyan: "#06989A", + white: "#D3D7CF", + ), + bright: ( + black: "#555753", + red: "#EF2929", + green: "#8AE234", + yellow: "#FCE94F", + blue: "#729FCF", + magenta: "#AD7FA8", + cyan: "#34E2E2", + white: "#EEEEEC", + ), + dim: ( + black: "#1B1B1B", + red: "#8E2E24", + green: "#4B7930", + yellow: "#A28728", + blue: "#324D71", + magenta: "#504252", + cyan: "#237A7B", + white: "#BABABA", + ), +) \ No newline at end of file diff --git a/color-schemes/Tango Light.ron b/color-schemes/Tango Light.ron new file mode 100644 index 0000000..d483645 --- /dev/null +++ b/color-schemes/Tango Light.ron @@ -0,0 +1,38 @@ +( + name: "Tango Light", + foreground: "#2E3436", + background: "#EEEEEC", + cursor: "#2E3436", + bright_foreground: "#555753", + dim_foreground: "#010101", + normal: ( + black: "#2E3436", + red: "#CC0000", + green: "#4E9A06", + yellow: "#C4A000", + blue: "#3465A4", + magenta: "#75507B", + cyan: "#06989A", + white: "#D3D7CF", + ), + bright: ( + black: "#555753", + red: "#EF2929", + green: "#8AE234", + yellow: "#FCE94F", + blue: "#729FCF", + magenta: "#AD7FA8", + cyan: "#34E2E2", + white: "#EEEEEC", + ), + dim: ( + black: "#010101", + red: "#681F18", + green: "#395D24", + yellow: "#846E1F", + blue: "#213550", + magenta: "#362C37", + cyan: "#195E5F", + white: "#9F9F9F", + ), +) \ No newline at end of file diff --git a/color-schemes/XTerm Dark.ron b/color-schemes/XTerm Dark.ron new file mode 100644 index 0000000..6f6cc5a --- /dev/null +++ b/color-schemes/XTerm Dark.ron @@ -0,0 +1,38 @@ +( + name: "XTerm Dark", + foreground: "#FFFFFF", + background: "#000000", + cursor: "#FFFFFF", + bright_foreground: "#E5E5E5", + dim_foreground: "#DDDDDD", + normal: ( + black: "#000000", + red: "#CD0000", + green: "#00CD00", + yellow: "#CDCD00", + blue: "#0000EE", + magenta: "#CD00CD", + cyan: "#00CDCD", + white: "#E5E5E5", + ), + bright: ( + black: "#7F7F7F", + red: "#FF0000", + green: "#00FF00", + yellow: "#FFFF00", + blue: "#5C5CFF", + magenta: "#FF00FF", + cyan: "#00FFFF", + white: "#FFFFFF", + ), + dim: ( + black: "#000000", + red: "#872B22", + green: "#549E4E", + yellow: "#AAAB34", + blue: "#152E69", + magenta: "#972596", + cyan: "#31A7A6", + white: "#C3C3C3", + ), +) \ No newline at end of file diff --git a/color-schemes/XTerm Light.ron b/color-schemes/XTerm Light.ron new file mode 100644 index 0000000..255cdbf --- /dev/null +++ b/color-schemes/XTerm Light.ron @@ -0,0 +1,38 @@ +( + name: "XTerm Light", + foreground: "#000000", + background: "#FFFFFF", + cursor: "#000000", + bright_foreground: "#7F7F7F", + dim_foreground: "#000000", + normal: ( + black: "#000000", + red: "#CD0000", + green: "#00CD00", + yellow: "#CDCD00", + blue: "#0000EE", + magenta: "#CD00CD", + cyan: "#00CDCD", + white: "#E5E5E5", + ), + bright: ( + black: "#7F7F7F", + red: "#FF0000", + green: "#00FF00", + yellow: "#FFFF00", + blue: "#5C5CFF", + magenta: "#FF00FF", + cyan: "#00FFFF", + white: "#FFFFFF", + ), + dim: ( + black: "#000000", + red: "#691F18", + green: "#468742", + yellow: "#94952C", + blue: "#0B1D47", + magenta: "#7A1A7A", + cyan: "#288F8F", + white: "#AEAEAE", + ), +) \ No newline at end of file diff --git a/color-schemes/gruvbox-dark.ron b/color-schemes/gruvbox-dark.ron new file mode 100644 index 0000000..c661e3d --- /dev/null +++ b/color-schemes/gruvbox-dark.ron @@ -0,0 +1,38 @@ +( + name: "gruvbox-dark", + foreground: "#EBDBB2", + background: "#282828", + cursor: "#EBDBB2", + bright_foreground: "#EBDBB2", + dim_foreground: "#C0B28D", + normal: ( + black: "#282828", + red: "#CC241D", + green: "#98971A", + yellow: "#D79921", + blue: "#458588", + magenta: "#B16286", + cyan: "#689D6A", + white: "#A89984", + ), + bright: ( + black: "#928374", + red: "#FB4934", + green: "#B8BB26", + yellow: "#FABD2F", + blue: "#83A598", + magenta: "#D3869B", + cyan: "#8EC07C", + white: "#EBDBB2", + ), + dim: ( + black: "#020202", + red: "#7F2C24", + green: "#6F6F29", + yellow: "#A07732", + blue: "#3A5A5C", + magenta: "#724D5D", + cyan: "#547055", + white: "#747474", + ), +) \ No newline at end of file diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index 60d1253..83e39a9 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -2,6 +2,14 @@ new-terminal = New terminal # Context Pages +## Color schemes +color-schemes = Color schemes +rename = Rename +export = Export +delete = Delete +import = Import +import-errors = Import errors + ## Profiles profiles = Profiles name = Name @@ -78,4 +86,5 @@ previous-tab = Previous tab split-horizontal = Split horizontal split-vertical = Split vertical pane-toggle-maximize = Toggle maximized +menu-color-schemes = Color schemes... menu-settings = Settings... diff --git a/res/icons/dialog-error-symbolic.svg b/res/icons/dialog-error-symbolic.svg new file mode 100644 index 0000000..4e8ef99 --- /dev/null +++ b/res/icons/dialog-error-symbolic.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/res/icons/view-more-symbolic.svg b/res/icons/view-more-symbolic.svg new file mode 100644 index 0000000..bb23c25 --- /dev/null +++ b/res/icons/view-more-symbolic.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/config.rs b/src/config.rs index dd0427c..4e64d50 100644 --- a/src/config.rs +++ b/src/config.rs @@ -5,6 +5,7 @@ use cosmic::{ theme, }; use cosmic_text::{Metrics, Stretch, Weight}; +use hex_color::HexColor; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; @@ -31,6 +32,139 @@ impl AppTheme { } } +#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)] +#[serde(transparent)] +pub struct ColorSchemeId(pub u64); + +//TODO: there is a lot of extra code to keep the exported color scheme clean, +//consider how to reduce this +fn de_color_opt<'de, D>(deserializer: D) -> Result, D::Error> +where + D: serde::Deserializer<'de>, +{ + let hex_color: HexColor = Deserialize::deserialize(deserializer)?; + Ok(Some(hex_color)) +} + +fn ser_color_opt(hex_color_opt: &Option, serializer: S) -> Result +where + S: serde::Serializer, +{ + use serde::ser::Error as _; + match hex_color_opt { + Some(hex_color) => Serialize::serialize(hex_color, serializer), + None => Err(S::Error::custom("ser_color_opt called with None")), + } +} + +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] +#[serde(default, deny_unknown_fields)] +pub struct ColorSchemeAnsi { + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub black: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub red: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub green: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub yellow: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub blue: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub magenta: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub cyan: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub white: Option, +} + +impl ColorSchemeAnsi { + pub fn is_empty(&self) -> bool { + self.black.is_none() + && self.red.is_none() + && self.green.is_none() + && self.yellow.is_none() + && self.blue.is_none() + && self.magenta.is_none() + && self.cyan.is_none() + && self.white.is_none() + } +} + +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] +#[serde(default, deny_unknown_fields)] +pub struct ColorScheme { + pub name: String, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub foreground: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub background: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub cursor: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub bright_foreground: Option, + #[serde( + deserialize_with = "de_color_opt", + serialize_with = "ser_color_opt", + skip_serializing_if = "Option::is_none" + )] + pub dim_foreground: Option, + #[serde(skip_serializing_if = "ColorSchemeAnsi::is_empty")] + pub normal: ColorSchemeAnsi, + #[serde(skip_serializing_if = "ColorSchemeAnsi::is_empty")] + pub bright: ColorSchemeAnsi, + #[serde(skip_serializing_if = "ColorSchemeAnsi::is_empty")] + pub dim: ColorSchemeAnsi, +} + #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)] #[serde(transparent)] pub struct ProfileId(pub u64); @@ -63,6 +197,7 @@ impl Default for Profile { #[derive(Clone, CosmicConfigEntry, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct Config { pub app_theme: AppTheme, + pub color_schemes: BTreeMap, pub font_name: String, pub font_size: u16, pub font_weight: u16, @@ -84,6 +219,7 @@ impl Default for Config { Self { app_theme: AppTheme::System, bold_font_weight: Weight::BOLD.0, + color_schemes: BTreeMap::new(), dim_font_weight: Weight::NORMAL.0, focus_follow_mouse: false, font_name: "Fira Mono".to_string(), @@ -102,6 +238,25 @@ impl Default for Config { } impl Config { + // Get a sorted and adjusted for duplicates list of color scheme names and ids + pub fn color_scheme_names(&self) -> Vec<(String, ColorSchemeId)> { + let mut color_scheme_names = + Vec::<(String, ColorSchemeId)>::with_capacity(self.color_schemes.len()); + for (color_scheme_id, color_scheme) in self.color_schemes.iter() { + let mut name = color_scheme.name.clone(); + + let mut copies = 1; + while color_scheme_names.iter().find(|x| x.0 == name).is_some() { + copies += 1; + name = format!("{} ({})", color_scheme.name, copies); + } + + color_scheme_names.push((name, *color_scheme_id)); + } + color_scheme_names.sort_by(|a, b| lexical_sort::natural_lexical_cmp(&a.0, &b.0)); + color_scheme_names + } + fn font_size_adjusted(&self, zoom_adj: i8) -> f32 { let font_size = f32::from(self.font_size).max(1.0); let adj = f32::from(zoom_adj); @@ -120,7 +275,7 @@ impl Config { (self.opacity as f32) / 100.0 } - // Get a sorted and adjusted for duplicates list of profiles names and ids + // Get a sorted and adjusted for duplicates list of profile names and ids pub fn profile_names(&self) -> Vec<(String, ProfileId)> { let mut profile_names = Vec::<(String, ProfileId)>::with_capacity(self.profiles.len()); for (profile_id, profile) in self.profiles.iter() { diff --git a/src/icon_cache.rs b/src/icon_cache.rs index a06f3fa..59c9e0b 100644 --- a/src/icon_cache.rs +++ b/src/icon_cache.rs @@ -30,11 +30,13 @@ impl IconCache { }; } + bundle!("dialog-error-symbolic", 16); bundle!("edit-clear-symbolic", 16); bundle!("edit-delete-symbolic", 16); bundle!("list-add-symbolic", 16); bundle!("go-down-symbolic", 16); bundle!("go-up-symbolic", 16); + bundle!("view-more-symbolic", 16); bundle!("window-close-symbolic", 16); Self { cache } diff --git a/src/main.rs b/src/main.rs index 229834f..214d772 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ use cosmic::{ cosmic_config::{self, ConfigSet, CosmicConfigEntry}, cosmic_theme, executor, iced::{ + self, advanced::graphics::text::font_system, clipboard, event, futures::SinkExt, @@ -20,17 +21,18 @@ use cosmic::{ widget::{self, button, pane_grid, segmented_button, PaneGrid}, Application, ApplicationExt, Element, }; +use cosmic_files::dialog::{Dialog, DialogKind, DialogMessage, DialogResult}; use cosmic_text::{fontdb::FaceInfo, Family, Stretch, Weight}; use std::{ any::TypeId, cmp, collections::{BTreeMap, BTreeSet, HashMap}, - env, process, + env, fs, process, sync::{atomic::Ordering, Mutex}, }; use tokio::sync::mpsc; -use config::{AppTheme, Config, Profile, ProfileId, CONFIG_VERSION}; +use config::{AppTheme, ColorScheme, ColorSchemeId, Config, Profile, ProfileId, CONFIG_VERSION}; mod config; mod mouse_reporter; @@ -166,6 +168,7 @@ pub struct Flags { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Action { + ColorSchemes, Copy, Find, PaneFocusDown, @@ -204,6 +207,7 @@ pub enum Action { impl Action { pub fn message(self, entity_opt: Option) -> Message { match self { + Action::ColorSchemes => Message::ToggleContextPage(ContextPage::ColorSchemes), Action::Copy => Message::Copy(entity_opt), Action::Find => Message::Find(true), Action::PaneFocusDown => Message::PaneFocusAdjacent(pane_grid::Direction::Down), @@ -245,6 +249,15 @@ impl Action { #[derive(Clone, Debug)] pub enum Message { AppTheme(AppTheme), + ColorSchemeCollapse(ColorSchemeId), + ColorSchemeDelete(ColorSchemeId), + ColorSchemeExport(ColorSchemeId), + ColorSchemeExportResult(ColorSchemeId, DialogResult), + ColorSchemeExpand(ColorSchemeId), + ColorSchemeRename(ColorSchemeId, String), + ColorSchemeRenameSubmit, + ColorSchemeImport, + ColorSchemeImportResult(DialogResult), Config(Config), Copy(Option), DefaultFont(usize), @@ -254,6 +267,7 @@ pub enum Message { DefaultDimFontWeight(usize), DefaultBoldFontWeight(usize), DefaultZoomStep(usize), + DialogMessage(DialogMessage), Key(Modifiers, Key), Find(bool), FindNext, @@ -306,6 +320,7 @@ pub enum Message { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ContextPage { + ColorSchemes, Profiles, Settings, } @@ -313,6 +328,7 @@ pub enum ContextPage { impl ContextPage { fn title(&self) -> String { match self { + Self::ColorSchemes => fl!("color-schemes"), Self::Profiles => fl!("profiles"), Self::Settings => fl!("settings"), } @@ -343,6 +359,7 @@ pub struct App { theme_names: Vec, themes: HashMap, context_page: ContextPage, + dialog_opt: Option>, terminal_ids: HashMap, find: bool, find_search_id: widget::Id, @@ -350,15 +367,47 @@ pub struct App { term_event_tx_opt: Option>, startup_options: Option, term_config: TermConfig, + color_scheme_errors: Vec, + color_scheme_expanded: Option, + color_scheme_renaming: Option<(ColorSchemeId, String)>, + color_scheme_rename_id: widget::Id, profile_expanded: Option, show_advanced_font_settings: bool, modifiers: Modifiers, } impl App { + fn update_color_schemes(&mut self) { + self.themes = terminal_theme::terminal_themes(); + for (color_scheme_name, color_scheme_id) in self.config.color_scheme_names() { + if let Some(color_scheme) = self.config.color_schemes.get(&color_scheme_id) { + if self + .themes + .insert(color_scheme_name.clone(), color_scheme.into()) + .is_some() + { + log::warn!( + "custom color scheme {:?} replaces builtin one", + color_scheme_name + ); + } + } + } + + self.theme_names.clear(); + for theme_name in self.themes.keys() { + self.theme_names.push(theme_name.clone()); + } + self.theme_names + .sort_by(|a, b| lexical_sort::natural_lexical_cmp(a, b)); + } + fn update_config(&mut self) -> Command { let theme = self.config.app_theme.theme(); + // Update color schemes + self.update_color_schemes(); + // Update terminal window background color { let color = Color::from(theme.cosmic().background.base); @@ -399,6 +448,20 @@ impl App { self.update_config() } + fn save_color_schemes(&mut self) -> Command { + // Optimized for just saving color_schemes + if let Some(ref config_handler) = self.config_handler { + match config_handler.set("color_schemes", &self.config.color_schemes) { + Ok(()) => {} + Err(err) => { + log::error!("failed to save config: {}", err); + } + } + } + self.update_color_schemes(); + Command::none() + } + fn save_profiles(&mut self) -> Command { // Optimized for just saving profiles if let Some(ref config_handler) = self.config_handler { @@ -434,11 +497,14 @@ impl App { None => (String::new(), "COSMIC Terminal".to_string()), }; self.set_header_title(header_title); - Command::batch([self.set_window_title(window_title), self.update_focus()]) + Command::batch([ + self.set_window_title(window_title, window::Id::MAIN), + self.update_focus(), + ]) } else { log::error!("Failed to get the specific pane"); Command::batch([ - self.set_window_title("COSMIC Terminal".to_string()), + self.set_window_title("COSMIC Terminal".to_string(), window::Id::MAIN), self.update_focus(), ]) } @@ -521,6 +587,90 @@ impl App { } } + fn color_schemes(&self) -> Element { + let cosmic_theme::Spacing { space_xxxs, .. } = self.core().system_theme().cosmic().spacing; + + let mut sections = Vec::with_capacity(2 + self.color_scheme_errors.len()); + + if !self.config.color_schemes.is_empty() { + let mut section = widget::settings::view_section(""); + for (color_scheme_name, color_scheme_id) in self.config.color_scheme_names() { + let expanded = self.color_scheme_expanded == Some(color_scheme_id); + let renaming = match &self.color_scheme_renaming { + Some((id, value)) if id == &color_scheme_id => Some(value), + _ => None, + }; + + let button = if expanded { + widget::button(icon_cache_get("view-more-symbolic", 16)) + .on_press(Message::ColorSchemeCollapse(color_scheme_id)) + } else { + widget::button(icon_cache_get("view-more-symbolic", 16)) + .on_press(Message::ColorSchemeExpand(color_scheme_id)) + } + .style(style::Button::Icon); + + let menu = menu::color_scheme_menu(color_scheme_id, &color_scheme_name); + + let popover = widget::popover(button, menu).show_popup(expanded); + + let item = match renaming { + Some(value) => widget::settings::item_row(vec![ + widget::text_input("", value) + .id(self.color_scheme_rename_id.clone()) + .on_input(move |value| { + Message::ColorSchemeRename(color_scheme_id, value) + }) + .on_submit(Message::ColorSchemeRenameSubmit) + .into(), + popover.into(), + ]), + None => widget::settings::item::builder(color_scheme_name).control(popover), + }; + section = section.add(item); + } + sections.push(section.into()); + } + + sections.push( + widget::row::with_children(vec![ + widget::horizontal_space(Length::Fill).into(), + widget::button::standard(fl!("import")) + .on_press(Message::ColorSchemeImport) + .into(), + ]) + .into(), + ); + + for error in self.color_scheme_errors.iter() { + sections.push( + widget::row::with_children(vec![ + icon_cache_get("dialog-error-symbolic", 16) + .style(style::Svg::custom(|theme| { + let cosmic = theme.cosmic(); + widget::svg::Appearance { + color: Some(cosmic.destructive_text_color().into()), + } + })) + .into(), + widget::text(error) + .style(style::Text::Custom(|theme| { + let cosmic = theme.cosmic(); + //TODO: re-export in libcosmic + iced::widget::text::Appearance { + color: Some(cosmic.destructive_text_color().into()), + } + })) + .into(), + ]) + .spacing(space_xxxs) + .into(), + ); + } + + widget::settings::view_column(sections).into() + } + fn profiles(&self) -> Element { let cosmic_theme::Spacing { space_s, @@ -652,7 +802,7 @@ impl App { let add_profile = widget::row::with_children(vec![ widget::horizontal_space(Length::Fill).into(), - widget::button(widget::text(fl!("add-profile"))) + widget::button::standard(fl!("add-profile")) .on_press(Message::ProfileNew) .into(), ]); @@ -1067,9 +1217,6 @@ impl Application for App { zoom_steps.push(zoom_step); } - let themes = terminal_theme::terminal_themes(); - let mut theme_names: Vec<_> = themes.keys().cloned().collect(); - theme_names.sort(); let pane_model = TerminalPaneGrid::new(segmented_button::ModelBuilder::default().build()); let mut terminal_ids = HashMap::new(); terminal_ids.insert(pane_model.focus, widget::Id::unique()); @@ -1094,9 +1241,10 @@ impl Application for App { zoom_adj: 0, zoom_step_names, zoom_steps, - theme_names, - themes, + theme_names: Vec::new(), + themes: HashMap::new(), context_page: ContextPage::Settings, + dialog_opt: None, terminal_ids, find: false, find_search_id: widget::Id::unique(), @@ -1104,6 +1252,10 @@ impl Application for App { startup_options: flags.startup_options, term_config: flags.term_config, term_event_tx_opt: None, + color_scheme_errors: Vec::new(), + color_scheme_expanded: None, + color_scheme_renaming: None, + color_scheme_rename_id: widget::Id::unique(), profile_expanded: None, show_advanced_font_settings: false, modifiers: Modifiers::empty(), @@ -1172,6 +1324,137 @@ impl Application for App { self.config.app_theme = app_theme; return self.save_config(); } + Message::ColorSchemeCollapse(_color_scheme_id) => { + self.color_scheme_expanded = None; + } + Message::ColorSchemeDelete(color_scheme_id) => { + self.color_scheme_expanded = None; + self.config.color_schemes.remove(&color_scheme_id); + return self.save_color_schemes(); + } + Message::ColorSchemeExport(color_scheme_id) => { + self.color_scheme_expanded = None; + if let Some(color_scheme) = self.config.color_schemes.get(&color_scheme_id) { + if self.dialog_opt.is_none() { + let (dialog, command) = Dialog::new( + DialogKind::SaveFile { + filename: format!("{}.ron", color_scheme.name), + }, + None, + Message::DialogMessage, + move |result| { + Message::ColorSchemeExportResult(color_scheme_id.clone(), result) + }, + ); + self.dialog_opt = Some(dialog); + return command; + } + } + } + Message::ColorSchemeExportResult(color_scheme_id, result) => { + //TODO: show errors in UI + self.dialog_opt = None; + if let DialogResult::Open(paths) = result { + let path = &paths[0]; + if let Some(color_scheme) = self.config.color_schemes.get(&color_scheme_id) { + match ron::ser::to_string_pretty( + &color_scheme, + ron::ser::PrettyConfig::new(), + ) { + Ok(ron) => match fs::write(path, &ron) { + Ok(()) => {} + Err(err) => { + log::error!( + "failed to export {:?} to {:?}: {}", + color_scheme_id, + path, + err + ); + } + }, + Err(err) => { + log::error!( + "failed to serialize color scheme {:?}: {}", + color_scheme_id, + err + ); + } + } + } else { + log::error!("failed to find color scheme {:?}", color_scheme_id); + } + } + } + Message::ColorSchemeExpand(color_scheme_id) => { + self.color_scheme_expanded = Some(color_scheme_id); + } + Message::ColorSchemeRename(color_scheme_id, color_scheme_name) => { + self.color_scheme_expanded = None; + let focus = self.color_scheme_renaming.is_none(); + self.color_scheme_renaming = Some((color_scheme_id, color_scheme_name)); + if focus { + return widget::text_input::focus(self.color_scheme_rename_id.clone()); + } + } + Message::ColorSchemeRenameSubmit => { + if let Some((color_scheme_id, color_scheme_name)) = + self.color_scheme_renaming.take() + { + if let Some(color_scheme) = self.config.color_schemes.get_mut(&color_scheme_id) + { + color_scheme.name = color_scheme_name; + return self.save_color_schemes(); + } + } + } + Message::ColorSchemeImport => { + if self.dialog_opt.is_none() { + self.color_scheme_errors.clear(); + let (dialog, command) = Dialog::new( + DialogKind::OpenMultipleFiles, + None, + Message::DialogMessage, + move |result| Message::ColorSchemeImportResult(result), + ); + self.dialog_opt = Some(dialog); + return command; + } + } + Message::ColorSchemeImportResult(result) => { + self.dialog_opt = None; + if let DialogResult::Open(paths) = result { + self.color_scheme_errors.clear(); + for path in paths.iter() { + let mut file = match fs::File::open(path) { + Ok(ok) => ok, + Err(err) => { + self.color_scheme_errors + .push(format!("Failed to open {:?}: {}", path, err)); + continue; + } + }; + match ron::de::from_reader::<_, ColorScheme>(&mut file) { + Ok(color_scheme) => { + // Get next color_scheme ID + let color_scheme_id = self + .config + .color_schemes + .last_key_value() + .map(|(id, _)| ColorSchemeId(id.0 + 1)) + .unwrap_or_default(); + self.config + .color_schemes + .insert(color_scheme_id, color_scheme); + } + Err(err) => { + self.color_scheme_errors + .push(format!("Failed to parse {:?}: {}", path, err)); + } + } + } + return self.save_color_schemes(); + } + } Message::Config(config) => { if config != self.config { log::info!("update config"); @@ -1285,6 +1568,11 @@ impl Application for App { log::warn!("failed to find zoom step with index {}", index); } }, + Message::DialogMessage(dialog_message) => { + if let Some(dialog) = &mut self.dialog_opt { + return dialog.update(dialog_message); + } + } Message::Key(modifiers, key) => { for (key_bind, action) in self.key_binds.iter() { if key_bind.matches(modifiers, &key) { @@ -1767,6 +2055,17 @@ impl Application for App { self.context_page = context_page; self.core.window.show_context = true; } + + // Extra work to do to prepare context pages + match self.context_page { + ContextPage::ColorSchemes => { + self.color_scheme_errors.clear(); + self.color_scheme_expanded = None; + self.color_scheme_renaming = None; + } + _ => {} + } + self.set_context_title(context_page.title()); } Message::ShowAdvancedFontSettings(show) => { @@ -1809,6 +2108,7 @@ impl Application for App { } Some(match self.context_page { + ContextPage::ColorSchemes => self.color_schemes(), ContextPage::Profiles => self.profiles(), ContextPage::Settings => self.settings(), }) @@ -1827,6 +2127,13 @@ impl Application for App { .into()] } + fn view_window(&self, window_id: window::Id) -> Element { + match &self.dialog_opt { + Some(dialog) => dialog.view(window_id), + None => widget::text("Unknown window ID").into(), + } + } + /// Creates a view after each update. fn view(&self) -> Element { let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; @@ -2026,6 +2333,10 @@ impl Application for App { cosmic_theme::ThemeMode::version(), ) .map(|_update| Message::SystemThemeChange), + match &self.dialog_opt { + Some(dialog) => dialog.subscription(), + None => subscription::Subscription::none(), + }, ]) } } diff --git a/src/menu.rs b/src/menu.rs index 6aed4dd..01b3854 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -17,7 +17,7 @@ use cosmic::{ }; use std::collections::HashMap; -use crate::{fl, Action, Config, KeyBind, Message}; +use crate::{fl, Action, ColorSchemeId, Config, KeyBind, Message}; macro_rules! menu_button { ($($x:expr),+ $(,)?) => ( @@ -108,6 +108,38 @@ pub fn context_menu<'a>( .into() } +pub fn color_scheme_menu<'a>(id: ColorSchemeId, name: &str) -> Element<'a, Message> { + let menu_item = |label, message| menu_button!(widget::text(label)).on_press(message); + + widget::container(column!( + menu_item( + fl!("rename"), + Message::ColorSchemeRename(id, name.to_string()) + ), + menu_item(fl!("export"), Message::ColorSchemeExport(id)), + menu_item(fl!("delete"), Message::ColorSchemeDelete(id)), + )) + .padding(1) + //TODO: move style to libcosmic + .style(theme::Container::custom(|theme| { + let cosmic = theme.cosmic(); + let component = &cosmic.background.component; + widget::container::Appearance { + icon_color: Some(component.on.into()), + text_color: Some(component.on.into()), + background: Some(Background::Color(component.base.into())), + border: Border { + radius: 8.0.into(), + width: 1.0, + color: component.divider.into(), + }, + ..Default::default() + } + })) + .width(Length::Fixed(120.0)) + .into() +} + pub fn menu_bar<'a>(config: &Config, key_binds: &HashMap) -> Element<'a, Message> { //TODO: port to libcosmic let menu_root = |label| { @@ -185,6 +217,7 @@ pub fn menu_bar<'a>(config: &Config, key_binds: &HashMap) -> El menu_item(fl!("split-vertical"), Action::PaneSplitVertical), menu_item(fl!("pane-toggle-maximize"), Action::PaneToggleMaximized), MenuTree::new(horizontal_rule(1)), + menu_item(fl!("menu-color-schemes"), Action::ColorSchemes), menu_item(fl!("menu-settings"), Action::Settings), ], ), diff --git a/src/terminal_theme.rs b/src/terminal_theme.rs index d626c20..2553bd4 100644 --- a/src/terminal_theme.rs +++ b/src/terminal_theme.rs @@ -2,11 +2,14 @@ use alacritty_terminal::{ term::color::Colors, vte::ansi::{NamedColor, Rgb}, }; - +use hex_color::HexColor; use palette::{encoding::Srgb, rgb::Rgb as PRgb, FromColor, Okhsl}; -use std::collections::HashMap; +use std::{collections::HashMap, fs}; + +use crate::config::{ColorScheme, ColorSchemeAnsi}; // Fill missing dim/bright colors with derived values from normal ones. +#[allow(dead_code)] struct ColorDerive { dim_saturation_adjustment: f32, dim_lightness_adjustment: f32, @@ -14,6 +17,7 @@ struct ColorDerive { bright_lightness_adjustment: f32, } +#[allow(dead_code)] impl ColorDerive { fn new() -> Self { Self { @@ -138,311 +142,108 @@ fn auto_colors() -> Colors { colors } -fn tango_palette() -> Colors { - let mut colors = auto_colors(); +impl From<&ColorScheme> for Colors { + fn from(color_scheme: &ColorScheme) -> Self { + let mut colors = auto_colors(); - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, + let encode_rgb = |rgb_opt: Option| -> Option { + let rgb = rgb_opt?; + Some(Rgb { + r: rgb.r, + g: rgb.g, + b: rgb.b, + }) + }; + + // Set normal colors + colors[NamedColor::Black] = encode_rgb(color_scheme.normal.black); + colors[NamedColor::Red] = encode_rgb(color_scheme.normal.red); + colors[NamedColor::Green] = encode_rgb(color_scheme.normal.green); + colors[NamedColor::Yellow] = encode_rgb(color_scheme.normal.yellow); + colors[NamedColor::Blue] = encode_rgb(color_scheme.normal.blue); + colors[NamedColor::Magenta] = encode_rgb(color_scheme.normal.magenta); + colors[NamedColor::Cyan] = encode_rgb(color_scheme.normal.cyan); + colors[NamedColor::White] = encode_rgb(color_scheme.normal.white); + + // Set bright colors + colors[NamedColor::BrightBlack] = encode_rgb(color_scheme.bright.black); + colors[NamedColor::BrightRed] = encode_rgb(color_scheme.bright.red); + colors[NamedColor::BrightGreen] = encode_rgb(color_scheme.bright.green); + colors[NamedColor::BrightYellow] = encode_rgb(color_scheme.bright.yellow); + colors[NamedColor::BrightBlue] = encode_rgb(color_scheme.bright.blue); + colors[NamedColor::BrightMagenta] = encode_rgb(color_scheme.bright.magenta); + colors[NamedColor::BrightCyan] = encode_rgb(color_scheme.bright.cyan); + colors[NamedColor::BrightWhite] = encode_rgb(color_scheme.bright.white); + + // Set dim colors + colors[NamedColor::DimBlack] = encode_rgb(color_scheme.dim.black); + colors[NamedColor::DimRed] = encode_rgb(color_scheme.dim.red); + colors[NamedColor::DimGreen] = encode_rgb(color_scheme.dim.green); + colors[NamedColor::DimYellow] = encode_rgb(color_scheme.dim.yellow); + colors[NamedColor::DimBlue] = encode_rgb(color_scheme.dim.blue); + colors[NamedColor::DimMagenta] = encode_rgb(color_scheme.dim.magenta); + colors[NamedColor::DimCyan] = encode_rgb(color_scheme.dim.cyan); + colors[NamedColor::DimWhite] = encode_rgb(color_scheme.dim.white); + + // Set special colors + colors[NamedColor::Foreground] = encode_rgb(color_scheme.foreground); + colors[NamedColor::Background] = encode_rgb(color_scheme.background); + colors[NamedColor::Cursor] = encode_rgb(color_scheme.cursor); + colors[NamedColor::BrightForeground] = encode_rgb(color_scheme.bright_foreground); + colors[NamedColor::DimForeground] = encode_rgb(color_scheme.dim_foreground); + + colors + } +} + +impl From<(&str, &Colors)> for ColorScheme { + fn from(tuple: (&str, &Colors)) -> Self { + let (name, colors) = tuple; + + let encode_rgb = |rgb_opt: Option| -> Option { + let rgb = rgb_opt?; + Some(HexColor::rgb(rgb.r, rgb.g, rgb.b)) + }; + + Self { + name: name.to_string(), + foreground: encode_rgb(colors[NamedColor::Foreground]), + background: encode_rgb(colors[NamedColor::Background]), + cursor: encode_rgb(colors[NamedColor::Cursor]), + bright_foreground: encode_rgb(colors[NamedColor::BrightForeground]), + dim_foreground: encode_rgb(colors[NamedColor::DimForeground]), + normal: ColorSchemeAnsi { + black: encode_rgb(colors[NamedColor::Black]), + red: encode_rgb(colors[NamedColor::Red]), + green: encode_rgb(colors[NamedColor::Green]), + yellow: encode_rgb(colors[NamedColor::Yellow]), + blue: encode_rgb(colors[NamedColor::Blue]), + magenta: encode_rgb(colors[NamedColor::Magenta]), + cyan: encode_rgb(colors[NamedColor::Cyan]), + white: encode_rgb(colors[NamedColor::White]), + }, + bright: ColorSchemeAnsi { + black: encode_rgb(colors[NamedColor::BrightBlack]), + red: encode_rgb(colors[NamedColor::BrightRed]), + green: encode_rgb(colors[NamedColor::BrightGreen]), + yellow: encode_rgb(colors[NamedColor::BrightYellow]), + blue: encode_rgb(colors[NamedColor::BrightBlue]), + magenta: encode_rgb(colors[NamedColor::BrightMagenta]), + cyan: encode_rgb(colors[NamedColor::BrightCyan]), + white: encode_rgb(colors[NamedColor::BrightWhite]), + }, + dim: ColorSchemeAnsi { + black: encode_rgb(colors[NamedColor::DimBlack]), + red: encode_rgb(colors[NamedColor::DimRed]), + green: encode_rgb(colors[NamedColor::DimGreen]), + yellow: encode_rgb(colors[NamedColor::DimYellow]), + blue: encode_rgb(colors[NamedColor::DimBlue]), + magenta: encode_rgb(colors[NamedColor::DimMagenta]), + cyan: encode_rgb(colors[NamedColor::DimCyan]), + white: encode_rgb(colors[NamedColor::DimWhite]), + }, } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x2E3436)); - colors[NamedColor::Red] = Some(encode_rgb(0xCC0000)); - colors[NamedColor::Green] = Some(encode_rgb(0x4E9A06)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xC4A000)); - colors[NamedColor::Blue] = Some(encode_rgb(0x3465A4)); - colors[NamedColor::Magenta] = Some(encode_rgb(0x75507B)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x06989A)); - colors[NamedColor::White] = Some(encode_rgb(0xD3D7CF)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x555753)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xEF2929)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x8AE234)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFCE94F)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x729FCF)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xAD7FA8)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x34E2E2)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xEEEEEC)); - - colors -} - -fn tango_dark() -> Colors { - let mut colors = tango_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::White]; - colors[NamedColor::Background] = colors[NamedColor::Black]; - colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new() - // Dim less so colors are readable with default bg - .with_dim_lightness_adjustment(-0.10) - .fill_missing_dims(&mut colors); - - colors -} - -fn tango_light() -> Colors { - let mut colors = tango_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::Black]; - colors[NamedColor::Background] = colors[NamedColor::BrightWhite]; - colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - -fn linux_console_palette() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x000000)); - colors[NamedColor::Red] = Some(encode_rgb(0xAA0000)); - colors[NamedColor::Green] = Some(encode_rgb(0x00AA00)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xAA5500)); - colors[NamedColor::Blue] = Some(encode_rgb(0x0000AA)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xAA00AA)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x00AAAA)); - colors[NamedColor::White] = Some(encode_rgb(0xAAAAAA)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x555555)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF5555)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x55FF55)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFFFF55)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x5555FF)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF55FF)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x55FFFF)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFFFFFF)); - - colors -} - -fn linux_console() -> Colors { - let mut colors = linux_console_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite]; - colors[NamedColor::Background] = colors[NamedColor::Black]; - colors[NamedColor::BrightForeground] = colors[NamedColor::White]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new() - // Dim less so colors are readable with default bg - .with_dim_lightness_adjustment(-0.10) - .fill_missing_dims(&mut colors); - - colors -} - -fn xterm_palette() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x000000)); - colors[NamedColor::Red] = Some(encode_rgb(0xCD0000)); - colors[NamedColor::Green] = Some(encode_rgb(0x00CD00)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xCDCD00)); - colors[NamedColor::Blue] = Some(encode_rgb(0x0000EE)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xCD00CD)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x00CDCD)); - colors[NamedColor::White] = Some(encode_rgb(0xE5E5E5)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x7F7F7F)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF0000)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x00FF00)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFFFF00)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x5C5CFF)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF00FF)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x00FFFF)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFFFFFF)); - - colors -} - -fn xterm_dark() -> Colors { - let mut colors = xterm_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite]; - colors[NamedColor::Background] = colors[NamedColor::Black]; - colors[NamedColor::BrightForeground] = colors[NamedColor::White]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new() - // Dim less so colors are readable with default bg - .with_dim_lightness_adjustment(-0.12) - .fill_missing_dims(&mut colors); - - colors -} - -fn xterm_light() -> Colors { - let mut colors = xterm_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::Black]; - colors[NamedColor::Background] = colors[NamedColor::BrightWhite]; - colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - -fn rxvt_palette() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x000000)); - colors[NamedColor::Red] = Some(encode_rgb(0xCD0000)); - colors[NamedColor::Green] = Some(encode_rgb(0x00CD00)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xCDCD00)); - colors[NamedColor::Blue] = Some(encode_rgb(0x0000CD)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xCD00CD)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x00CDCD)); - colors[NamedColor::White] = Some(encode_rgb(0xFAEBD7)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x404040)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF0000)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x00FF00)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xFFFF00)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x0000FF)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF00FF)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x00FFFF)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFFFFFF)); - - colors -} - -fn rxvt_dark() -> Colors { - let mut colors = rxvt_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite]; - colors[NamedColor::Background] = colors[NamedColor::Black]; - colors[NamedColor::BrightForeground] = colors[NamedColor::White]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new() - // Dim less so colors are readable with default bg - .with_dim_lightness_adjustment(-0.12) - .fill_missing_dims(&mut colors); - - colors -} - -fn rxvt_light() -> Colors { - let mut colors = rxvt_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::Black]; - colors[NamedColor::Background] = colors[NamedColor::BrightWhite]; - colors[NamedColor::BrightForeground] = colors[NamedColor::BrightBlack]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - -fn solarized_palette() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x073642)); - colors[NamedColor::Red] = Some(encode_rgb(0xDC322F)); - colors[NamedColor::Green] = Some(encode_rgb(0x859900)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xB58900)); - colors[NamedColor::Blue] = Some(encode_rgb(0x268BD2)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xD33682)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x2AA198)); - colors[NamedColor::White] = Some(encode_rgb(0xEEE8D5)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x002B36)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xCB4B16)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x586E75)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0x657B83)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x839496)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0x6C71C4)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x93A1A1)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xFDF6E3)); - - colors -} - -fn solarized_dark() -> Colors { - let mut colors = solarized_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::BrightBlue]; - colors[NamedColor::Background] = colors[NamedColor::BrightBlack]; - colors[NamedColor::BrightForeground] = colors[NamedColor::Blue]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - -fn solarized_light() -> Colors { - let mut colors = solarized_palette(); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::BrightYellow]; - colors[NamedColor::Background] = colors[NamedColor::BrightWhite]; - colors[NamedColor::BrightForeground] = colors[NamedColor::Yellow]; - colors[NamedColor::Cursor] = colors[NamedColor::Foreground]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors + } } fn cosmic_dark() -> Colors { @@ -533,308 +334,44 @@ fn cosmic_light() -> Colors { colors } -fn gruvbox_dark() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x282828)); - colors[NamedColor::Red] = Some(encode_rgb(0xcc241d)); - colors[NamedColor::Green] = Some(encode_rgb(0x98971a)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xd79921)); - colors[NamedColor::Blue] = Some(encode_rgb(0x458588)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xb16286)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x689d6a)); - colors[NamedColor::White] = Some(encode_rgb(0xa89984)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x928374)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xfb4934)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0xb8bb26)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xfabd2f)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x83a598)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xd3869b)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x8ec07c)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xebdbb2)); - - // Set special colors - colors[NamedColor::Foreground] = colors[NamedColor::BrightWhite]; - colors[NamedColor::Background] = colors[NamedColor::Black]; - colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite]; - colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite]; - - // Fill missing dim colors - ColorDerive::new() - // Dim less so colors are readable with default bg - .with_dim_lightness_adjustment(-0.15) - .fill_missing_dims(&mut colors); - - colors -} - -fn one_half_dark() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x282c34)); - colors[NamedColor::Red] = Some(encode_rgb(0xe06c75)); - colors[NamedColor::Green] = Some(encode_rgb(0x98c379)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xe5c07b)); - colors[NamedColor::Blue] = Some(encode_rgb(0x61afef)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xc678dd)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x56b6c2)); - colors[NamedColor::White] = Some(encode_rgb(0xdcdfe4)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x5d677a)); - - // Set this before filling bright colors (including BrightForeground) - colors[NamedColor::Foreground] = colors[NamedColor::White]; - - let color_derive = ColorDerive::new(); - - // Fill missing bright colors - color_derive.fill_missing_brights(&mut colors); - - // Set the rest of special colors - colors[NamedColor::Background] = colors[NamedColor::Black]; - colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite]; - - // Fill missing dim colors - color_derive.fill_missing_dims(&mut colors); - - colors -} - -fn pop_dark() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |r: u8, g: u8, b: u8| -> Rgb { Rgb { r, g, b } }; - - // Pop colors (from pop-desktop gsettings) - colors[NamedColor::Black] = Some(encode_rgb(51, 51, 51)); - colors[NamedColor::Red] = Some(encode_rgb(204, 0, 0)); - colors[NamedColor::Green] = Some(encode_rgb(78, 154, 6)); - colors[NamedColor::Yellow] = Some(encode_rgb(196, 160, 0)); - colors[NamedColor::Blue] = Some(encode_rgb(52, 101, 164)); - colors[NamedColor::Magenta] = Some(encode_rgb(117, 80, 123)); - colors[NamedColor::Cyan] = Some(encode_rgb(6, 152, 154)); - colors[NamedColor::White] = Some(encode_rgb(211, 215, 207)); - colors[NamedColor::BrightBlack] = Some(encode_rgb(136, 128, 124)); - colors[NamedColor::BrightRed] = Some(encode_rgb(241, 93, 34)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(115, 196, 143)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(255, 206, 81)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(72, 185, 199)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(173, 127, 168)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(52, 226, 226)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(238, 238, 236)); - - // Set special colors - // Pop colors (from pop-desktop gsettings) - colors[NamedColor::Foreground] = Some(encode_rgb(242, 242, 242)); - colors[NamedColor::Background] = Some(encode_rgb(51, 51, 51)); - colors[NamedColor::Cursor] = colors[NamedColor::BrightWhite]; - colors[NamedColor::BrightForeground] = colors[NamedColor::BrightWhite]; - - // Fill missing dim colors - ColorDerive::new() - // Dim less so colors are readable with default bg - .with_dim_lightness_adjustment(-0.05) - .fill_missing_dims(&mut colors); - - colors -} - -fn selenized_white() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0xEBEBEB)); - colors[NamedColor::Red] = Some(encode_rgb(0xD6000C)); - colors[NamedColor::Green] = Some(encode_rgb(0x1D9700)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xC49700)); - colors[NamedColor::Blue] = Some(encode_rgb(0x0064E4)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xDD0F9D)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x00AD9C)); - colors[NamedColor::White] = Some(encode_rgb(0x878787)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0xCDCDCD)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xBF0000)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x008400)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xAF8500)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x0054CF)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xC7008B)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x009A8A)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0x282828)); - - // Set special colors - colors[NamedColor::Background] = Some(encode_rgb(0xFFFFFF)); - colors[NamedColor::Foreground] = Some(encode_rgb(0x474747)); - colors[NamedColor::Cursor] = colors[NamedColor::Black]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - -fn selenized_light() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0xECE3CC)); - colors[NamedColor::Red] = Some(encode_rgb(0xD2212D)); - colors[NamedColor::Green] = Some(encode_rgb(0x489100)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xAD8900)); - colors[NamedColor::Blue] = Some(encode_rgb(0x0072D4)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xCA4898)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x009C8F)); - colors[NamedColor::White] = Some(encode_rgb(0x909995)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0xD5CDB6)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xCC1729)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x428B00)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xA78300)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x006DCE)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xC44392)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x00978A)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0x3A4D53)); - - // Set special colors - colors[NamedColor::Background] = Some(encode_rgb(0xFBF3DB)); - colors[NamedColor::Foreground] = Some(encode_rgb(0x53676D)); - colors[NamedColor::Cursor] = colors[NamedColor::Black]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - -fn selenized_dark() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x184956)); - colors[NamedColor::Red] = Some(encode_rgb(0xFA5750)); - colors[NamedColor::Green] = Some(encode_rgb(0x75B938)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xDBB32D)); - colors[NamedColor::Blue] = Some(encode_rgb(0x4695F7)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xF275BE)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x41C7B9)); - colors[NamedColor::White] = Some(encode_rgb(0x72898F)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x2D5B69)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF665C)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x84C747)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xEBC13D)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x58A3FF)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF84CD)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x53D6C7)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xCAD8D9)); - - // Set special colors - colors[NamedColor::Background] = Some(encode_rgb(0x103C48)); - colors[NamedColor::Foreground] = Some(encode_rgb(0xADBCBC)); - colors[NamedColor::Cursor] = colors[NamedColor::White]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - -fn selenized_black() -> Colors { - let mut colors = auto_colors(); - - let encode_rgb = |data: u32| -> Rgb { - Rgb { - r: (data >> 16) as u8, - g: (data >> 8) as u8, - b: data as u8, - } - }; - - colors[NamedColor::Black] = Some(encode_rgb(0x252525)); - colors[NamedColor::Red] = Some(encode_rgb(0xED4A46)); - colors[NamedColor::Green] = Some(encode_rgb(0x70B433)); - colors[NamedColor::Yellow] = Some(encode_rgb(0xDBB32D)); - colors[NamedColor::Blue] = Some(encode_rgb(0x368AEB)); - colors[NamedColor::Magenta] = Some(encode_rgb(0xEB6EB7)); - colors[NamedColor::Cyan] = Some(encode_rgb(0x3FC5B7)); - colors[NamedColor::White] = Some(encode_rgb(0x777777)); - - colors[NamedColor::BrightBlack] = Some(encode_rgb(0x3B3B3B)); - colors[NamedColor::BrightRed] = Some(encode_rgb(0xFF5E56)); - colors[NamedColor::BrightGreen] = Some(encode_rgb(0x83C746)); - colors[NamedColor::BrightYellow] = Some(encode_rgb(0xEFC541)); - colors[NamedColor::BrightBlue] = Some(encode_rgb(0x4F9CFE)); - colors[NamedColor::BrightMagenta] = Some(encode_rgb(0xFF81CA)); - colors[NamedColor::BrightCyan] = Some(encode_rgb(0x56D8C9)); - colors[NamedColor::BrightWhite] = Some(encode_rgb(0xDEDEDE)); - - // Set special colors - colors[NamedColor::Background] = Some(encode_rgb(0x181818)); - colors[NamedColor::Foreground] = Some(encode_rgb(0xB9B9B9)); - colors[NamedColor::Cursor] = colors[NamedColor::White]; - - // Fill missing dim colors - ColorDerive::new().fill_missing_dims(&mut colors); - - colors -} - +// Get builtin themes pub fn terminal_themes() -> HashMap { let mut themes = HashMap::new(); - themes.insert("Tango Dark".to_string(), tango_dark()); - themes.insert("Tango Light".to_string(), tango_light()); - themes.insert("XTerm Dark".to_string(), xterm_dark()); - themes.insert("XTerm Light".to_string(), xterm_light()); - themes.insert("Linux Console".to_string(), linux_console()); - themes.insert("Rxvt Dark".to_string(), rxvt_dark()); - themes.insert("Rxvt Light".to_string(), rxvt_light()); - themes.insert("Solarized Dark".to_string(), solarized_dark()); - themes.insert("Solarized Light".to_string(), solarized_light()); themes.insert("COSMIC Dark".to_string(), cosmic_dark()); themes.insert("COSMIC Light".to_string(), cosmic_light()); - themes.insert("gruvbox-dark".to_string(), gruvbox_dark()); - themes.insert("OneHalfDark".to_string(), one_half_dark()); - themes.insert("Pop Dark".to_string(), pop_dark()); - themes.insert("Selenized Black".to_string(), selenized_black()); - themes.insert("Selenized Dark".to_string(), selenized_dark()); - themes.insert("Selenized Light".to_string(), selenized_light()); - themes.insert("Selenized White".to_string(), selenized_white()); themes } + +// Helper function to export builtin themes to theme files +#[allow(dead_code)] +pub fn export() { + for (name, theme) in terminal_themes() { + let color_scheme = ColorScheme::from((name.as_str(), &theme)); + + // Ensure conversion to and from ColorScheme matches original theme + { + let theme_conv = Colors::from(&color_scheme); + for i in 0..alacritty_terminal::term::color::COUNT { + assert_eq!(theme[i], theme_conv[i]); + } + } + + let ron = match ron::ser::to_string_pretty(&color_scheme, ron::ser::PrettyConfig::new()) { + Ok(ok) => ok, + Err(err) => { + log::error!("failed to export {name:?}: {err}"); + continue; + } + }; + + let path = format!("color-schemes/{name}.ron"); + match fs::write(&path, ron) { + Ok(()) => { + log::info!("exported {path:?}"); + } + Err(err) => { + log::error!("failed to esport {path:?}: {err}"); + } + } + } +} From a8185c1871005e2642323195d641e7bf0dfbb0d2 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 09:59:48 -0700 Subject: [PATCH 02/25] Add note about color schemes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index b74dbbe..1215448 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,8 @@ WIP COSMIC terminal emulator, built using [alacritty\_terminal](https://docs.rs/ The `wgpu` feature, enabled by default, supports GPU rendering using `glyphon` and `wgpu`. If `wgpu` is not enabled or fails to initialize, then rendering falls back to using `softbuffer` and `tiny-skia`. + +## Color Schemes + +Custom color schemes can be imported from the View -> Color Schemes... menu item. +You can find templates for color schemes in the [color-schemes](color-schemes) folder. From f5ac834b117ed7cb4ff7d6662e16a423148a29bd Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 10:01:17 -0700 Subject: [PATCH 03/25] Format color schemes callout in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1215448..65dc63a 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,5 @@ back to using `softbuffer` and `tiny-skia`. ## Color Schemes -Custom color schemes can be imported from the View -> Color Schemes... menu item. +Custom color schemes can be imported from the `View -> Color schemes...` menu item. You can find templates for color schemes in the [color-schemes](color-schemes) folder. From 235ebd61809346540339401130b7ebc60f6fb72a Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 11:18:13 -0700 Subject: [PATCH 04/25] Split dark and light color schemes --- src/config.rs | 84 +++++++--- src/main.rs | 362 ++++++++++++++++++++++++++++-------------- src/menu.rs | 19 ++- src/terminal.rs | 6 +- src/terminal_theme.rs | 16 +- 5 files changed, 333 insertions(+), 154 deletions(-) diff --git a/src/config.rs b/src/config.rs index 4e64d50..1875436 100644 --- a/src/config.rs +++ b/src/config.rs @@ -15,7 +15,7 @@ use crate::fl; pub const CONFIG_VERSION: u64 = 1; -#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)] +#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] pub enum AppTheme { Dark, Light, @@ -32,6 +32,12 @@ impl AppTheme { } } +#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] +pub enum ColorSchemeKind { + Dark, + Light, +} + #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)] #[serde(transparent)] pub struct ColorSchemeId(pub u64); @@ -197,7 +203,8 @@ impl Default for Profile { #[derive(Clone, CosmicConfigEntry, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct Config { pub app_theme: AppTheme, - pub color_schemes: BTreeMap, + pub color_schemes_dark: BTreeMap, + pub color_schemes_light: BTreeMap, pub font_name: String, pub font_size: u16, pub font_weight: u16, @@ -219,7 +226,8 @@ impl Default for Config { Self { app_theme: AppTheme::System, bold_font_weight: Weight::BOLD.0, - color_schemes: BTreeMap::new(), + color_schemes_dark: BTreeMap::new(), + color_schemes_light: BTreeMap::new(), dim_font_weight: Weight::NORMAL.0, focus_follow_mouse: false, font_name: "Fira Mono".to_string(), @@ -238,11 +246,43 @@ impl Default for Config { } impl Config { + pub fn color_schemes( + &self, + color_scheme_kind: ColorSchemeKind, + ) -> &BTreeMap { + match color_scheme_kind { + ColorSchemeKind::Dark => &self.color_schemes_dark, + ColorSchemeKind::Light => &self.color_schemes_light, + } + } + + pub fn color_schemes_mut( + &mut self, + color_scheme_kind: ColorSchemeKind, + ) -> &mut BTreeMap { + match color_scheme_kind { + ColorSchemeKind::Dark => &mut self.color_schemes_dark, + ColorSchemeKind::Light => &mut self.color_schemes_light, + } + } + + pub fn color_scheme_kind(&self) -> ColorSchemeKind { + if self.app_theme.theme().theme_type.is_dark() { + ColorSchemeKind::Dark + } else { + ColorSchemeKind::Light + } + } + // Get a sorted and adjusted for duplicates list of color scheme names and ids - pub fn color_scheme_names(&self) -> Vec<(String, ColorSchemeId)> { + pub fn color_scheme_names( + &self, + color_scheme_kind: ColorSchemeKind, + ) -> Vec<(String, ColorSchemeId)> { + let color_schemes = self.color_schemes(color_scheme_kind); let mut color_scheme_names = - Vec::<(String, ColorSchemeId)>::with_capacity(self.color_schemes.len()); - for (color_scheme_id, color_scheme) in self.color_schemes.iter() { + Vec::<(String, ColorSchemeId)>::with_capacity(color_schemes.len()); + for (color_scheme_id, color_scheme) in color_schemes.iter() { let mut name = color_scheme.name.clone(); let mut copies = 1; @@ -294,24 +334,20 @@ impl Config { } // Get current syntax theme based on dark mode - pub fn syntax_theme(&self, profile_id_opt: Option) -> &str { - let dark = self.app_theme.theme().theme_type.is_dark(); - match profile_id_opt.and_then(|profile_id| self.profiles.get(&profile_id)) { - Some(profile) => { - if dark { - &profile.syntax_theme_dark - } else { - &profile.syntax_theme_light - } - } - None => { - if dark { - &self.syntax_theme_dark - } else { - &self.syntax_theme_light - } - } - } + pub fn syntax_theme(&self, profile_id_opt: Option) -> (String, ColorSchemeKind) { + let color_scheme_kind = self.color_scheme_kind(); + let theme_name = match profile_id_opt.and_then(|profile_id| self.profiles.get(&profile_id)) + { + Some(profile) => match color_scheme_kind { + ColorSchemeKind::Dark => profile.syntax_theme_dark.clone(), + ColorSchemeKind::Light => profile.syntax_theme_light.clone(), + }, + None => match color_scheme_kind { + ColorSchemeKind::Dark => self.syntax_theme_dark.clone(), + ColorSchemeKind::Light => self.syntax_theme_light.clone(), + }, + }; + (theme_name, color_scheme_kind) } pub fn typed_font_stretch(&self) -> Stretch { diff --git a/src/main.rs b/src/main.rs index 214d772..001c3a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,10 @@ use std::{ }; use tokio::sync::mpsc; -use config::{AppTheme, ColorScheme, ColorSchemeId, Config, Profile, ProfileId, CONFIG_VERSION}; +use config::{ + AppTheme, ColorScheme, ColorSchemeId, ColorSchemeKind, Config, Profile, ProfileId, + CONFIG_VERSION, +}; mod config; mod mouse_reporter; @@ -168,7 +171,7 @@ pub struct Flags { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Action { - ColorSchemes, + ColorSchemes(ColorSchemeKind), Copy, Find, PaneFocusDown, @@ -207,7 +210,9 @@ pub enum Action { impl Action { pub fn message(self, entity_opt: Option) -> Message { match self { - Action::ColorSchemes => Message::ToggleContextPage(ContextPage::ColorSchemes), + Action::ColorSchemes(color_scheme_kind) => { + Message::ToggleContextPage(ContextPage::ColorSchemes(color_scheme_kind)) + } Action::Copy => Message::Copy(entity_opt), Action::Find => Message::Find(true), Action::PaneFocusDown => Message::PaneFocusAdjacent(pane_grid::Direction::Down), @@ -249,15 +254,16 @@ impl Action { #[derive(Clone, Debug)] pub enum Message { AppTheme(AppTheme), - ColorSchemeCollapse(ColorSchemeId), - ColorSchemeDelete(ColorSchemeId), - ColorSchemeExport(ColorSchemeId), - ColorSchemeExportResult(ColorSchemeId, DialogResult), - ColorSchemeExpand(ColorSchemeId), - ColorSchemeRename(ColorSchemeId, String), + ColorSchemeCollapse, + ColorSchemeDelete(ColorSchemeKind, ColorSchemeId), + ColorSchemeExport(ColorSchemeKind, ColorSchemeId), + ColorSchemeExportResult(ColorSchemeKind, ColorSchemeId, DialogResult), + ColorSchemeExpand(ColorSchemeKind, ColorSchemeId), + ColorSchemeRename(ColorSchemeKind, ColorSchemeId, String), ColorSchemeRenameSubmit, - ColorSchemeImport, - ColorSchemeImportResult(DialogResult), + ColorSchemeImport(ColorSchemeKind), + ColorSchemeImportResult(ColorSchemeKind, DialogResult), + ColorSchemeTabActivate(widget::segmented_button::Entity), Config(Config), Copy(Option), DefaultFont(usize), @@ -291,12 +297,12 @@ pub enum Message { ProfileNew, ProfileOpen(ProfileId), ProfileRemove(ProfileId), - ProfileSyntaxTheme(ProfileId, usize, bool), + ProfileSyntaxTheme(ProfileId, ColorSchemeKind, usize), ProfileTabTitle(ProfileId, String), SelectAll(Option), UseBrightBold(bool), ShowHeaderBar(bool), - SyntaxTheme(usize, bool), + SyntaxTheme(ColorSchemeKind, usize), SystemThemeChange, TabActivate(segmented_button::Entity), TabActivateJump(usize), @@ -320,7 +326,7 @@ pub enum Message { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ContextPage { - ColorSchemes, + ColorSchemes(ColorSchemeKind), Profiles, Settings, } @@ -328,7 +334,7 @@ pub enum ContextPage { impl ContextPage { fn title(&self) -> String { match self { - Self::ColorSchemes => fl!("color-schemes"), + Self::ColorSchemes(_color_scheme_kind) => fl!("color-schemes"), Self::Profiles => fl!("profiles"), Self::Settings => fl!("settings"), } @@ -356,8 +362,9 @@ pub struct App { zoom_adj: i8, zoom_step_names: Vec, zoom_steps: Vec, - theme_names: Vec, - themes: HashMap, + theme_names_dark: Vec, + theme_names_light: Vec, + themes: HashMap<(String, ColorSchemeKind), TermColors>, context_page: ContextPage, dialog_opt: Option>, terminal_ids: HashMap, @@ -368,37 +375,67 @@ pub struct App { startup_options: Option, term_config: TermConfig, color_scheme_errors: Vec, - color_scheme_expanded: Option, - color_scheme_renaming: Option<(ColorSchemeId, String)>, + color_scheme_expanded: Option<(ColorSchemeKind, ColorSchemeId)>, + color_scheme_renaming: Option<(ColorSchemeKind, ColorSchemeId, String)>, color_scheme_rename_id: widget::Id, + color_scheme_tab_model: widget::segmented_button::SingleSelectModel, profile_expanded: Option, show_advanced_font_settings: bool, modifiers: Modifiers, } impl App { + fn theme_names(&self, color_scheme_kind: ColorSchemeKind) -> &Vec { + match color_scheme_kind { + ColorSchemeKind::Dark => &self.theme_names_dark, + ColorSchemeKind::Light => &self.theme_names_light, + } + } + fn update_color_schemes(&mut self) { self.themes = terminal_theme::terminal_themes(); - for (color_scheme_name, color_scheme_id) in self.config.color_scheme_names() { - if let Some(color_scheme) = self.config.color_schemes.get(&color_scheme_id) { - if self - .themes - .insert(color_scheme_name.clone(), color_scheme.into()) - .is_some() + for &color_scheme_kind in &[ColorSchemeKind::Dark, ColorSchemeKind::Light] { + for (color_scheme_name, color_scheme_id) in + self.config.color_scheme_names(color_scheme_kind) + { + if let Some(color_scheme) = self + .config + .color_schemes(color_scheme_kind) + .get(&color_scheme_id) { - log::warn!( - "custom color scheme {:?} replaces builtin one", - color_scheme_name - ); + if self + .themes + .insert( + (color_scheme_name.clone(), color_scheme_kind), + color_scheme.into(), + ) + .is_some() + { + log::warn!( + "custom {:?} color scheme {:?} replaces builtin one", + color_scheme_kind, + color_scheme_name + ); + } } } } - self.theme_names.clear(); - for theme_name in self.themes.keys() { - self.theme_names.push(theme_name.clone()); + self.theme_names_dark.clear(); + self.theme_names_light.clear(); + for (name, color_scheme_kind) in self.themes.keys() { + match *color_scheme_kind { + ColorSchemeKind::Dark => { + self.theme_names_dark.push(name.clone()); + } + ColorSchemeKind::Light => { + self.theme_names_light.push(name.clone()); + } + } } - self.theme_names + self.theme_names_dark + .sort_by(|a, b| lexical_sort::natural_lexical_cmp(a, b)); + self.theme_names_light .sort_by(|a, b| lexical_sort::natural_lexical_cmp(a, b)); } @@ -448,10 +485,16 @@ impl App { self.update_config() } - fn save_color_schemes(&mut self) -> Command { + fn save_color_schemes(&mut self, color_scheme_kind: ColorSchemeKind) -> Command { // Optimized for just saving color_schemes if let Some(ref config_handler) = self.config_handler { - match config_handler.set("color_schemes", &self.config.color_schemes) { + match config_handler.set( + match color_scheme_kind { + ColorSchemeKind::Dark => "color_schemes_dark", + ColorSchemeKind::Light => "color_schemes_light", + }, + &self.config.color_schemes(color_scheme_kind), + ) { Ok(()) => {} Err(err) => { log::error!("failed to save config: {}", err); @@ -587,30 +630,45 @@ impl App { } } - fn color_schemes(&self) -> Element { + fn color_schemes(&self, color_scheme_kind: ColorSchemeKind) -> Element { let cosmic_theme::Spacing { space_xxxs, .. } = self.core().system_theme().cosmic().spacing; - let mut sections = Vec::with_capacity(2 + self.color_scheme_errors.len()); + let mut sections = Vec::with_capacity(3 + self.color_scheme_errors.len()); - if !self.config.color_schemes.is_empty() { + sections.push( + widget::view_switcher::horizontal(&self.color_scheme_tab_model) + .on_activate(Message::ColorSchemeTabActivate) + .into(), + ); + + if !self.config.color_schemes(color_scheme_kind).is_empty() { let mut section = widget::settings::view_section(""); - for (color_scheme_name, color_scheme_id) in self.config.color_scheme_names() { - let expanded = self.color_scheme_expanded == Some(color_scheme_id); + for (color_scheme_name, color_scheme_id) in + self.config.color_scheme_names(color_scheme_kind) + { + let expanded = + self.color_scheme_expanded == Some((color_scheme_kind, color_scheme_id)); let renaming = match &self.color_scheme_renaming { - Some((id, value)) if id == &color_scheme_id => Some(value), + Some((kind, id, value)) + if kind == &color_scheme_kind && id == &color_scheme_id => + { + Some(value) + } _ => None, }; let button = if expanded { widget::button(icon_cache_get("view-more-symbolic", 16)) - .on_press(Message::ColorSchemeCollapse(color_scheme_id)) + .on_press(Message::ColorSchemeCollapse) } else { - widget::button(icon_cache_get("view-more-symbolic", 16)) - .on_press(Message::ColorSchemeExpand(color_scheme_id)) + widget::button(icon_cache_get("view-more-symbolic", 16)).on_press( + Message::ColorSchemeExpand(color_scheme_kind, color_scheme_id), + ) } .style(style::Button::Icon); - let menu = menu::color_scheme_menu(color_scheme_id, &color_scheme_name); + let menu = + menu::color_scheme_menu(color_scheme_kind, color_scheme_id, &color_scheme_name); let popover = widget::popover(button, menu).show_popup(expanded); @@ -619,7 +677,11 @@ impl App { widget::text_input("", value) .id(self.color_scheme_rename_id.clone()) .on_input(move |value| { - Message::ColorSchemeRename(color_scheme_id, value) + Message::ColorSchemeRename( + color_scheme_kind, + color_scheme_id, + value, + ) }) .on_submit(Message::ColorSchemeRenameSubmit) .into(), @@ -636,7 +698,7 @@ impl App { widget::row::with_children(vec![ widget::horizontal_space(Length::Fill).into(), widget::button::standard(fl!("import")) - .on_press(Message::ColorSchemeImport) + .on_press(Message::ColorSchemeImport(color_scheme_kind)) .into(), ]) .into(), @@ -716,11 +778,11 @@ impl App { if expanded { let dark_selected = self - .theme_names + .theme_names_dark .iter() .position(|theme_name| theme_name == &profile.syntax_theme_dark); let light_selected = self - .theme_names + .theme_names_light .iter() .position(|theme_name| theme_name == &profile.syntax_theme_light); @@ -766,10 +828,14 @@ impl App { //TODO: rename to color-scheme-dark? widget::settings::item::builder(fl!("syntax-dark")).control( widget::dropdown( - &self.theme_names, + &self.theme_names_dark, dark_selected, move |theme_i| { - Message::ProfileSyntaxTheme(profile_id, theme_i, true) + Message::ProfileSyntaxTheme( + profile_id, + ColorSchemeKind::Dark, + theme_i, + ) }, ), ), @@ -778,10 +844,14 @@ impl App { //TODO: rename to color-scheme-light? widget::settings::item::builder(fl!("syntax-light")).control( widget::dropdown( - &self.theme_names, + &self.theme_names_light, light_selected, move |theme_i| { - Message::ProfileSyntaxTheme(profile_id, theme_i, false) + Message::ProfileSyntaxTheme( + profile_id, + ColorSchemeKind::Light, + theme_i, + ) }, ), ), @@ -818,11 +888,11 @@ impl App { AppTheme::System => 0, }; let dark_selected = self - .theme_names + .theme_names_dark .iter() .position(|theme_name| theme_name == &self.config.syntax_theme_dark); let light_selected = self - .theme_names + .theme_names_light .iter() .position(|theme_name| theme_name == &self.config.syntax_theme_light); let font_selected = { @@ -874,17 +944,17 @@ impl App { .add( //TODO: rename to color-scheme-dark? widget::settings::item::builder(fl!("syntax-dark")).control(widget::dropdown( - &self.theme_names, + &self.theme_names_dark, dark_selected, - move |index| Message::SyntaxTheme(index, true), + move |index| Message::SyntaxTheme(ColorSchemeKind::Dark, index), )), ) .add( //TODO: rename to color-scheme-light? widget::settings::item::builder(fl!("syntax-light")).control(widget::dropdown( - &self.theme_names, + &self.theme_names_light, light_selected, - move |index| Message::SyntaxTheme(index, false), + move |index| Message::SyntaxTheme(ColorSchemeKind::Light, index), )), ) .add( @@ -1007,7 +1077,7 @@ impl App { self.pane_model.focus = pane; match &self.term_event_tx_opt { Some(term_event_tx) => { - match self.themes.get(self.config.syntax_theme(profile_id_opt)) { + match self.themes.get(&self.config.syntax_theme(profile_id_opt)) { Some(colors) => { let current_pane = self.pane_model.focus; if let Some(tab_model) = self.pane_model.active_mut() { @@ -1241,7 +1311,8 @@ impl Application for App { zoom_adj: 0, zoom_step_names, zoom_steps, - theme_names: Vec::new(), + theme_names_dark: Vec::new(), + theme_names_light: Vec::new(), themes: HashMap::new(), context_page: ContextPage::Settings, dialog_opt: None, @@ -1256,6 +1327,7 @@ impl Application for App { color_scheme_expanded: None, color_scheme_renaming: None, color_scheme_rename_id: widget::Id::unique(), + color_scheme_tab_model: widget::segmented_button::Model::default(), profile_expanded: None, show_advanced_font_settings: false, modifiers: Modifiers::empty(), @@ -1324,17 +1396,23 @@ impl Application for App { self.config.app_theme = app_theme; return self.save_config(); } - Message::ColorSchemeCollapse(_color_scheme_id) => { + Message::ColorSchemeCollapse => { self.color_scheme_expanded = None; } - Message::ColorSchemeDelete(color_scheme_id) => { + Message::ColorSchemeDelete(color_scheme_kind, color_scheme_id) => { self.color_scheme_expanded = None; - self.config.color_schemes.remove(&color_scheme_id); - return self.save_color_schemes(); + self.config + .color_schemes_mut(color_scheme_kind) + .remove(&color_scheme_id); + return self.save_color_schemes(color_scheme_kind); } - Message::ColorSchemeExport(color_scheme_id) => { + Message::ColorSchemeExport(color_scheme_kind, color_scheme_id) => { self.color_scheme_expanded = None; - if let Some(color_scheme) = self.config.color_schemes.get(&color_scheme_id) { + if let Some(color_scheme) = self + .config + .color_schemes(color_scheme_kind) + .get(&color_scheme_id) + { if self.dialog_opt.is_none() { let (dialog, command) = Dialog::new( DialogKind::SaveFile { @@ -1343,7 +1421,11 @@ impl Application for App { None, Message::DialogMessage, move |result| { - Message::ColorSchemeExportResult(color_scheme_id.clone(), result) + Message::ColorSchemeExportResult( + color_scheme_kind, + color_scheme_id.clone(), + result, + ) }, ); self.dialog_opt = Some(dialog); @@ -1351,12 +1433,16 @@ impl Application for App { } } } - Message::ColorSchemeExportResult(color_scheme_id, result) => { + Message::ColorSchemeExportResult(color_scheme_kind, color_scheme_id, result) => { //TODO: show errors in UI self.dialog_opt = None; if let DialogResult::Open(paths) = result { let path = &paths[0]; - if let Some(color_scheme) = self.config.color_schemes.get(&color_scheme_id) { + if let Some(color_scheme) = self + .config + .color_schemes(color_scheme_kind) + .get(&color_scheme_id) + { match ron::ser::to_string_pretty( &color_scheme, ron::ser::PrettyConfig::new(), @@ -1385,42 +1471,23 @@ impl Application for App { } } } - Message::ColorSchemeExpand(color_scheme_id) => { - self.color_scheme_expanded = Some(color_scheme_id); + Message::ColorSchemeExpand(color_scheme_kind, color_scheme_id) => { + self.color_scheme_expanded = Some((color_scheme_kind, color_scheme_id)); } - Message::ColorSchemeRename(color_scheme_id, color_scheme_name) => { - self.color_scheme_expanded = None; - let focus = self.color_scheme_renaming.is_none(); - self.color_scheme_renaming = Some((color_scheme_id, color_scheme_name)); - if focus { - return widget::text_input::focus(self.color_scheme_rename_id.clone()); - } - } - Message::ColorSchemeRenameSubmit => { - if let Some((color_scheme_id, color_scheme_name)) = - self.color_scheme_renaming.take() - { - if let Some(color_scheme) = self.config.color_schemes.get_mut(&color_scheme_id) - { - color_scheme.name = color_scheme_name; - return self.save_color_schemes(); - } - } - } - Message::ColorSchemeImport => { + Message::ColorSchemeImport(color_scheme_kind) => { if self.dialog_opt.is_none() { self.color_scheme_errors.clear(); let (dialog, command) = Dialog::new( DialogKind::OpenMultipleFiles, None, Message::DialogMessage, - move |result| Message::ColorSchemeImportResult(result), + move |result| Message::ColorSchemeImportResult(color_scheme_kind, result), ); self.dialog_opt = Some(dialog); return command; } } - Message::ColorSchemeImportResult(result) => { + Message::ColorSchemeImportResult(color_scheme_kind, result) => { self.dialog_opt = None; if let DialogResult::Open(paths) = result { self.color_scheme_errors.clear(); @@ -1438,12 +1505,12 @@ impl Application for App { // Get next color_scheme ID let color_scheme_id = self .config - .color_schemes + .color_schemes(color_scheme_kind) .last_key_value() .map(|(id, _)| ColorSchemeId(id.0 + 1)) .unwrap_or_default(); self.config - .color_schemes + .color_schemes_mut(color_scheme_kind) .insert(color_scheme_id, color_scheme); } Err(err) => { @@ -1452,7 +1519,40 @@ impl Application for App { } } } - return self.save_color_schemes(); + return self.save_color_schemes(color_scheme_kind); + } + } + Message::ColorSchemeRename(color_scheme_kind, color_scheme_id, color_scheme_name) => { + self.color_scheme_expanded = None; + let focus = self.color_scheme_renaming.is_none(); + self.color_scheme_renaming = + Some((color_scheme_kind, color_scheme_id, color_scheme_name)); + if focus { + return widget::text_input::focus(self.color_scheme_rename_id.clone()); + } + } + Message::ColorSchemeRenameSubmit => { + if let Some((color_scheme_kind, color_scheme_id, color_scheme_name)) = + self.color_scheme_renaming.take() + { + if let Some(color_scheme) = self + .config + .color_schemes_mut(color_scheme_kind) + .get_mut(&color_scheme_id) + { + color_scheme.name = color_scheme_name; + return self.save_color_schemes(color_scheme_kind); + } + } + } + Message::ColorSchemeTabActivate(entity) => { + if let Some(color_scheme_kind) = + self.color_scheme_tab_model.data::(entity) + { + let context_page = ContextPage::ColorSchemes(*color_scheme_kind); + if self.context_page != context_page { + return self.update(Message::ToggleContextPage(context_page)); + } } } Message::Config(config) => { @@ -1749,14 +1849,21 @@ impl Application for App { self.config.profiles.remove(&profile_id); return self.save_profiles(); } - Message::ProfileSyntaxTheme(profile_id, theme_i, dark) => { - match self.theme_names.get(theme_i) { + Message::ProfileSyntaxTheme(profile_id, color_scheme_kind, theme_i) => { + match self + .theme_names(color_scheme_kind) + .get(theme_i) + .map(|x| x.to_string()) + { Some(theme_name) => { if let Some(profile) = self.config.profiles.get_mut(&profile_id) { - if dark { - profile.syntax_theme_dark = theme_name.to_string(); - } else { - profile.syntax_theme_light = theme_name.to_string(); + match color_scheme_kind { + ColorSchemeKind::Dark => { + profile.syntax_theme_dark = theme_name; + } + ColorSchemeKind::Light => { + profile.syntax_theme_light = theme_name; + } } return self.save_profiles(); } @@ -1800,19 +1907,24 @@ impl Application for App { Message::SystemThemeChange => { return self.update_config(); } - Message::SyntaxTheme(index, dark) => match self.theme_names.get(index) { - Some(theme_name) => { - if dark { - self.config.syntax_theme_dark = theme_name.to_string(); - } else { - self.config.syntax_theme_light = theme_name.to_string(); + Message::SyntaxTheme(color_scheme_kind, index) => { + match self.theme_names(color_scheme_kind).get(index) { + Some(theme_name) => { + match color_scheme_kind { + ColorSchemeKind::Dark => { + self.config.syntax_theme_dark = theme_name.to_string(); + } + ColorSchemeKind::Light => { + self.config.syntax_theme_light = theme_name.to_string(); + } + } + return self.save_config(); + } + None => { + log::warn!("failed to find syntax theme with index {}", index); } - return self.save_config(); } - None => { - log::warn!("failed to find syntax theme with index {}", index); - } - }, + } Message::TabActivate(entity) => { if let Some(tab_model) = self.pane_model.active_mut() { tab_model.activate(entity); @@ -2058,10 +2170,28 @@ impl Application for App { // Extra work to do to prepare context pages match self.context_page { - ContextPage::ColorSchemes => { + ContextPage::ColorSchemes(color_scheme_kind) => { self.color_scheme_errors.clear(); self.color_scheme_expanded = None; self.color_scheme_renaming = None; + self.color_scheme_tab_model = widget::segmented_button::Model::default(); + let dark_entity = self + .color_scheme_tab_model + .insert() + .text(fl!("dark")) + .data(ColorSchemeKind::Dark) + .id(); + let light_entity = self + .color_scheme_tab_model + .insert() + .text(fl!("light")) + .data(ColorSchemeKind::Light) + .id(); + self.color_scheme_tab_model + .activate(match color_scheme_kind { + ColorSchemeKind::Dark => dark_entity, + ColorSchemeKind::Light => light_entity, + }); } _ => {} } @@ -2108,7 +2238,7 @@ impl Application for App { } Some(match self.context_page { - ContextPage::ColorSchemes => self.color_schemes(), + ContextPage::ColorSchemes(color_scheme_kind) => self.color_schemes(color_scheme_kind), ContextPage::Profiles => self.profiles(), ContextPage::Settings => self.settings(), }) diff --git a/src/menu.rs b/src/menu.rs index 01b3854..345265c 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -17,7 +17,7 @@ use cosmic::{ }; use std::collections::HashMap; -use crate::{fl, Action, ColorSchemeId, Config, KeyBind, Message}; +use crate::{fl, Action, ColorSchemeId, ColorSchemeKind, Config, KeyBind, Message}; macro_rules! menu_button { ($($x:expr),+ $(,)?) => ( @@ -108,16 +108,20 @@ pub fn context_menu<'a>( .into() } -pub fn color_scheme_menu<'a>(id: ColorSchemeId, name: &str) -> Element<'a, Message> { +pub fn color_scheme_menu<'a>( + kind: ColorSchemeKind, + id: ColorSchemeId, + name: &str, +) -> Element<'a, Message> { let menu_item = |label, message| menu_button!(widget::text(label)).on_press(message); widget::container(column!( menu_item( fl!("rename"), - Message::ColorSchemeRename(id, name.to_string()) + Message::ColorSchemeRename(kind, id, name.to_string()) ), - menu_item(fl!("export"), Message::ColorSchemeExport(id)), - menu_item(fl!("delete"), Message::ColorSchemeDelete(id)), + menu_item(fl!("export"), Message::ColorSchemeExport(kind, id)), + menu_item(fl!("delete"), Message::ColorSchemeDelete(kind, id)), )) .padding(1) //TODO: move style to libcosmic @@ -217,7 +221,10 @@ pub fn menu_bar<'a>(config: &Config, key_binds: &HashMap) -> El menu_item(fl!("split-vertical"), Action::PaneSplitVertical), menu_item(fl!("pane-toggle-maximize"), Action::PaneToggleMaximized), MenuTree::new(horizontal_rule(1)), - menu_item(fl!("menu-color-schemes"), Action::ColorSchemes), + menu_item( + fl!("menu-color-schemes"), + Action::ColorSchemes(config.color_scheme_kind()), + ), menu_item(fl!("menu-settings"), Action::Settings), ], ), diff --git a/src/terminal.rs b/src/terminal.rs index d71e841..6ddcab1 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -39,7 +39,7 @@ use tokio::sync::mpsc; pub use alacritty_terminal::grid::Scroll as TerminalScroll; use crate::{ - config::{Config as AppConfig, ProfileId}, + config::{ColorSchemeKind, Config as AppConfig, ProfileId}, mouse_reporter::MouseReporter, }; @@ -519,7 +519,7 @@ impl Terminal { pub fn set_config( &mut self, config: &AppConfig, - themes: &HashMap, + themes: &HashMap<(String, ColorSchemeKind), Colors>, zoom_adj: i8, ) { let mut update_cell_size = false; @@ -559,7 +559,7 @@ impl Terminal { update_cell_size = true; } - if let Some(colors) = themes.get(config.syntax_theme(self.profile_id_opt)) { + if let Some(colors) = themes.get(&config.syntax_theme(self.profile_id_opt)) { let mut changed = false; for i in 0..color::COUNT { if self.colors[i] != colors[i] { diff --git a/src/terminal_theme.rs b/src/terminal_theme.rs index 2553bd4..329e5c2 100644 --- a/src/terminal_theme.rs +++ b/src/terminal_theme.rs @@ -6,7 +6,7 @@ use hex_color::HexColor; use palette::{encoding::Srgb, rgb::Rgb as PRgb, FromColor, Okhsl}; use std::{collections::HashMap, fs}; -use crate::config::{ColorScheme, ColorSchemeAnsi}; +use crate::config::{ColorScheme, ColorSchemeAnsi, ColorSchemeKind}; // Fill missing dim/bright colors with derived values from normal ones. #[allow(dead_code)] @@ -335,17 +335,23 @@ fn cosmic_light() -> Colors { } // Get builtin themes -pub fn terminal_themes() -> HashMap { +pub fn terminal_themes() -> HashMap<(String, ColorSchemeKind), Colors> { let mut themes = HashMap::new(); - themes.insert("COSMIC Dark".to_string(), cosmic_dark()); - themes.insert("COSMIC Light".to_string(), cosmic_light()); + themes.insert( + ("COSMIC Dark".to_string(), ColorSchemeKind::Dark), + cosmic_dark(), + ); + themes.insert( + ("COSMIC Light".to_string(), ColorSchemeKind::Light), + cosmic_light(), + ); themes } // Helper function to export builtin themes to theme files #[allow(dead_code)] pub fn export() { - for (name, theme) in terminal_themes() { + for ((name, _color_scheme_kind), theme) in terminal_themes() { let color_scheme = ColorScheme::from((name.as_str(), &theme)); // Ensure conversion to and from ColorScheme matches original theme From c118f2c969a02be6173c364f38157d348fe2d279 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 11:25:39 -0700 Subject: [PATCH 05/25] Bind Ctrl+, to Settings --- src/key_bind.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/key_bind.rs b/src/key_bind.rs index d6774c7..6aa77e4 100644 --- a/src/key_bind.rs +++ b/src/key_bind.rs @@ -69,6 +69,7 @@ pub fn key_binds() -> HashMap { bind!([Ctrl, Shift], Key::Character("T".into()), TabNew); bind!([Ctrl, Shift], Key::Character("V".into()), Paste); bind!([Ctrl, Shift], Key::Character("W".into()), TabClose); + bind!([Ctrl], Key::Character(",".into()), Settings); // Ctrl+Alt+D splits horizontally, Ctrl+Alt+R splits vertically, Ctrl+Shift+X maximizes split //TODO: Adjust bindings as desired by UX From 153dea8221a087a0df9659f994b0a1eb69bd8f77 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 11:31:10 -0700 Subject: [PATCH 06/25] Make advanced font settings use a button for expanding --- src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 001c3a1..0b23b4b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -988,9 +988,14 @@ impl App { ), ) .add( - widget::settings::item::builder(fl!("advanced-font-settings")).toggler( - self.show_advanced_font_settings, - Message::ShowAdvancedFontSettings, + widget::settings::item::builder(fl!("advanced-font-settings")).control( + if self.show_advanced_font_settings { + widget::button(icon_cache_get("go-up-symbolic", 16)) + .on_press(Message::ShowAdvancedFontSettings(false)) + } else { + widget::button(icon_cache_get("go-down-symbolic", 16)) + .on_press(Message::ShowAdvancedFontSettings(true)) + }, ), ); From d9512cd0a436ac817730f2ba169d93a7b7b232fc Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 11:32:39 -0700 Subject: [PATCH 07/25] Fix style of advanced font settings item --- i18n/en/cosmic_term.ftl | 2 +- src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index 83e39a9..66ffcf5 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -35,7 +35,7 @@ opacity = Background opacity ### Font font = Font -advanced-font-settings = Advanced Font Settings +advanced-font-settings = Advanced font settings default-font = Font default-font-size = Font size default-font-stretch = Font stretch diff --git a/src/main.rs b/src/main.rs index 0b23b4b..705bfba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -995,7 +995,8 @@ impl App { } else { widget::button(icon_cache_get("go-down-symbolic", 16)) .on_press(Message::ShowAdvancedFontSettings(true)) - }, + } + .style(style::Button::Icon), ), ); From 1b0d018e43ac3ae4efd93d7f7fb1376d0405c009 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 22 Feb 2024 12:01:50 -0700 Subject: [PATCH 08/25] Do not select empty lines at end of grid, fixes #92 --- src/terminal.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/terminal.rs b/src/terminal.rs index 6ddcab1..bdb90ff 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -505,8 +505,15 @@ impl Terminal { let mut term = self.term.lock(); let grid = term.grid(); let start = Point::new(Line(-(grid.history_size() as i32)), Column(0)); + let mut end_line = grid.bottommost_line(); + while end_line.0 > 0 { + if ! grid[end_line].is_clear() { + break; + } + end_line.0 -= 1; + } let end = Point::new( - Line(grid.screen_lines() as i32 - 1), + end_line, Column(grid.columns() - 1), ); let mut selection = Selection::new(SelectionType::Lines, start, Side::Left); From d4f1e1cd122b50d4a72f2ce33a70d0b8921943a5 Mon Sep 17 00:00:00 2001 From: leb-kuchen <102472435+leb-kuchen@users.noreply.github.com> Date: Mon, 26 Feb 2024 04:47:52 +0100 Subject: [PATCH 09/25] Add ability to select a default profile. (#144) * add default profile * check profile * default profiles add translations * default profiles check for profile removal --- i18n/en/cosmic_term.ftl | 1 + src/config.rs | 2 ++ src/main.rs | 27 +++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index 66ffcf5..7292cfd 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -18,6 +18,7 @@ tab-title = Tab title tab-title-description = Override the default tab title add-profile = Add profile new-profile = New profile +make-default = Make default ## Settings settings = Settings diff --git a/src/config.rs b/src/config.rs index 1875436..1e1049a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -219,6 +219,7 @@ pub struct Config { pub syntax_theme_dark: String, pub syntax_theme_light: String, pub focus_follow_mouse: bool, + pub default_profile: Option, } impl Default for Config { @@ -241,6 +242,7 @@ impl Default for Config { syntax_theme_dark: "COSMIC Dark".to_string(), syntax_theme_light: "COSMIC Light".to_string(), use_bright_bold: false, + default_profile: None, } } } diff --git a/src/main.rs b/src/main.rs index 705bfba..87d4717 100644 --- a/src/main.rs +++ b/src/main.rs @@ -322,6 +322,7 @@ pub enum Message { ZoomOut, ZoomReset, FocusFollowMouse(bool), + UpdateDefaultProfile((bool, ProfileId)), } #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -855,6 +856,15 @@ impl App { }, ), ), + ) + .add( + widget::settings::item::builder(fl!("make-default")).control( + widget::toggler( + "".to_string(), + self.get_default_profile().is_some_and(|p| p == profile_id), + move |t| Message::UpdateDefaultProfile((t, profile_id)), + ), + ), ); let padding = Padding { @@ -1074,6 +1084,9 @@ impl App { ]) .into() } + fn get_default_profile(&self) -> Option { + self.config.default_profile + } fn create_and_focus_new_terminal( &mut self, @@ -1398,6 +1411,9 @@ impl Application for App { } match message { + Message::UpdateDefaultProfile((default, profile_id)) => { + config_set!(default_profile, default.then_some(profile_id)); + } Message::AppTheme(app_theme) => { self.config.app_theme = app_theme; return self.save_config(); @@ -1761,7 +1777,8 @@ impl Application for App { ); if let Some((pane, _)) = result { self.terminal_ids.insert(pane, widget::Id::unique()); - let command = self.create_and_focus_new_terminal(pane, None); + let command = + self.create_and_focus_new_terminal(pane, self.get_default_profile()); self.pane_model.panes_created += 1; return command; } @@ -1852,6 +1869,9 @@ impl Application for App { } } } + if Some(profile_id) == self.get_default_profile() { + config_set!(default_profile, None); + } self.config.profiles.remove(&profile_id); return self.save_profiles(); } @@ -2026,7 +2046,10 @@ impl Application for App { return self.update_title(Some(pane)); } Message::TabNew => { - return self.create_and_focus_new_terminal(self.pane_model.focus, None) + return self.create_and_focus_new_terminal( + self.pane_model.focus, + self.get_default_profile(), + ) } Message::TabNext => { if let Some(tab_model) = self.pane_model.active() { From 09d4ca9f6a7c153703eee87410fef527468d5c23 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 26 Feb 2024 15:19:54 -0700 Subject: [PATCH 10/25] Update libcosmic --- Cargo.lock | 296 +++++++++++++++++++++++++----------------------- src/main.rs | 4 +- src/terminal.rs | 7 +- 3 files changed, 158 insertions(+), 149 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bae32f6..437746f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -486,7 +486,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -521,7 +521,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -725,9 +725,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.1" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c764d619ca78fccbf3069b37bd7af92577f044bb15236036662d79b6559f25b7" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "bytemuck" @@ -746,7 +746,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -809,11 +809,10 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ - "jobserver", "libc", ] @@ -869,7 +868,7 @@ dependencies = [ "num-traits", "pure-rust-locales", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -1146,7 +1145,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1163,7 +1162,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "quote", "syn 1.0.109", @@ -1172,7 +1171,7 @@ dependencies = [ [[package]] name = "cosmic-files" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-files#4f1912384711665f5f7fca4d187434985ba8a130" +source = "git+https://github.com/pop-os/cosmic-files#5778d64e8cc8540221459e4b3c463da9bf2ee60b" dependencies = [ "chrono", "dirs", @@ -1180,13 +1179,15 @@ dependencies = [ "fork", "i18n-embed 0.14.1", "i18n-embed-fl 0.7.0", + "image 0.24.9", "lexical-sort", "libcosmic", "log", + "mime_guess", "notify", "once_cell", "paste", - "rust-embed 8.2.0", + "rust-embed 8.3.0", "serde", "smol_str", "systemicons", @@ -1224,7 +1225,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.11.2" -source = "git+https://github.com/pop-os/cosmic-text.git#85821731285bf88d712dce8e7410453d908bc038" +source = "git+https://github.com/pop-os/cosmic-text.git#2766961af621b9235616e186046f6d14a2f5fbc0" dependencies = [ "bitflags 2.4.2", "fontdb", @@ -1246,7 +1247,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "almost", "cosmic-config", @@ -1365,12 +1366,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +checksum = "ad291aa74992b9b7a7e88c38acbbf6ad7e107f1d90ee8775b7bc1fc3394f485c" dependencies = [ "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1407,12 +1408,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core 0.20.6", - "darling_macro 0.20.6", + "darling_core 0.20.8", + "darling_macro 0.20.8", ] [[package]] @@ -1431,16 +1432,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1456,13 +1457,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core 0.20.6", + "darling_core 0.20.8", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1511,10 +1512,10 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" dependencies = [ - "darling 0.20.6", + "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1583,7 +1584,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1682,7 +1683,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1739,9 +1740,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "281e452d3bad4005426416cdba5ccfd4f5c1280e10099e21db27f7c1c28347fc" +checksum = "26a147e1a6641a55d994b3e4e9fa4d9b180c8d652c09b363af8c9bf1b8e04139" [[package]] name = "etagere" @@ -2025,7 +2026,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -2175,7 +2176,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -2289,6 +2290,16 @@ dependencies = [ "weezl", ] +[[package]] +name = "gif" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gimli" version = "0.28.1" @@ -2472,9 +2483,9 @@ dependencies = [ [[package]] name = "half" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" dependencies = [ "cfg-if 1.0.0", "crunchy", @@ -2513,9 +2524,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" [[package]] name = "hex" @@ -2607,7 +2618,7 @@ dependencies = [ "locale_config", "log", "parking_lot 0.12.1", - "rust-embed 8.2.0", + "rust-embed 8.3.0", "thiserror", "unic-langid", "walkdir", @@ -2630,7 +2641,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.50", + "syn 2.0.51", "unic-langid", ] @@ -2651,7 +2662,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.50", + "syn 2.0.51", "unic-langid", ] @@ -2665,7 +2676,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -2694,7 +2705,7 @@ dependencies = [ [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "iced_accessibility", "iced_core", @@ -2702,14 +2713,14 @@ dependencies = [ "iced_renderer", "iced_widget", "iced_winit", - "image 0.24.8", + "image 0.24.9", "thiserror", ] [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "accesskit", "accesskit_winit", @@ -2718,7 +2729,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "bitflags 1.3.2", "log", @@ -2735,7 +2746,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "futures", "iced_core", @@ -2748,7 +2759,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2757,7 +2768,7 @@ dependencies = [ "half", "iced_core", "iced_futures", - "image 0.24.8", + "image 0.24.9", "kamadak-exif", "log", "lyon_path", @@ -2772,7 +2783,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2784,7 +2795,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "iced_core", "iced_futures", @@ -2794,7 +2805,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "iced_core", "once_cell", @@ -2804,7 +2815,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "bytemuck", "cosmic-text", @@ -2821,7 +2832,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2840,7 +2851,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "iced_renderer", "iced_runtime", @@ -2854,7 +2865,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "iced_graphics", "iced_runtime", @@ -2926,15 +2937,15 @@ dependencies = [ [[package]] name = "image" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" dependencies = [ "bytemuck", "byteorder", "color_quant", "exr", - "gif 0.12.0", + "gif 0.13.1", "jpeg-decoder 0.3.1", "num-traits", "png 0.17.13", @@ -3056,15 +3067,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -[[package]] -name = "jobserver" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" -dependencies = [ - "libc", -] - [[package]] name = "jpeg-decoder" version = "0.1.22" @@ -3198,7 +3200,7 @@ source = "git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox_0.2. [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#08b2e1ca385b836411729c162984d59449fe3e51" +source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" dependencies = [ "apply", "ashpd", @@ -3338,9 +3340,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ "hashbrown", ] @@ -3469,6 +3471,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "miniz_oxide" version = "0.3.7" @@ -3865,7 +3877,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4016,7 +4028,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4039,9 +4051,9 @@ dependencies = [ [[package]] name = "palette" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d38e6e5ca1612e2081cc31188f08c3cba630ce4ba44709a153f1a0f38d678f2" +checksum = "ebfc23a4b76642983d57e4ad00bb4504eb30a8ce3c70f4aee1f725610e36d97a" dependencies = [ "approx", "fast-srgb8", @@ -4052,13 +4064,13 @@ dependencies = [ [[package]] name = "palette_derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05d1c929301fee6830dafa764341118829b2535c216b0571e3821ecac5c885b" +checksum = "e8890702dbec0bad9116041ae586f84805b13eecd1d8b1df27c29998a9969d6d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4169,7 +4181,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4645,12 +4657,12 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" +checksum = "fb78f46d0066053d16d4ca7b898e9343bc3530f71c61d5ad84cd404ada068745" dependencies = [ - "rust-embed-impl 8.2.0", - "rust-embed-utils 8.2.0", + "rust-embed-impl 8.3.0", + "rust-embed-utils 8.3.0", "walkdir", ] @@ -4663,20 +4675,20 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils 7.8.1", - "syn 2.0.50", + "syn 2.0.51", "walkdir", ] [[package]] name = "rust-embed-impl" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" +checksum = "b91ac2a3c6c0520a3fb3dd89321177c3c692937c4eb21893378219da10c44fc8" dependencies = [ "proc-macro2", "quote", - "rust-embed-utils 8.2.0", - "syn 2.0.50", + "rust-embed-utils 8.3.0", + "syn 2.0.51", "walkdir", ] @@ -4692,9 +4704,9 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" +checksum = "86f69089032567ffff4eada41c573fc43ff466c7db7c5688b2e7969584345581" dependencies = [ "sha2", "walkdir", @@ -4866,7 +4878,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4877,7 +4889,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -5057,12 +5069,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5180,9 +5192,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", @@ -5239,9 +5251,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" @@ -5282,7 +5294,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -5391,7 +5403,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2 0.5.6", "tracing", "windows-sys 0.48.0", ] @@ -5480,7 +5492,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -5807,7 +5819,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", "wasm-bindgen-shared", ] @@ -5841,7 +5853,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6255,7 +6267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -6264,7 +6276,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -6313,7 +6325,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -6348,17 +6360,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] @@ -6375,9 +6387,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" [[package]] name = "windows_aarch64_msvc" @@ -6393,9 +6405,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" [[package]] name = "windows_i686_gnu" @@ -6411,9 +6423,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" [[package]] name = "windows_i686_msvc" @@ -6429,9 +6441,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" [[package]] name = "windows_x86_64_gnu" @@ -6447,9 +6459,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" [[package]] name = "windows_x86_64_gnullvm" @@ -6465,9 +6477,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" [[package]] name = "windows_x86_64_msvc" @@ -6483,9 +6495,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" [[package]] name = "winit" @@ -6696,9 +6708,9 @@ checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" [[package]] name = "zbus" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c45d06ae3b0f9ba1fb2671268b975557d8f5a84bb5ec6e43964f87e763d8bca8" +checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" dependencies = [ "async-broadcast", "async-executor", @@ -6738,9 +6750,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a1ba45ed0ad344b85a2bb5a1fe9830aed23d67812ea39a586e7d0136439c7d" +checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -6784,7 +6796,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -6798,9 +6810,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" +checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" dependencies = [ "byteorder", "enumflags2", @@ -6813,9 +6825,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" +checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", diff --git a/src/main.rs b/src/main.rs index 87d4717..c099a2f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -637,7 +637,7 @@ impl App { let mut sections = Vec::with_capacity(3 + self.color_scheme_errors.len()); sections.push( - widget::view_switcher::horizontal(&self.color_scheme_tab_model) + widget::tab_bar::horizontal(&self.color_scheme_tab_model) .on_activate(Message::ColorSchemeTabActivate) .into(), ); @@ -2303,7 +2303,7 @@ impl Application for App { if tab_model.iter().count() > 1 { tab_column = tab_column.push( widget::container( - widget::view_switcher::horizontal(tab_model) + widget::tab_bar::horizontal(tab_model) .button_height(32) .button_spacing(space_xxs) .on_activate(Message::TabActivate) diff --git a/src/terminal.rs b/src/terminal.rs index bdb90ff..409a898 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -507,15 +507,12 @@ impl Terminal { let start = Point::new(Line(-(grid.history_size() as i32)), Column(0)); let mut end_line = grid.bottommost_line(); while end_line.0 > 0 { - if ! grid[end_line].is_clear() { + if !grid[end_line].is_clear() { break; } end_line.0 -= 1; } - let end = Point::new( - end_line, - Column(grid.columns() - 1), - ); + let end = Point::new(end_line, Column(grid.columns() - 1)); let mut selection = Selection::new(SelectionType::Lines, start, Side::Left); selection.update(end, Side::Right); term.selection = Some(selection); From 022854fbefa399cd6b023be285329b22e1cc47d9 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 27 Feb 2024 10:33:24 -0700 Subject: [PATCH 11/25] Update libcosmic --- Cargo.lock | 46 +++++++++++++++++++++++----------------------- src/main.rs | 29 +++++++++++++++++------------ 2 files changed, 40 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 437746f..aeee6d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1145,7 +1145,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1162,7 +1162,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "quote", "syn 1.0.109", @@ -1171,7 +1171,7 @@ dependencies = [ [[package]] name = "cosmic-files" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-files#5778d64e8cc8540221459e4b3c463da9bf2ee60b" +source = "git+https://github.com/pop-os/cosmic-files#65d61f556558bc348bea4325336ede8fae358a5c" dependencies = [ "chrono", "dirs", @@ -1247,7 +1247,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "almost", "cosmic-config", @@ -1740,9 +1740,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a147e1a6641a55d994b3e4e9fa4d9b180c8d652c09b363af8c9bf1b8e04139" +checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" [[package]] name = "etagere" @@ -2705,7 +2705,7 @@ dependencies = [ [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "iced_accessibility", "iced_core", @@ -2720,7 +2720,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "accesskit", "accesskit_winit", @@ -2729,7 +2729,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "bitflags 1.3.2", "log", @@ -2746,7 +2746,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "futures", "iced_core", @@ -2759,7 +2759,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2783,7 +2783,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2795,7 +2795,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "iced_core", "iced_futures", @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "iced_core", "once_cell", @@ -2815,7 +2815,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "bytemuck", "cosmic-text", @@ -2832,7 +2832,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2851,7 +2851,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "iced_renderer", "iced_runtime", @@ -2865,7 +2865,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "iced_graphics", "iced_runtime", @@ -3200,7 +3200,7 @@ source = "git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox_0.2. [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a0340aac268bf61529025c02bff10fb4c21dc6fc" +source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" dependencies = [ "apply", "ashpd", @@ -4433,9 +4433,9 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "rangemap" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795915a3930a5d6bafd9053d37602fea3e61be2e5d4d788983a8ba9654c1c6f2" +checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "raw-window-handle" @@ -4496,9 +4496,9 @@ checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" [[package]] name = "read-fonts" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c044ab88c43e2eae05b34a17fc13598736679fdb03d71b49fcfe114443ec8a86" +checksum = "17ea23eedb4d938031b6d4343222444608727a6aa68ec355e13588d9947ffe92" dependencies = [ "font-types", ] diff --git a/src/main.rs b/src/main.rs index c099a2f..207e412 100644 --- a/src/main.rs +++ b/src/main.rs @@ -668,10 +668,17 @@ impl App { } .style(style::Button::Icon); - let menu = - menu::color_scheme_menu(color_scheme_kind, color_scheme_id, &color_scheme_name); - - let popover = widget::popover(button, menu).show_popup(expanded); + let mut popover = widget::popover(button); + if expanded { + let menu = menu::color_scheme_menu( + color_scheme_kind, + color_scheme_id, + &color_scheme_name, + ); + popover = popover + .popup(menu) + .position(widget::popover::Position::Bottom); + } let item = match renaming { Some(value) => widget::settings::item_row(vec![ @@ -2341,12 +2348,10 @@ impl Application for App { }; let tab_element: Element<'_, Message> = match context_menu { - Some(position) => widget::popover( - terminal_box.context_menu(position), - menu::context_menu(&self.config, &self.key_binds, entity), - ) - .position(position) - .into(), + Some(point) => widget::popover(terminal_box.context_menu(point)) + .popup(menu::context_menu(&self.config, &self.key_binds, entity)) + .position(widget::popover::Position::Point(point)) + .into(), None => terminal_box.into(), }; tab_column = tab_column.push(tab_element); @@ -2483,13 +2488,13 @@ impl Application for App { cosmic_theme::LIGHT_THEME_ID } .into(), - cosmic_theme::Theme::version(), + cosmic_theme::Theme::VERSION, ) .map(|_update| Message::SystemThemeChange), cosmic_config::config_subscription::<_, cosmic_theme::ThemeMode>( TypeId::of::(), cosmic_theme::THEME_MODE_ID.into(), - cosmic_theme::ThemeMode::version(), + cosmic_theme::ThemeMode::VERSION, ) .map(|_update| Message::SystemThemeChange), match &self.dialog_opt { From f4a759ba4ddfb20af7f82a0ca562dbbe23452760 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 27 Feb 2024 10:54:27 -0700 Subject: [PATCH 12/25] Update libcosmic --- Cargo.lock | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aeee6d9..a973544 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1145,7 +1145,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1162,7 +1162,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "quote", "syn 1.0.109", @@ -1171,7 +1171,7 @@ dependencies = [ [[package]] name = "cosmic-files" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-files#65d61f556558bc348bea4325336ede8fae358a5c" +source = "git+https://github.com/pop-os/cosmic-files#0ed3f07ebc927391c7d1bb22b7107c91709d18bb" dependencies = [ "chrono", "dirs", @@ -1247,7 +1247,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "almost", "cosmic-config", @@ -2705,7 +2705,7 @@ dependencies = [ [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "iced_accessibility", "iced_core", @@ -2720,7 +2720,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "accesskit", "accesskit_winit", @@ -2729,7 +2729,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "bitflags 1.3.2", "log", @@ -2746,7 +2746,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "futures", "iced_core", @@ -2759,7 +2759,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2783,7 +2783,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2795,7 +2795,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "iced_core", "iced_futures", @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "iced_core", "once_cell", @@ -2815,7 +2815,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "bytemuck", "cosmic-text", @@ -2832,7 +2832,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2851,7 +2851,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "iced_renderer", "iced_runtime", @@ -2865,7 +2865,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "iced_graphics", "iced_runtime", @@ -3200,7 +3200,7 @@ source = "git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox_0.2. [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bc3e16619e573be45bc005f15de84ecd6da96856" +source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" dependencies = [ "apply", "ashpd", From c500ef814ca79e65247134c8323533d20db48802 Mon Sep 17 00:00:00 2001 From: Michael Murphy Date: Tue, 27 Feb 2024 22:25:36 +0100 Subject: [PATCH 13/25] fix: improve font rendering on light theme w/ iced web-colors feature (#147) --- Cargo.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a973544..4767786 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,9 +110,9 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ "cfg-if 1.0.0", "getrandom", @@ -229,9 +229,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -1145,7 +1145,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1162,7 +1162,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "quote", "syn 1.0.109", @@ -1171,7 +1171,7 @@ dependencies = [ [[package]] name = "cosmic-files" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-files#0ed3f07ebc927391c7d1bb22b7107c91709d18bb" +source = "git+https://github.com/pop-os/cosmic-files#8ab15027a521713850384fa87666bb9974f2666b" dependencies = [ "chrono", "dirs", @@ -1247,7 +1247,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "almost", "cosmic-config", @@ -2705,7 +2705,7 @@ dependencies = [ [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_accessibility", "iced_core", @@ -2720,7 +2720,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "accesskit", "accesskit_winit", @@ -2729,7 +2729,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bitflags 1.3.2", "log", @@ -2746,7 +2746,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "futures", "iced_core", @@ -2759,7 +2759,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2783,7 +2783,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2795,7 +2795,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_core", "iced_futures", @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_core", "once_cell", @@ -2815,7 +2815,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bytemuck", "cosmic-text", @@ -2832,7 +2832,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2851,7 +2851,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_renderer", "iced_runtime", @@ -2865,7 +2865,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_graphics", "iced_runtime", @@ -3200,7 +3200,7 @@ source = "git+https://gitlab.redox-os.org/redox-os/liblibc.git?branch=redox_0.2. [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#a593f866efb25d149065b11714bb954c26d34cec" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "apply", "ashpd", From ebaffad37c4c0ddd995797d701d3bf6a3be2d3e8 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 27 Feb 2024 21:17:05 -0700 Subject: [PATCH 14/25] Add icons --- justfile | 8 +++++- res/com.system76.CosmicTerm.desktop | 2 +- .../128x128/apps/com.system76.CosmicTerm.svg | 16 ++++++++++++ .../16x16/apps/com.system76.CosmicTerm.svg | 16 ++++++++++++ .../24x24/apps/com.system76.CosmicTerm.svg | 16 ++++++++++++ .../256x256/apps/com.system76.CosmicTerm.svg | 26 +++++++++++++++++++ .../32x32/apps/com.system76.CosmicTerm.svg | 16 ++++++++++++ .../48x48/apps/com.system76.CosmicTerm.svg | 16 ++++++++++++ .../64x64/apps/com.system76.CosmicTerm.svg | 16 ++++++++++++ 9 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg create mode 100644 res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg create mode 100644 res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg create mode 100644 res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg create mode 100644 res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg create mode 100644 res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg create mode 100644 res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg diff --git a/justfile b/justfile index 23d5ad8..c4c39f4 100644 --- a/justfile +++ b/justfile @@ -15,6 +15,9 @@ desktop := APPID + '.desktop' desktop-src := 'res' / desktop desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop +icons-src := 'res' / 'icons' / 'hicolor' +icons-dst := clean(rootdir / prefix) / 'share' / 'icons' / 'hicolor' + # Default recipe which runs `just build-release` default: build-release @@ -57,7 +60,10 @@ run *args: # Installs files install: install -Dm0755 {{bin-src}} {{bin-dst}} - install -Dm0755 {{desktop-src}} {{desktop-dst}} + install -Dm0644 {{desktop-src}} {{desktop-dst}} + for size in `ls {{icons-src}}`; do \ + install -Dm0644 "{{icons-src}}/$size/apps/{{APPID}}.svg" "{{icons-dst}}/$size/apps/{{APPID}}.svg"; \ + done # Uninstalls installed files uninstall: diff --git a/res/com.system76.CosmicTerm.desktop b/res/com.system76.CosmicTerm.desktop index 0bb457a..3946c35 100644 --- a/res/com.system76.CosmicTerm.desktop +++ b/res/com.system76.CosmicTerm.desktop @@ -5,6 +5,6 @@ Exec=cosmic-term Terminal=false Type=Application StartupNotify=true -Icon=utilities-terminal +Icon=com.system76.CosmicTerm Categories=COSMIC;System;TerminalEmulator; Keywords=Command;Shell;Terminal; diff --git a/res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg new file mode 100644 index 0000000..4f43890 --- /dev/null +++ b/res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg new file mode 100644 index 0000000..777b106 --- /dev/null +++ b/res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg new file mode 100644 index 0000000..d07e190 --- /dev/null +++ b/res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg new file mode 100644 index 0000000..e77fc3f --- /dev/null +++ b/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg new file mode 100644 index 0000000..c9f05c8 --- /dev/null +++ b/res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg new file mode 100644 index 0000000..30f41d7 --- /dev/null +++ b/res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg new file mode 100644 index 0000000..97cdb8b --- /dev/null +++ b/res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + From 6c6ceaa853dd0050eb5ee124918df4697f380628 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 27 Feb 2024 21:19:20 -0700 Subject: [PATCH 15/25] Fix icon exports --- .../128x128/apps/com.system76.CosmicTerm.svg | 10 ++++++---- .../16x16/apps/com.system76.CosmicTerm.svg | 10 ++++++---- .../24x24/apps/com.system76.CosmicTerm.svg | 10 ++++++---- .../256x256/apps/com.system76.CosmicTerm.svg | 16 ++++------------ .../32x32/apps/com.system76.CosmicTerm.svg | 10 ++++++---- .../48x48/apps/com.system76.CosmicTerm.svg | 10 ++++++---- .../64x64/apps/com.system76.CosmicTerm.svg | 10 ++++++---- 7 files changed, 40 insertions(+), 36 deletions(-) diff --git a/res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg index 4f43890..6e61b76 100644 --- a/res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg +++ b/res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg @@ -1,8 +1,10 @@ - - - - + + + + + + diff --git a/res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg index 777b106..a9c99a8 100644 --- a/res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg +++ b/res/icons/hicolor/16x16/apps/com.system76.CosmicTerm.svg @@ -1,8 +1,10 @@ - - - - + + + + + + diff --git a/res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg index d07e190..4dbe51e 100644 --- a/res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg +++ b/res/icons/hicolor/24x24/apps/com.system76.CosmicTerm.svg @@ -1,8 +1,10 @@ - - - - + + + + + + diff --git a/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg index e77fc3f..001268b 100644 --- a/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg +++ b/res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg @@ -1,24 +1,16 @@ - - - - - - - - + + - - - + - + diff --git a/res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg index c9f05c8..d653560 100644 --- a/res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg +++ b/res/icons/hicolor/32x32/apps/com.system76.CosmicTerm.svg @@ -1,8 +1,10 @@ - - - - + + + + + + diff --git a/res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg index 30f41d7..d176a04 100644 --- a/res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg +++ b/res/icons/hicolor/48x48/apps/com.system76.CosmicTerm.svg @@ -1,8 +1,10 @@ - - - - + + + + + + diff --git a/res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg b/res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg index 97cdb8b..9ed572a 100644 --- a/res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg +++ b/res/icons/hicolor/64x64/apps/com.system76.CosmicTerm.svg @@ -1,8 +1,10 @@ - - - - + + + + + + From c9f99a3025eefebb23e564bb3100a75152a7a93b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 27 Feb 2024 21:20:00 -0700 Subject: [PATCH 16/25] Add about page --- Cargo.lock | 88 +++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 3 +- build.rs | 8 ++++ debian/control | 3 +- i18n/en/cosmic_term.ftl | 6 +++ src/main.rs | 35 ++++++++++++++-- src/menu.rs | 2 + 7 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 build.rs diff --git a/Cargo.lock b/Cargo.lock index 4767786..b488544 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,6 +281,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" +[[package]] +name = "anyhow" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" + [[package]] name = "apply" version = "0.3.0" @@ -1220,6 +1226,7 @@ dependencies = [ "shlex", "smol_str", "tokio", + "vergen", ] [[package]] @@ -1495,6 +1502,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derivative" version = "2.2.0" @@ -3775,6 +3791,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.46" @@ -3880,6 +3902,15 @@ dependencies = [ "syn 2.0.51", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "objc" version = "0.2.7" @@ -4283,6 +4314,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -4783,6 +4820,12 @@ dependencies = [ "owned_ttf_parser 0.15.2", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "rustybuzz" version = "0.12.1" @@ -5319,6 +5362,39 @@ dependencies = [ "weezl", ] +[[package]] +name = "time" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -5740,6 +5816,18 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "vergen" +version = "8.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +dependencies = [ + "anyhow", + "cfg-if 1.0.0", + "rustversion", + "time", +] + [[package]] name = "version-compare" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index ebdc77b..c3568d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,8 @@ version = "0.1.0" edition = "2021" rust-version = "1.71" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[build-dependencies] +vergen = { version = "8", features = ["git", "gitcl"] } [dependencies] alacritty_terminal = "0.20" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..19225ce --- /dev/null +++ b/build.rs @@ -0,0 +1,8 @@ +fn main() -> Result<(), Box> { + vergen::EmitBuilder::builder() + .fail_on_error() + .git_commit_date() + .git_sha(true) + .emit()?; + Ok(()) +} diff --git a/debian/control b/debian/control index 0cc4c8f..cf75a41 100644 --- a/debian/control +++ b/debian/control @@ -4,6 +4,7 @@ Priority: optional Maintainer: Jeremy Soller Build-Depends: debhelper-compat (=13), + git, just (>= 1.13.0), pkg-config, rust-all, @@ -14,4 +15,4 @@ Package: cosmic-term Architecture: amd64 arm64 Depends: ${misc:Depends}, ${shlibs:Depends} Provides: x-terminal-emulator -Description: Cosmic Terminal +Description: COSMIC Terminal diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index 7292cfd..cc31f52 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -1,7 +1,12 @@ +cosmic-terminal = COSMIC Terminal new-terminal = New terminal # Context Pages +## About +about = About +git-description = Git commit {$hash} on {$date} + ## Color schemes color-schemes = Color schemes rename = Rename @@ -89,3 +94,4 @@ split-vertical = Split vertical pane-toggle-maximize = Toggle maximized menu-color-schemes = Color schemes... menu-settings = Settings... +menu-about = About COSMIC Terminal... diff --git a/src/main.rs b/src/main.rs index 207e412..7696386 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,6 +171,7 @@ pub struct Flags { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Action { + About, ColorSchemes(ColorSchemeKind), Copy, Find, @@ -210,6 +211,7 @@ pub enum Action { impl Action { pub fn message(self, entity_opt: Option) -> Message { match self { + Action::About => Message::ToggleContextPage(ContextPage::About), Action::ColorSchemes(color_scheme_kind) => { Message::ToggleContextPage(ContextPage::ColorSchemes(color_scheme_kind)) } @@ -327,6 +329,7 @@ pub enum Message { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ContextPage { + About, ColorSchemes(ColorSchemeKind), Profiles, Settings, @@ -335,6 +338,7 @@ pub enum ContextPage { impl ContextPage { fn title(&self) -> String { match self { + Self::About => fl!("about"), Self::ColorSchemes(_color_scheme_kind) => fl!("color-schemes"), Self::Profiles => fl!("profiles"), Self::Settings => fl!("settings"), @@ -536,9 +540,9 @@ impl App { let (header_title, window_title) = match tab_model.text(tab_model.active()) { Some(tab_title) => ( tab_title.to_string(), - format!("{tab_title} — COSMIC Terminal"), + format!("{tab_title} — {}", fl!("cosmic-terminal")), ), - None => (String::new(), "COSMIC Terminal".to_string()), + None => (String::new(), fl!("cosmic-terminal")), }; self.set_header_title(header_title); Command::batch([ @@ -548,7 +552,7 @@ impl App { } else { log::error!("Failed to get the specific pane"); Command::batch([ - self.set_window_title("COSMIC Terminal".to_string(), window::Id::MAIN), + self.set_window_title(fl!("cosmic-terminal"), window::Id::MAIN), self.update_focus(), ]) } @@ -631,6 +635,30 @@ impl App { } } + fn about(&self) -> Element { + let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; + widget::column::with_children(vec![ + widget::svg(widget::svg::Handle::from_memory( + &include_bytes!( + "../res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg" + )[..], + )) + .into(), + widget::text::heading(fl!("cosmic-terminal")).into(), + widget::button::link("https://github.com/pop-os/cosmic-term") + .padding(0) + .into(), + widget::text(fl!( + "git-description", + hash = env!("VERGEN_GIT_SHA"), + date = env!("VERGEN_GIT_COMMIT_DATE") + )) + .into(), + ]) + .spacing(space_xxs) + .into() + } + fn color_schemes(&self, color_scheme_kind: ColorSchemeKind) -> Element { let cosmic_theme::Spacing { space_xxxs, .. } = self.core().system_theme().cosmic().spacing; @@ -2274,6 +2302,7 @@ impl Application for App { } Some(match self.context_page { + ContextPage::About => self.about(), ContextPage::ColorSchemes(color_scheme_kind) => self.color_schemes(color_scheme_kind), ContextPage::Profiles => self.profiles(), ContextPage::Settings => self.settings(), diff --git a/src/menu.rs b/src/menu.rs index 345265c..07d9546 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -226,6 +226,8 @@ pub fn menu_bar<'a>(config: &Config, key_binds: &HashMap) -> El Action::ColorSchemes(config.color_scheme_kind()), ), menu_item(fl!("menu-settings"), Action::Settings), + MenuTree::new(horizontal_rule(1)), + menu_item(fl!("menu-about"), Action::About), ], ), ]) From efca9e7c228e5a69b68221436efb2154602a544d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Feb 2024 08:45:45 -0700 Subject: [PATCH 17/25] Sync some changes from cosmic-edit --- Cargo.lock | 101 +++++++---------------------------------------------- Cargo.toml | 26 +++++++------- build.rs | 3 ++ 3 files changed, 29 insertions(+), 101 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b488544..97bb9a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1177,14 +1177,14 @@ dependencies = [ [[package]] name = "cosmic-files" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-files#8ab15027a521713850384fa87666bb9974f2666b" +source = "git+https://github.com/pop-os/cosmic-files.git#8ab15027a521713850384fa87666bb9974f2666b" dependencies = [ "chrono", "dirs", "env_logger 0.11.2", "fork", - "i18n-embed 0.14.1", - "i18n-embed-fl 0.7.0", + "i18n-embed", + "i18n-embed-fl", "image 0.24.9", "lexical-sort", "libcosmic", @@ -1193,7 +1193,7 @@ dependencies = [ "notify", "once_cell", "paste", - "rust-embed 8.3.0", + "rust-embed", "serde", "smol_str", "systemicons", @@ -1211,8 +1211,8 @@ dependencies = [ "env_logger 0.10.2", "fork", "hex_color", - "i18n-embed 0.13.9", - "i18n-embed-fl 0.6.7", + "i18n-embed", + "i18n-embed-fl", "indexmap", "lazy_static", "lexical-sort", @@ -1221,7 +1221,7 @@ dependencies = [ "palette", "paste", "ron", - "rust-embed 6.8.1", + "rust-embed", "serde", "shlex", "smol_str", @@ -2596,28 +2596,6 @@ dependencies = [ "unic-langid", ] -[[package]] -name = "i18n-embed" -version = "0.13.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92a86226a7a16632de6723449ee5fe70bac5af718bc642ee9ca2f0f6e14fa1fa" -dependencies = [ - "arc-swap", - "fluent", - "fluent-langneg", - "fluent-syntax", - "i18n-embed-impl", - "intl-memoizer", - "lazy_static", - "locale_config", - "log", - "parking_lot 0.12.1", - "rust-embed 6.8.1", - "thiserror", - "unic-langid", - "walkdir", -] - [[package]] name = "i18n-embed" version = "0.14.1" @@ -2634,33 +2612,12 @@ dependencies = [ "locale_config", "log", "parking_lot 0.12.1", - "rust-embed 8.3.0", + "rust-embed", "thiserror", "unic-langid", "walkdir", ] -[[package]] -name = "i18n-embed-fl" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a3d3569737dfaac7fc1c4078e6af07471c3060b8e570bcd83cdd5f4685395" -dependencies = [ - "dashmap", - "find-crate", - "fluent", - "fluent-syntax", - "i18n-config", - "i18n-embed 0.13.9", - "lazy_static", - "proc-macro-error", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 2.0.51", - "unic-langid", -] - [[package]] name = "i18n-embed-fl" version = "0.7.0" @@ -2672,7 +2629,7 @@ dependencies = [ "fluent", "fluent-syntax", "i18n-config", - "i18n-embed 0.14.1", + "i18n-embed", "lazy_static", "proc-macro-error", "proc-macro2", @@ -4681,38 +4638,14 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" -[[package]] -name = "rust-embed" -version = "6.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" -dependencies = [ - "rust-embed-impl 6.8.1", - "rust-embed-utils 7.8.1", - "walkdir", -] - [[package]] name = "rust-embed" version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb78f46d0066053d16d4ca7b898e9343bc3530f71c61d5ad84cd404ada068745" dependencies = [ - "rust-embed-impl 8.3.0", - "rust-embed-utils 8.3.0", - "walkdir", -] - -[[package]] -name = "rust-embed-impl" -version = "6.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" -dependencies = [ - "proc-macro2", - "quote", - "rust-embed-utils 7.8.1", - "syn 2.0.51", + "rust-embed-impl", + "rust-embed-utils", "walkdir", ] @@ -4724,21 +4657,11 @@ checksum = "b91ac2a3c6c0520a3fb3dd89321177c3c692937c4eb21893378219da10c44fc8" dependencies = [ "proc-macro2", "quote", - "rust-embed-utils 8.3.0", + "rust-embed-utils", "syn 2.0.51", "walkdir", ] -[[package]] -name = "rust-embed-utils" -version = "7.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d38ff6bf570dc3bb7100fce9f7b60c33fa71d80e88da3f2580df4ff2bdded74" -dependencies = [ - "sha2", - "walkdir", -] - [[package]] name = "rust-embed-utils" version = "8.3.0" diff --git a/Cargo.toml b/Cargo.toml index c3568d3..840510f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,9 @@ [package] name = "cosmic-term" version = "0.1.0" +authors = ["Jeremy Soller "] edition = "2021" +license = "GPL-3.0-only" rust-version = "1.71" [build-dependencies] @@ -16,18 +18,18 @@ lazy_static = "1" lexical-sort = "0.3.1" log = "0.4" palette = { version = "0.7", features = ["serde"] } +paste = "1.0" ron = "0.8" serde = { version = "1", features = ["serde_derive"] } shlex = "1" tokio = { version = "1", features = ["sync"] } # Internationalization -i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] } -i18n-embed-fl = "0.6" -rust-embed = "6" -paste = "1.0" +i18n-embed = { version = "0.14", features = ["fluent-system", "desktop-requester"] } +i18n-embed-fl = "0.7" +rust-embed = "8" [dependencies.cosmic-files] -git = "https://github.com/pop-os/cosmic-files" +git = "https://github.com/pop-os/cosmic-files.git" default-features = false [dependencies.cosmic-text] @@ -43,17 +45,17 @@ features = ["multi-window", "tokio", "winit"] version = "0.2.1" features = ["serde"] -[features] -default = ["wgpu"] -wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"] - [patch.crates-io] # https://github.com/rust-lang/libc/pull/3512 libc = { git = "https://gitlab.redox-os.org/redox-os/liblibc.git", branch = "redox_0.2.151" } +[target.'cfg(unix)'.dependencies] +fork = "0.1" + +[features] +default = ["wgpu"] +wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"] + [profile.release-with-debug] inherits = "release" debug = true - -[target.'cfg(unix)'.dependencies] -fork = "0.1" diff --git a/build.rs b/build.rs index 19225ce..3628d6a 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,7 @@ fn main() -> Result<(), Box> { + // Rebuild if i18n files change + println!("cargo:rerun-if-changed=i18n"); + vergen::EmitBuilder::builder() .fail_on_error() .git_commit_date() From 910dff2c90234ab17edd75dd96a7ff9a18d8f842 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Feb 2024 09:15:58 -0700 Subject: [PATCH 18/25] Improve about page, sort messages --- Cargo.lock | 37 ++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 88 +++++++++++++++++++++++++++++++---------------------- 3 files changed, 89 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97bb9a8..3130abd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1218,6 +1218,7 @@ dependencies = [ "lexical-sort", "libcosmic", "log", + "open", "palette", "paste", "ron", @@ -3001,6 +3002,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + [[package]] name = "is-terminal" version = "0.4.12" @@ -3012,6 +3022,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "itoa" version = "1.0.10" @@ -3960,6 +3980,17 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "open" +version = "5.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eedff767bc49d336bff300224f73307ae36963c843e38dc9312a22171b012cbc" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -4133,6 +4164,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "percent-encoding" version = "2.3.1" diff --git a/Cargo.toml b/Cargo.toml index 840510f..769bea0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ indexmap = "2" lazy_static = "1" lexical-sort = "0.3.1" log = "0.4" +open = "5.0.2" palette = { version = "0.7", features = ["serde"] } paste = "1.0" ron = "0.8" diff --git a/src/main.rs b/src/main.rs index 7696386..dfad448 100644 --- a/src/main.rs +++ b/src/main.rs @@ -258,38 +258,40 @@ pub enum Message { AppTheme(AppTheme), ColorSchemeCollapse, ColorSchemeDelete(ColorSchemeKind, ColorSchemeId), + ColorSchemeExpand(ColorSchemeKind, ColorSchemeId), ColorSchemeExport(ColorSchemeKind, ColorSchemeId), ColorSchemeExportResult(ColorSchemeKind, ColorSchemeId, DialogResult), - ColorSchemeExpand(ColorSchemeKind, ColorSchemeId), - ColorSchemeRename(ColorSchemeKind, ColorSchemeId, String), - ColorSchemeRenameSubmit, ColorSchemeImport(ColorSchemeKind), ColorSchemeImportResult(ColorSchemeKind, DialogResult), + ColorSchemeRename(ColorSchemeKind, ColorSchemeId, String), + ColorSchemeRenameSubmit, ColorSchemeTabActivate(widget::segmented_button::Entity), Config(Config), Copy(Option), + DefaultBoldFontWeight(usize), + DefaultDimFontWeight(usize), DefaultFont(usize), DefaultFontSize(usize), DefaultFontStretch(usize), DefaultFontWeight(usize), - DefaultDimFontWeight(usize), - DefaultBoldFontWeight(usize), DefaultZoomStep(usize), DialogMessage(DialogMessage), - Key(Modifiers, Key), Find(bool), FindNext, FindPrevious, FindSearchValueChanged(String), - PaneClicked(pane_grid::Pane), - PaneSplit(pane_grid::Axis), - PaneToggleMaximized, - PaneFocusAdjacent(pane_grid::Direction), - PaneDragged(pane_grid::DragEvent), - PaneResized(pane_grid::ResizeEvent), + FocusFollowMouse(bool), + Key(Modifiers, Key), + LaunchUrl(String), Modifiers(Modifiers), MouseEnter(pane_grid::Pane), Opacity(u8), + PaneClicked(pane_grid::Pane), + PaneDragged(pane_grid::DragEvent), + PaneFocusAdjacent(pane_grid::Direction), + PaneResized(pane_grid::ResizeEvent), + PaneSplit(pane_grid::Axis), + PaneToggleMaximized, Paste(Option), PasteValue(Option, String), ProfileCollapse(ProfileId), @@ -302,7 +304,7 @@ pub enum Message { ProfileSyntaxTheme(ProfileId, ColorSchemeKind, usize), ProfileTabTitle(ProfileId, String), SelectAll(Option), - UseBrightBold(bool), + ShowAdvancedFontSettings(bool), ShowHeaderBar(bool), SyntaxTheme(ColorSchemeKind, usize), SystemThemeChange, @@ -312,19 +314,18 @@ pub enum Message { TabContextAction(segmented_button::Entity, Action), TabContextMenu(pane_grid::Pane, Option), TabNew, - TabPrev, TabNext, + TabPrev, TermEvent(pane_grid::Pane, segmented_button::Entity, TermEvent), TermEventTx(mpsc::Sender<(pane_grid::Pane, segmented_button::Entity, TermEvent)>), ToggleContextPage(ContextPage), - ShowAdvancedFontSettings(bool), + UpdateDefaultProfile((bool, ProfileId)), + UseBrightBold(bool), WindowClose, WindowNew, ZoomIn, ZoomOut, ZoomReset, - FocusFollowMouse(bool), - UpdateDefaultProfile((bool, ProfileId)), } #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -637,24 +638,31 @@ impl App { fn about(&self) -> Element { let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; + let repository = "https://github.com/pop-os/cosmic-term"; + let hash = env!("VERGEN_GIT_SHA"); + let date = env!("VERGEN_GIT_COMMIT_DATE"); widget::column::with_children(vec![ widget::svg(widget::svg::Handle::from_memory( &include_bytes!( - "../res/icons/hicolor/256x256/apps/com.system76.CosmicTerm.svg" + "../res/icons/hicolor/128x128/apps/com.system76.CosmicTerm.svg" )[..], )) .into(), - widget::text::heading(fl!("cosmic-terminal")).into(), - widget::button::link("https://github.com/pop-os/cosmic-term") + widget::text::title3(fl!("cosmic-terminal")).into(), + widget::button::link(repository) + .on_press(Message::LaunchUrl(repository.to_string())) .padding(0) .into(), - widget::text(fl!( + widget::button::link(fl!( "git-description", - hash = env!("VERGEN_GIT_SHA"), - date = env!("VERGEN_GIT_COMMIT_DATE") + hash = hash, + date = date )) + .on_press(Message::LaunchUrl(format!("{}/commits/{}", repository, hash))) + .padding(0) .into(), ]) + .align_items(Alignment::Center) .spacing(space_xxs) .into() } @@ -1446,9 +1454,6 @@ impl Application for App { } match message { - Message::UpdateDefaultProfile((default, profile_id)) => { - config_set!(default_profile, default.then_some(profile_id)); - } Message::AppTheme(app_theme) => { self.config.app_theme = app_theme; return self.save_config(); @@ -1730,13 +1735,6 @@ impl Application for App { return dialog.update(dialog_message); } } - Message::Key(modifiers, key) => { - for (key_bind, action) in self.key_binds.iter() { - if key_bind.matches(modifiers, &key) { - return self.update(action.message(None)); - } - } - } Message::Find(find) => { self.find = find; if find { @@ -1790,6 +1788,22 @@ impl Application for App { Message::FindSearchValueChanged(value) => { self.find_search_value = value; } + Message::FocusFollowMouse(focus_follow_mouse) => { + config_set!(focus_follow_mouse, focus_follow_mouse); + } + Message::Key(modifiers, key) => { + for (key_bind, action) in self.key_binds.iter() { + if key_bind.matches(modifiers, &key) { + return self.update(action.message(None)); + } + } + } + Message::LaunchUrl(url) => match open::that_detached(&url) { + Ok(()) => {} + Err(err) => { + log::warn!("failed to open {:?}: {}", url, err); + } + }, Message::Modifiers(modifiers) => { self.modifiers = modifiers; } @@ -1962,8 +1976,8 @@ impl Application for App { return self.save_config(); } } - Message::FocusFollowMouse(focus_follow_mouse) => { - config_set!(focus_follow_mouse, focus_follow_mouse); + Message::ShowAdvancedFontSettings(show) => { + self.show_advanced_font_settings = show; } Message::SystemThemeChange => { return self.update_config(); @@ -2262,8 +2276,8 @@ impl Application for App { self.set_context_title(context_page.title()); } - Message::ShowAdvancedFontSettings(show) => { - self.show_advanced_font_settings = show; + Message::UpdateDefaultProfile((default, profile_id)) => { + config_set!(default_profile, default.then_some(profile_id)); } Message::WindowClose => { return window::close(window::Id::MAIN); From 8cb92d36ae01f8658c45ca34ef04f68e9d83fc69 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Feb 2024 09:33:43 -0700 Subject: [PATCH 19/25] Remove about heading --- i18n/en/cosmic_term.ftl | 1 - src/main.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index cc31f52..15712ff 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -4,7 +4,6 @@ new-terminal = New terminal # Context Pages ## About -about = About git-description = Git commit {$hash} on {$date} ## Color schemes diff --git a/src/main.rs b/src/main.rs index dfad448..ef8e0ad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -339,7 +339,7 @@ pub enum ContextPage { impl ContextPage { fn title(&self) -> String { match self { - Self::About => fl!("about"), + Self::About => String::new(), Self::ColorSchemes(_color_scheme_kind) => fl!("color-schemes"), Self::Profiles => fl!("profiles"), Self::Settings => fl!("settings"), From 162b9e081309144f6ab807c7470905e4d6bbb8cf Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Feb 2024 10:30:11 -0700 Subject: [PATCH 20/25] Support for vergen information when vendoring --- build.rs | 14 +++++++++----- debian/rules | 6 +----- justfile | 12 ++++++++---- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/build.rs b/build.rs index 3628d6a..ccaa98f 100644 --- a/build.rs +++ b/build.rs @@ -2,10 +2,14 @@ fn main() -> Result<(), Box> { // Rebuild if i18n files change println!("cargo:rerun-if-changed=i18n"); - vergen::EmitBuilder::builder() - .fail_on_error() - .git_commit_date() - .git_sha(true) - .emit()?; + // Emit version information (if not cached by just vendor) + let mut vergen = vergen::EmitBuilder::builder(); + if std::env::var_os("VERGEN_GIT_COMMIT_DATE").is_none() { + vergen.git_commit_date(); + } + if std::env::var_os("VERGEN_GIT_SHA").is_none() { + vergen.git_sha(true); + } + vergen.fail_on_error().emit()?; Ok(()) } diff --git a/debian/rules b/debian/rules index b87b559..d2b0446 100755 --- a/debian/rules +++ b/debian/rules @@ -8,11 +8,7 @@ export VENDOR ?= 1 override_dh_auto_clean: if ! ischroot && test "${VENDOR}" = "1"; then \ - mkdir -p .cargo; \ - cargo vendor | head -n -1 > .cargo/config; \ - echo 'directory = "vendor"' >> .cargo/config; \ - tar pcf vendor.tar vendor; \ - rm -rf vendor; \ + just vendor; \ fi override_dh_auto_build: diff --git a/justfile b/justfile index c4c39f4..e90c1a6 100644 --- a/justfile +++ b/justfile @@ -73,10 +73,14 @@ uninstall: vendor: mkdir -p .cargo cargo vendor --sync Cargo.toml \ - | head -n -1 > .cargo/config - echo 'directory = "vendor"' >> .cargo/config - tar pcf vendor.tar vendor - rm -rf vendor + | head -n -1 > .cargo/config.toml + echo 'directory = "vendor"' >> .cargo/config.toml + echo >> .cargo/config.toml + echo '[env]' >> .cargo/config.toml + echo "VERGEN_GIT_COMMIT_DATE = \"$(git log -1 --pretty=format:'%cs' HEAD)\"" >> .cargo/config.toml + echo "VERGEN_GIT_SHA = \"$(git rev-parse --short HEAD)\"" >> .cargo/config.toml + tar pcf vendor.tar .cargo vendor + rm -rf .cargo vendor # Extracts vendored dependencies vendor-extract: From 9fdbccf1626a92e09b27b9ed132ea62a27dc1edd Mon Sep 17 00:00:00 2001 From: W <150025636+git-f0x@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:10:38 +0100 Subject: [PATCH 21/25] i18n(sr): Update translations (#1) * i18n(sr-Latn): Update translation * i18n(sr-Cyrl): Update translation * i18n(sr-Latn): Minor tweak --- i18n/sr-Cyrl/cosmic_term.ftl | 76 ++++++++++++++++++++++++++++++------ i18n/sr-Latn/cosmic_term.ftl | 76 ++++++++++++++++++++++++++++++------ 2 files changed, 130 insertions(+), 22 deletions(-) diff --git a/i18n/sr-Cyrl/cosmic_term.ftl b/i18n/sr-Cyrl/cosmic_term.ftl index 26ce2b8..02261b8 100644 --- a/i18n/sr-Cyrl/cosmic_term.ftl +++ b/i18n/sr-Cyrl/cosmic_term.ftl @@ -1,5 +1,30 @@ +cosmic-terminal = COSMIC Терминал +new-terminal = Нови терминал + # Context Pages +## About +about = О програму +git-description = Git commit {$hash} on {$date} + +## Color schemes +color-schemes = Шеме боја +rename = Преименуј +export = Извези +delete = Избриши +import = Увези +import-errors = Грешке при увозу + +## Profiles +profiles = Профили +name = Име +command-line = Командна линија +tab-title = Наслов картице +tab-title-description = Замени подразумевани наслов картице +add-profile = Додај профил +new-profile = Нови профил +make-default = Постави као подразумевани + ## Settings settings = Подешавања @@ -9,15 +34,35 @@ theme = Тема match-desktop = Као систем dark = Тамна light = Светла -syntax-dark = Тамна синтакса -syntax-light = Светла синтакса -advanced-font-settings = Напредна подешавања фонта -default-font = Подразумевани фонт -default-font-stretch = Подразумевано растезање фонта -default-font-weight = Подразумевана дебљина фонта -default-bold-font-weight = Подразумевана дебљина подебљаног фонта -default-font-size = Подразумевана величина фонта +syntax-dark = Тамна тема синтаксе +syntax-light = Светла тема синтаксе default-zoom-step = Подразумевани корак увећања +opacity = Непрозирност позадине + +### Font +font = Фонт +advanced-font-settings = Напредна подешавања фонта +default-font = Фонт +default-font-size = Величина фонта +default-font-stretch = Растезање фонта +default-font-weight = Дебљина нормалног фонта +default-dim-font-weight = Дебљина тамног фонта +default-bold-font-weight = Дебљина подебљаног фонта +use-bright-bold = Учини подебљани текст светлијим + +### Splits +splits = Поделе +focus-follow-mouse = Фокус куцања прати миш + +### Advanced +advanced = Напредно +show-headerbar = Прикажи заглавље +show-header-description = Откријте заглавље из менија десног клика. + +# Find +find-placeholder = Пронађи... +find-previous = Пронађи претходно +find-next = Пронађи следеће # Menu @@ -25,6 +70,8 @@ default-zoom-step = Подразумевани корак увећања file = Датотека new-tab = Нова картица new-window = Нови прозор +profile = Профили +menu-profiles = Профили... close-tab = Затвори картицу quit = Изађи @@ -37,7 +84,14 @@ find = Пронађи ## View view = Приказ +zoom-in = Већи текст +zoom-reset = Подразумевана величина текста +zoom-out = Мањи текст +next-tab = Следећа картица +previous-tab = Претходна картица +split-horizontal = Подели хоризонтално +split-vertical = Подели вертикално +pane-toggle-maximize = Максимизуј +menu-color-schemes = Шеме боја... menu-settings = Подешавања... - -# Context menu -show-headerbar = Прикажи траку заглавља +menu-about = О COSMIC Терминалу... diff --git a/i18n/sr-Latn/cosmic_term.ftl b/i18n/sr-Latn/cosmic_term.ftl index 64cd56f..369efe8 100644 --- a/i18n/sr-Latn/cosmic_term.ftl +++ b/i18n/sr-Latn/cosmic_term.ftl @@ -1,5 +1,30 @@ +cosmic-terminal = COSMIC Terminal +new-terminal = Novi terminal + # Context Pages +## About +about = O programu +git-description = Git commit {$hash} on {$date} + +## Color schemes +color-schemes = Šeme boja +rename = Preimenuj +export = Izvezi +delete = Izbriši +import = Uvezi +import-errors = Greške pri uvozu + +## Profiles +profiles = Profili +name = Ime +command-line = Komandna linija +tab-title = Naslov kartice +tab-title-description = Zameni podrazumevani naslov kartice +add-profile = Dodaj profil +new-profile = Novi profil +make-default = Postavi kao podrazumevani + ## Settings settings = Podešavanja @@ -9,15 +34,35 @@ theme = Tema match-desktop = Kao sistem dark = Tamna light = Svetla -syntax-dark = Tamna sintaksa -syntax-light = Svetla sintaksa -advanced-font-settings = Napredna podešavanja fonta -default-font = Podrazumevani font -default-font-stretch = Podrazumevano rastezanje fonta -default-font-weight = Podrazumevana debljina fonta -default-bold-font-weight = Podrazumevana debljina podebljanog fonta -default-font-size = Podrazumevana veličina fonta +syntax-dark = Tamna tema sintakse +syntax-light = Svetla tema sintakse default-zoom-step = Podrazumevani korak uvećanja +opacity = Neprozirnost pozadine + +### Font +font = Font +advanced-font-settings = Napredna podešavanja fonta +default-font = Font +default-font-size = Veličina fonta +default-font-stretch = Rastezanje fonta +default-font-weight = Debljina normalnog fonta +default-dim-font-weight = Debljina tamnog fonta +default-bold-font-weight = Debljina podebljanog fonta +use-bright-bold = Učini podebljani tekst svetlijim + +### Splits +splits = Podele +focus-follow-mouse = Fokus kucanja prati miš + +### Advanced +advanced = Napredno +show-headerbar = Prikaži zaglavlje +show-header-description = Otkrijte zaglavlje iz menija desnog klika. + +# Find +find-placeholder = Pronađi... +find-previous = Pronađi prethodno +find-next = Pronađi sledeće # Menu @@ -25,6 +70,8 @@ default-zoom-step = Podrazumevani korak uvećanja file = Datoteka new-tab = Nova kartica new-window = Novi prozor +profile = Profili +menu-profiles = Profili... close-tab = Zatvori karticu quit = Izađi @@ -37,7 +84,14 @@ find = Pronađi ## View view = Prikaz +zoom-in = Veći tekst +zoom-reset = Podrazumevana veličina teksta +zoom-out = Manji tekst +next-tab = Sledeća kartica +previous-tab = Prethodna kartica +split-horizontal = Podeli horizontalno +split-vertical = Podeli vertikalno +pane-toggle-maximize = Maksimizuj +menu-color-schemes = Šeme boja... menu-settings = Podešavanja... - -# Context menu -show-headerbar = Prikaži traku zaglavlja +menu-about = O COSMIC Terminalu... From a44f16aab508a5aebaf7042a3d5a2a3299dfb7f5 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Feb 2024 12:46:04 -0700 Subject: [PATCH 22/25] Do not require git to handle versioning --- build.rs | 2 ++ debian/control | 1 - justfile | 15 +++++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index ccaa98f..7714837 100644 --- a/build.rs +++ b/build.rs @@ -4,9 +4,11 @@ fn main() -> Result<(), Box> { // Emit version information (if not cached by just vendor) let mut vergen = vergen::EmitBuilder::builder(); + println!("cargo:rerun-if-env-changed=VERGEN_GIT_COMMIT_DATE"); if std::env::var_os("VERGEN_GIT_COMMIT_DATE").is_none() { vergen.git_commit_date(); } + println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA"); if std::env::var_os("VERGEN_GIT_SHA").is_none() { vergen.git_sha(true); } diff --git a/debian/control b/debian/control index cf75a41..d78b815 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,6 @@ Priority: optional Maintainer: Jeremy Soller Build-Depends: debhelper-compat (=13), - git, just (>= 1.13.0), pkg-config, rust-all, diff --git a/justfile b/justfile index e90c1a6..6b329dc 100644 --- a/justfile +++ b/justfile @@ -71,14 +71,21 @@ uninstall: # Vendor dependencies locally vendor: + #!/usr/bin/env bash mkdir -p .cargo - cargo vendor --sync Cargo.toml \ - | head -n -1 > .cargo/config.toml + cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config.toml echo 'directory = "vendor"' >> .cargo/config.toml echo >> .cargo/config.toml echo '[env]' >> .cargo/config.toml - echo "VERGEN_GIT_COMMIT_DATE = \"$(git log -1 --pretty=format:'%cs' HEAD)\"" >> .cargo/config.toml - echo "VERGEN_GIT_SHA = \"$(git rev-parse --short HEAD)\"" >> .cargo/config.toml + if [ -n "${SOURCE_DATE_EPOCH}" ] + then + source_date="$(date -d "@${SOURCE_DATE_EPOCH}" "+%Y-%m-%d")" + echo "VERGEN_GIT_COMMIT_DATE = \"${source_date}\"" >> .cargo/config.toml + fi + if [ -n "${SOURCE_GIT_HASH}" ] + then + echo "VERGEN_GIT_SHA = \"${SOURCE_GIT_HASH}\"" >> .cargo/config.toml + fi tar pcf vendor.tar .cargo vendor rm -rf .cargo vendor From 36477e06dc6d05bd01dc08b3f20e0a6e388d6c7e Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Feb 2024 13:38:26 -0700 Subject: [PATCH 23/25] Shorten hash in UI --- build.rs | 2 +- src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 7714837..be10241 100644 --- a/build.rs +++ b/build.rs @@ -10,7 +10,7 @@ fn main() -> Result<(), Box> { } println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA"); if std::env::var_os("VERGEN_GIT_SHA").is_none() { - vergen.git_sha(true); + vergen.git_sha(false); } vergen.fail_on_error().emit()?; Ok(()) diff --git a/src/main.rs b/src/main.rs index ef8e0ad..61a0af7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -640,6 +640,7 @@ impl App { let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; let repository = "https://github.com/pop-os/cosmic-term"; let hash = env!("VERGEN_GIT_SHA"); + let short_hash: String = hash.chars().take(7).collect(); let date = env!("VERGEN_GIT_COMMIT_DATE"); widget::column::with_children(vec![ widget::svg(widget::svg::Handle::from_memory( @@ -655,7 +656,7 @@ impl App { .into(), widget::button::link(fl!( "git-description", - hash = hash, + hash = short_hash.as_str(), date = date )) .on_press(Message::LaunchUrl(format!("{}/commits/{}", repository, hash))) From 71de513a857783666024582348ba1edd075cc4f3 Mon Sep 17 00:00:00 2001 From: Sebastiano Giordano <46520354+Krahos@users.noreply.github.com> Date: Sat, 2 Mar 2024 14:56:27 +0100 Subject: [PATCH 24/25] i18n(it): Adding Italian translation --- i18n/it/cosmic_term.ftl | 96 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 i18n/it/cosmic_term.ftl diff --git a/i18n/it/cosmic_term.ftl b/i18n/it/cosmic_term.ftl new file mode 100644 index 0000000..e64ae76 --- /dev/null +++ b/i18n/it/cosmic_term.ftl @@ -0,0 +1,96 @@ +cosmic-terminal = Terminale COSMIC +new-terminal = Nuovo terminale + +# Context Pages + +## About +git-description = Commit git {$hash} del {$date} + +## Color schemes +color-schemes = Schema colori +rename = Rinomina +export = Esporta +delete = Cancella +import = Importa +import-errors = Importa errori + +## Profiles +profiles = Profili +name = Nome +command-line = Riga di comando +tab-title = Titolo scheda +tab-title-description = Sovrascrivi il titolo predefinito della scheda +add-profile = Aggiungi profilo +new-profile = Nuovo profilo +make-default = Rendi predefinito + +## Settings +settings = Impostazioni + +### Appearance +appearance = Aspetto +theme = Tema +match-desktop = Abbina alla scrivania +dark = Scuro +light = Chiaro +syntax-dark = Schema colori scuro +syntax-light = Schema colori chiaro +default-zoom-step = Passi ingrandimento +opacity = Opacità sfondo + +### Font +font = Carattere tipografico +advanced-font-settings = Impostazioni avanzate del carattere tipografico +default-font = Font predefinito +default-font-size = Dimensione del carattere tipografico predefinita +default-font-stretch = Estensione del carattere tipografico predefinita +default-font-weight = Spessore del carattere tipografico normale +default-dim-font-weight = Spessore del carattere tipografico attenuato +default-bold-font-weight = Spessore del carattere tipografico in grassetto +use-bright-bold = Rendi il testo in grassetto più luminoso + +### Splits +splits = Suddivisioni +focus-follow-mouse = Il focus di scrittura segue il mouse + +### Advanced +advanced = Avanzate +show-headerbar = Mostra intestazione +show-header-description = Mostra intestazione dal menu click destro. + +# Find +find-placeholder = Trova... +find-previous = Trova precendente +find-next = Trova successivo + +# Menu + +## File +file = File +new-tab = Nuova scheda +new-window = Nuova finestra +profile = Profilo +menu-profiles = Profili... +close-tab = Chiudi finestra +quit = Esci + +## Edit +edit = Modifica +copy = Copia +paste = Incolla +select-all = Seleziona tutti +find = Trova + +## View +view = Visualizza +zoom-in = Ingrandisci testo +zoom-reset = Dimensioni testo predefinite +zoom-out = Rimpicciolisci testo +next-tab = Scheda successiva +previous-tab = Scheda precedente +split-horizontal = Dividi orizzontalmente +split-vertical = Dividi verticalmente +pane-toggle-maximize = Abilita/disabilita schermo intero +menu-color-schemes = Schemi di colore... +menu-settings = Impostazioni... +menu-about = A proposito di COSMIC Terminal... From 6c6dee8394bea37993ff3c8d956184ecc7b17e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Sat, 2 Mar 2024 11:57:40 -0300 Subject: [PATCH 25/25] i18n(ptBR): Adding Brazilian Portuguese translation --- i18n/pt-BR/cosmic_term.ftl | 96 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 i18n/pt-BR/cosmic_term.ftl diff --git a/i18n/pt-BR/cosmic_term.ftl b/i18n/pt-BR/cosmic_term.ftl new file mode 100644 index 0000000..8596743 --- /dev/null +++ b/i18n/pt-BR/cosmic_term.ftl @@ -0,0 +1,96 @@ +cosmic-terminal = COSMIC Terminal +new-terminal = Novo terminal + +# Context Pages + +## About +git-description = Commit do git {$hash} em {$date} + +## Color schemes +color-schemes = Esquemas de cores +rename = Renomear +export = Exportar +delete = Deletar +import = Importar +import-errors = Erros de Importação + +## Profiles +profiles = Perfis +name = Nome +command-line = Linha de comando +tab-title = Título da aba +tab-title-description = Sobrescrever o título da aba padrão +add-profile = Adicionar perfil +new-profile = Novo perfil +make-default = Tornar padrão + +## Settings +settings = Configurações + +### Appearance +appearance = Aparência +theme = Tema +match-desktop = Acompanhar o tema do desktop +dark = Escuro +light = Claro +syntax-dark = Esquema de cores escuro +syntax-light = Esquema de cores claro +default-zoom-step = Incrementos de zoom +opacity = Opacidade do fundo + +### Font +font = Fonte +advanced-font-settings = Configurações avançadas de fonte +default-font = Fonte +default-font-size = Tamanho da fonte +default-font-stretch = Esticamento da fonte +default-font-weight = Peso padrão da fonte +default-dim-font-weight = Peso da fonte clareara +default-bold-font-weight = Peso da fonte em negrito +use-bright-bold = Usar negrito brilhante + +### Splits +splits = Divisões +focus-follow-mouse = Foco de digitação segue o mouse + +### Advanced +advanced = Avançado +show-headerbar = Mostrar barra de título +show-header-description = Mostrar a barra de título na janela no menu do botão direito + +# Find +find-placeholder = Pesquisar... +find-previous = Pesquisar anterior +find-next = Pesquisar próximo + +# Menu + +## File +file = Arquivo +new-tab = Nova aba +new-window = Nova janela +profile = Perfil +menu-profiles = Perfis... +close-tab = Fechar aba +quit = Sair + +## Edit +edit = Editar +copy = Copiar +paste = Colar +select-all = Selecione tudo +find = Pesquisar + +## View +view = Visualizar +zoom-in = Aumentar texto +zoom-reset = Redefinir zoom +zoom-out = Diminuir texto +next-tab = Próxima aba +previous-tab = Aba anterior +split-horizontal = Dividir horizontalmente +split-vertical = Dividir verticalmente +pane-toggle-maximize = Alternar maximização +menu-color-schemes = Esquemas de cores... +menu-settings = Configurações... +menu-about = Sobre COSMIC Terminal...