diff --git a/Cargo.lock b/Cargo.lock
index 80a9753..4c75619 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -20,65 +20,70 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046"
[[package]]
name = "accesskit"
-version = "0.11.0"
-source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0"
+version = "0.12.2"
+source = "git+https://github.com/wash2/accesskit.git?branch=winit-0.29#5f9b61c8264000d001499c902562422e13efa7a8"
[[package]]
name = "accesskit_consumer"
-version = "0.15.0"
-source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0"
+version = "0.17.0"
+source = "git+https://github.com/wash2/accesskit.git?branch=winit-0.29#5f9b61c8264000d001499c902562422e13efa7a8"
dependencies = [
"accesskit",
]
[[package]]
name = "accesskit_macos"
-version = "0.7.0"
-source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0"
+version = "0.11.0"
+source = "git+https://github.com/wash2/accesskit.git?branch=winit-0.29#5f9b61c8264000d001499c902562422e13efa7a8"
dependencies = [
"accesskit",
"accesskit_consumer",
- "objc2",
+ "icrate 0.1.0",
+ "objc2 0.5.0",
"once_cell",
]
[[package]]
name = "accesskit_unix"
-version = "0.4.0"
-source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0"
+version = "0.7.1"
+source = "git+https://github.com/wash2/accesskit.git?branch=winit-0.29#5f9b61c8264000d001499c902562422e13efa7a8"
dependencies = [
"accesskit",
"accesskit_consumer",
- "async-channel 1.9.0",
+ "async-channel",
+ "async-executor",
+ "async-task",
"atspi",
"futures-lite 1.13.0",
- "log",
+ "futures-util",
+ "once_cell",
"serde",
"zbus",
]
[[package]]
name = "accesskit_windows"
-version = "0.14.0"
-source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0"
+version = "0.16.0"
+source = "git+https://github.com/wash2/accesskit.git?branch=winit-0.29#5f9b61c8264000d001499c902562422e13efa7a8"
dependencies = [
"accesskit",
"accesskit_consumer",
- "arrayvec",
"once_cell",
"paste",
- "windows 0.44.0",
+ "static_assertions",
+ "windows 0.48.0",
]
[[package]]
name = "accesskit_winit"
-version = "0.13.0"
-source = "git+https://github.com/wash2/accesskit.git?tag=winit-0.28#db6f2587f663eafd8f7888e8507baa3a092599b0"
+version = "0.18.1"
+source = "git+https://github.com/wash2/accesskit.git?branch=winit-0.29#5f9b61c8264000d001499c902562422e13efa7a8"
dependencies = [
"accesskit",
"accesskit_macos",
"accesskit_unix",
"accesskit_windows",
+ "raw-window-handle 0.6.0",
"winit",
]
@@ -99,11 +104,12 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "ahash"
-version = "0.8.7"
+version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
+checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff"
dependencies = [
"cfg-if",
+ "getrandom",
"once_cell",
"version_check",
"zerocopy",
@@ -132,7 +138,7 @@ dependencies = [
"miow",
"parking_lot 0.12.1",
"piper",
- "polling 3.3.2",
+ "polling 3.4.0",
"regex-automata",
"rustix-openpty",
"serde",
@@ -162,20 +168,23 @@ checksum = "3aa2999eb46af81abb65c2d30d446778d7e613b60bbf4e174a027e80f90a3c14"
[[package]]
name = "android-activity"
-version = "0.4.3"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0"
+checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289"
dependencies = [
"android-properties",
- "bitflags 1.3.2",
+ "bitflags 2.4.2",
"cc",
+ "cesu8",
+ "jni",
"jni-sys",
"libc",
"log",
"ndk",
"ndk-context",
"ndk-sys",
- "num_enum 0.6.1",
+ "num_enum",
+ "thiserror",
]
[[package]]
@@ -193,6 +202,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "any_ascii"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e"
+
[[package]]
name = "apply"
version = "0.3.0"
@@ -271,24 +286,13 @@ dependencies = [
[[package]]
name = "async-channel"
-version = "1.9.0"
+version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35"
+checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3"
dependencies = [
"concurrent-queue",
- "event-listener 2.5.3",
- "futures-core",
-]
-
-[[package]]
-name = "async-channel"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c"
-dependencies = [
- "concurrent-queue",
- "event-listener 4.0.3",
- "event-listener-strategy",
+ "event-listener 5.0.0",
+ "event-listener-strategy 0.5.0",
"futures-core",
"pin-project-lite",
]
@@ -351,7 +355,7 @@ dependencies = [
"futures-io",
"futures-lite 2.2.0",
"parking",
- "polling 3.3.2",
+ "polling 3.4.0",
"rustix 0.38.28",
"slab",
"tracing",
@@ -374,7 +378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b"
dependencies = [
"event-listener 4.0.3",
- "event-listener-strategy",
+ "event-listener-strategy 0.4.0",
"pin-project-lite",
]
@@ -471,29 +475,50 @@ dependencies = [
[[package]]
name = "atspi"
-version = "0.10.1"
+version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "674e7a3376837b2e7d12d34d58ac47073c491dc3bf6f71a7adaf687d4d817faa"
+checksum = "6059f350ab6f593ea00727b334265c4dfc7fd442ee32d264794bd9bdc68e87ca"
dependencies = [
- "async-recursion",
- "async-trait",
- "atspi-macros",
- "enumflags2",
- "futures-lite 1.13.0",
- "serde",
- "tracing",
- "zbus",
- "zbus_names",
+ "atspi-common",
+ "atspi-connection",
+ "atspi-proxies",
]
[[package]]
-name = "atspi-macros"
-version = "0.2.0"
+name = "atspi-common"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb4870a32c0eaa17e35bca0e6b16020635157121fb7d45593d242c295bc768"
+checksum = "92af95f966d2431f962bc632c2e68eda7777330158bf640c4af4249349b2cdf5"
dependencies = [
- "quote",
- "syn 1.0.109",
+ "enumflags2",
+ "serde",
+ "static_assertions",
+ "zbus",
+ "zbus_names",
+ "zvariant",
+]
+
+[[package]]
+name = "atspi-connection"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0c65e7d70f86d4c0e3b2d585d9bf3f979f0b19d635a336725a88d279f76b939"
+dependencies = [
+ "atspi-common",
+ "atspi-proxies",
+ "futures-lite 1.13.0",
+ "zbus",
+]
+
+[[package]]
+name = "atspi-proxies"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6495661273703e7a229356dcbe8c8f38223d697aacfaf0e13590a9ac9977bb52"
+dependencies = [
+ "atspi-common",
+ "serde",
+ "zbus",
]
[[package]]
@@ -576,21 +601,31 @@ dependencies = [
[[package]]
name = "block-sys"
-version = "0.1.0-beta.1"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146"
+checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7"
dependencies = [
"objc-sys",
]
[[package]]
name = "block2"
-version = "0.2.0-alpha.6"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42"
+checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68"
dependencies = [
"block-sys",
- "objc2-encode",
+ "objc2 0.4.1",
+]
+
+[[package]]
+name = "block2"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e58aa60e59d8dbfcc36138f5f18be5f24394d33b38b24f7fd0b1caa33095f22f"
+dependencies = [
+ "block-sys",
+ "objc2 0.5.0",
]
[[package]]
@@ -599,7 +634,7 @@ version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118"
dependencies = [
- "async-channel 2.1.1",
+ "async-channel",
"async-lock 3.3.0",
"async-task",
"fastrand 2.0.1",
@@ -617,9 +652,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
[[package]]
name = "bytemuck"
-version = "1.14.1"
+version = "1.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9"
+checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f"
dependencies = [
"bytemuck_derive",
]
@@ -657,20 +692,6 @@ dependencies = [
"system-deps",
]
-[[package]]
-name = "calloop"
-version = "0.10.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8"
-dependencies = [
- "bitflags 1.3.2",
- "log",
- "nix 0.25.1",
- "slotmap",
- "thiserror",
- "vec_map",
-]
-
[[package]]
name = "calloop"
version = "0.12.4"
@@ -679,7 +700,7 @@ checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
dependencies = [
"bitflags 2.4.2",
"log",
- "polling 3.3.2",
+ "polling 3.4.0",
"rustix 0.38.28",
"slab",
"thiserror",
@@ -691,10 +712,10 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
dependencies = [
- "calloop 0.12.4",
+ "calloop",
"rustix 0.38.28",
"wayland-backend",
- "wayland-client 0.31.2",
+ "wayland-client",
]
[[package]]
@@ -708,10 +729,16 @@ dependencies = [
]
[[package]]
-name = "cfg-expr"
-version = "0.15.6"
+name = "cesu8"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a"
+checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
+
+[[package]]
+name = "cfg-expr"
+version = "0.15.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d"
dependencies = [
"smallvec",
"target-lexicon",
@@ -730,14 +757,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
[[package]]
-name = "clipboard-win"
-version = "4.5.0"
+name = "cfg_aliases"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362"
+checksum = "77e53693616d3075149f4ead59bdeecd204ac6b8192d8969757601b74bddf00f"
+
+[[package]]
+name = "clipboard-win"
+version = "5.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ec832972fefb8cf9313b45a0d1945e29c9c251f1d4c6eafc5fe2124c02d2e81"
dependencies = [
"error-code",
- "str-buf",
- "winapi",
]
[[package]]
@@ -767,7 +798,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cf45b436634fee64c6d3981639b46a87eeea3c64e422643273fcefd1baef56c"
dependencies = [
"thiserror",
- "x11rb 0.13.0",
+ "x11rb",
]
[[package]]
@@ -780,8 +811,8 @@ dependencies = [
"block",
"cocoa-foundation",
"core-foundation",
- "core-graphics 0.23.1",
- "foreign-types 0.5.0",
+ "core-graphics",
+ "foreign-types",
"libc",
"objc",
]
@@ -817,10 +848,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
-name = "com-rs"
-version = "0.2.1"
+name = "com"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642"
+checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6"
+dependencies = [
+ "com_macros",
+]
+
+[[package]]
+name = "com_macros"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5"
+dependencies = [
+ "com_macros_support",
+ "proc-macro2",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "com_macros_support"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "combine"
+version = "4.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
+dependencies = [
+ "bytes",
+ "memchr",
+]
[[package]]
name = "concurrent-queue"
@@ -867,19 +933,6 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
-[[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",
- "core-graphics-types",
- "foreign-types 0.3.2",
- "libc",
-]
-
[[package]]
name = "core-graphics"
version = "0.23.1"
@@ -889,7 +942,7 @@ dependencies = [
"bitflags 1.3.2",
"core-foundation",
"core-graphics-types",
- "foreign-types 0.5.0",
+ "foreign-types",
"libc",
]
@@ -907,7 +960,7 @@ dependencies = [
[[package]]
name = "cosmic-config"
version = "0.1.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"atomicwrites",
"cosmic-config-derive",
@@ -924,7 +977,7 @@ dependencies = [
[[package]]
name = "cosmic-config-derive"
version = "0.1.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"quote",
"syn 1.0.109",
@@ -942,19 +995,22 @@ dependencies = [
"i18n-embed-fl",
"indexmap",
"lazy_static",
+ "lexical-sort",
"libcosmic",
"log",
"palette",
"paste",
"rust-embed",
"serde",
+ "shlex",
+ "smol_str",
"tokio",
]
[[package]]
name = "cosmic-text"
-version = "0.10.0"
-source = "git+https://github.com/pop-os/cosmic-text.git#0cea55630c97a47207f84e4cc3530404e17b6bfe"
+version = "0.11.2"
+source = "git+https://github.com/pop-os/cosmic-text.git#0cb6eba6e708e2743313ee0016162de7a0146353"
dependencies = [
"bitflags 2.4.2",
"fontdb",
@@ -976,7 +1032,7 @@ dependencies = [
[[package]]
name = "cosmic-theme"
version = "0.1.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"almost",
"cosmic-config",
@@ -998,9 +1054,9 @@ dependencies = [
[[package]]
name = "crc32fast"
-version = "1.3.2"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
+checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
dependencies = [
"cfg-if",
]
@@ -1089,9 +1145,8 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991"
[[package]]
name = "d3d12"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20"
+version = "0.19.0"
+source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109"
dependencies = [
"bitflags 2.4.2",
"libloading 0.8.1",
@@ -1249,25 +1304,25 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]]
name = "drm"
-version = "0.10.0"
+version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb1b703ffbc7ebd216eba7900008049a56ace55580ecb2ee7fa801e8d8be87"
+checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde"
dependencies = [
"bitflags 2.4.2",
"bytemuck",
"drm-ffi",
"drm-fourcc",
- "nix 0.27.1",
+ "rustix 0.38.28",
]
[[package]]
name = "drm-ffi"
-version = "0.6.0"
+version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba7d1c19c4b6270e89d59fb27dc6d02a317c658a8a54e54781e1db9b5947595d"
+checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6"
dependencies = [
"drm-sys",
- "nix 0.27.1",
+ "rustix 0.38.28",
]
[[package]]
@@ -1278,21 +1333,25 @@ checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4"
[[package]]
name = "drm-sys"
-version = "0.5.0"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a4f1c0468062a56cd5705f1e3b5409eb286d5596a2028ec8e947595d7e715ae"
+checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176"
+dependencies = [
+ "libc",
+ "linux-raw-sys 0.6.4",
+]
[[package]]
name = "either"
-version = "1.9.0"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
+checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
[[package]]
name = "enumflags2"
-version = "0.7.8"
+version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939"
+checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d"
dependencies = [
"enumflags2_derive",
"serde",
@@ -1300,9 +1359,9 @@ dependencies = [
[[package]]
name = "enumflags2_derive"
-version = "0.7.8"
+version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246"
+checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4"
dependencies = [
"proc-macro2",
"quote",
@@ -1340,13 +1399,9 @@ dependencies = [
[[package]]
name = "error-code"
-version = "2.3.1"
+version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21"
-dependencies = [
- "libc",
- "str-buf",
-]
+checksum = "281e452d3bad4005426416cdba5ccfd4f5c1280e10099e21db27f7c1c28347fc"
[[package]]
name = "etagere"
@@ -1395,6 +1450,17 @@ dependencies = [
"pin-project-lite",
]
+[[package]]
+name = "event-listener"
+version = "5.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1"
+dependencies = [
+ "concurrent-queue",
+ "parking",
+ "pin-project-lite",
+]
+
[[package]]
name = "event-listener-strategy"
version = "0.4.0"
@@ -1406,13 +1472,23 @@ dependencies = [
]
[[package]]
-name = "exr"
-version = "1.6.4"
+name = "event-listener-strategy"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "279d3efcc55e19917fff7ab3ddd6c14afb6a90881a0078465196fe2f99d08c56"
+checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291"
+dependencies = [
+ "event-listener 5.0.0",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "exr"
+version = "1.72.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4"
dependencies = [
"bit_field",
- "flume 0.10.14",
+ "flume",
"half",
"lebe",
"miniz_oxide",
@@ -1538,28 +1614,12 @@ dependencies = [
"thiserror",
]
-[[package]]
-name = "flume"
-version = "0.10.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577"
-dependencies = [
- "futures-core",
- "futures-sink",
- "nanorand",
- "pin-project",
- "spin",
-]
-
[[package]]
name = "flume"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181"
dependencies = [
- "futures-core",
- "futures-sink",
- "nanorand",
"spin",
]
@@ -1586,27 +1646,18 @@ dependencies = [
[[package]]
name = "fontdb"
-version = "0.16.0"
+version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98b88c54a38407f7352dd2c4238830115a6377741098ffd1f997c813d0e088a6"
+checksum = "3890d0893c8253d3eb98337af18b3e1a10a9b2958f2a164b53a93fb3a3049e72"
dependencies = [
"fontconfig-parser",
"log",
- "memmap2 0.9.4",
+ "memmap2",
"slotmap",
"tinyvec",
"ttf-parser",
]
-[[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]]
name = "foreign-types"
version = "0.5.0"
@@ -1614,7 +1665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
dependencies = [
"foreign-types-macros",
- "foreign-types-shared 0.3.1",
+ "foreign-types-shared",
]
[[package]]
@@ -1628,12 +1679,6 @@ dependencies = [
"syn 2.0.48",
]
-[[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"
@@ -1642,9 +1687,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "fork"
-version = "0.1.22"
+version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf2ca97a59201425e7ee4d197c9c4fea282fe87a97d666a580bda889b95b8e88"
+checksum = "60e74d3423998a57e9d906e49252fb79eb4a04d5cdfe188fb1b7ff9fc076a8ed"
dependencies = [
"libc",
]
@@ -1848,16 +1893,6 @@ dependencies = [
"version_check",
]
-[[package]]
-name = "gethostname"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177"
-dependencies = [
- "libc",
- "winapi",
-]
-
[[package]]
name = "gethostname"
version = "0.4.3"
@@ -1875,10 +1910,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
dependencies = [
"cfg-if",
- "js-sys",
"libc",
"wasi",
- "wasm-bindgen",
]
[[package]]
@@ -1960,8 +1993,8 @@ dependencies = [
[[package]]
name = "glyphon"
-version = "0.4.1"
-source = "git+https://github.com/jackpot51/glyphon.git#abb70c0fda8cf1a5dfc314c1c778103d7ba951e6"
+version = "0.5.0"
+source = "git+https://github.com/pop-os/glyphon.git?tag=v0.5.0#1b0646ff8f74da92d3be704dfc2257d7f4d7eed8"
dependencies = [
"cosmic-text",
"etagere",
@@ -2001,16 +2034,15 @@ dependencies = [
[[package]]
name = "gpu-allocator"
-version = "0.23.0"
+version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40fe17c8a05d60c38c0a4e5a3c802f2f1ceb66b76c67d96ffb34bef0475a7fad"
+checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884"
dependencies = [
- "backtrace",
"log",
"presser",
"thiserror",
"winapi",
- "windows 0.51.1",
+ "windows 0.52.0",
]
[[package]]
@@ -2089,14 +2121,14 @@ dependencies = [
[[package]]
name = "hassle-rs"
-version = "0.10.0"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0"
+checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890"
dependencies = [
- "bitflags 1.3.2",
- "com-rs",
+ "bitflags 2.4.2",
+ "com",
"libc",
- "libloading 0.7.4",
+ "libloading 0.8.1",
"thiserror",
"widestring",
"winapi",
@@ -2110,9 +2142,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f"
+checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3"
[[package]]
name = "hex"
@@ -2151,7 +2183,7 @@ dependencies = [
"serde",
"serde_derive",
"thiserror",
- "toml 0.8.9",
+ "toml 0.8.10",
"unic-langid",
]
@@ -2214,7 +2246,7 @@ dependencies = [
[[package]]
name = "iced"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"iced_accessibility",
"iced_core",
@@ -2229,7 +2261,7 @@ dependencies = [
[[package]]
name = "iced_accessibility"
version = "0.1.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"accesskit",
"accesskit_winit",
@@ -2238,23 +2270,24 @@ dependencies = [
[[package]]
name = "iced_core"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"bitflags 1.3.2",
- "instant",
"log",
"num-traits",
"palette",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"serde",
+ "smol_str",
"thiserror",
+ "web-time",
"xxhash-rust",
]
[[package]]
name = "iced_futures"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"futures",
"iced_core",
@@ -2267,7 +2300,7 @@ dependencies = [
[[package]]
name = "iced_graphics"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"bitflags 1.3.2",
"bytemuck",
@@ -2275,12 +2308,13 @@ dependencies = [
"glam",
"half",
"iced_core",
+ "iced_futures",
"image",
"kamadak-exif",
"log",
"lyon_path",
"once_cell",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"rustc-hash",
"thiserror",
"unicode-segmentation",
@@ -2290,20 +2324,19 @@ dependencies = [
[[package]]
name = "iced_renderer"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"iced_graphics",
"iced_tiny_skia",
"iced_wgpu",
"log",
- "raw-window-handle",
"thiserror",
]
[[package]]
name = "iced_runtime"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"iced_core",
"iced_futures",
@@ -2313,7 +2346,7 @@ dependencies = [
[[package]]
name = "iced_style"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"iced_core",
"once_cell",
@@ -2323,25 +2356,24 @@ dependencies = [
[[package]]
name = "iced_tiny_skia"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"bytemuck",
"cosmic-text",
"iced_graphics",
"kurbo",
"log",
- "raw-window-handle",
"resvg",
"rustc-hash",
"softbuffer",
- "tiny-skia 0.11.3",
+ "tiny-skia",
"xxhash-rust",
]
[[package]]
name = "iced_wgpu"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"bitflags 1.3.2",
"bytemuck",
@@ -2353,7 +2385,6 @@ dependencies = [
"log",
"lyon",
"once_cell",
- "raw-window-handle",
"resvg",
"wgpu",
]
@@ -2361,7 +2392,7 @@ dependencies = [
[[package]]
name = "iced_widget"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"iced_renderer",
"iced_runtime",
@@ -2375,7 +2406,7 @@ dependencies = [
[[package]]
name = "iced_winit"
version = "0.12.0"
-source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"iced_graphics",
"iced_runtime",
@@ -2389,6 +2420,27 @@ dependencies = [
"winit",
]
+[[package]]
+name = "icrate"
+version = "0.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319"
+dependencies = [
+ "block2 0.3.0",
+ "dispatch",
+ "objc2 0.4.1",
+]
+
+[[package]]
+name = "icrate"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e286f4b975ac6c054971a0600a9b76438b332edace54bff79c71c9d3adfc9772"
+dependencies = [
+ "block2 0.4.0",
+ "objc2 0.5.0",
+]
+
[[package]]
name = "ident_case"
version = "1.0.1"
@@ -2431,9 +2483,9 @@ checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284"
[[package]]
name = "indexmap"
-version = "2.2.1"
+version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b"
+checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177"
dependencies = [
"equivalent",
"hashbrown",
@@ -2466,9 +2518,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
"cfg-if",
- "js-sys",
- "wasm-bindgen",
- "web-sys",
]
[[package]]
@@ -2503,12 +2552,12 @@ dependencies = [
[[package]]
name = "is-terminal"
-version = "0.4.10"
+version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"
+checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b"
dependencies = [
"hermit-abi",
- "rustix 0.38.28",
+ "libc",
"windows-sys 0.52.0",
]
@@ -2518,6 +2567,22 @@ version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
+[[package]]
+name = "jni"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
+dependencies = [
+ "cesu8",
+ "cfg-if",
+ "combine",
+ "jni-sys",
+ "log",
+ "thiserror",
+ "walkdir",
+ "windows-sys 0.45.0",
+]
+
[[package]]
name = "jni-sys"
version = "0.3.0"
@@ -2526,9 +2591,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]]
name = "jobserver"
-version = "0.1.27"
+version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d"
+checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6"
dependencies = [
"libc",
]
@@ -2544,9 +2609,9 @@ dependencies = [
[[package]]
name = "js-sys"
-version = "0.3.67"
+version = "0.3.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1"
+checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee"
dependencies = [
"wasm-bindgen",
]
@@ -2627,6 +2692,15 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
+[[package]]
+name = "lexical-sort"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c09e4591611e231daf4d4c685a66cb0410cc1e502027a20ae55f2bb9e997207a"
+dependencies = [
+ "any_ascii",
+]
+
[[package]]
name = "libc"
version = "0.2.151"
@@ -2635,7 +2709,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#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd"
+source = "git+https://github.com/pop-os/libcosmic.git#02cee1d8051f504860d9b961245919fde1542355"
dependencies = [
"apply",
"ashpd",
@@ -2728,6 +2802,12 @@ version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
+[[package]]
+name = "linux-raw-sys"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0b5399f6804fbab912acbd8878ed3532d506b7c951b8f9f164ef90fef39e3f4"
+
[[package]]
name = "locale_config"
version = "0.3.0"
@@ -2833,15 +2913,6 @@ version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
-[[package]]
-name = "memmap2"
-version = "0.5.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327"
-dependencies = [
- "libc",
-]
-
[[package]]
name = "memmap2"
version = "0.9.4"
@@ -2851,15 +2922,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "memoffset"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
-dependencies = [
- "autocfg",
-]
-
[[package]]
name = "memoffset"
version = "0.7.1"
@@ -2887,7 +2949,7 @@ dependencies = [
"bitflags 2.4.2",
"block",
"core-graphics-types",
- "foreign-types 0.5.0",
+ "foreign-types",
"log",
"objc",
"paste",
@@ -2895,9 +2957,9 @@ dependencies = [
[[package]]
name = "miniz_oxide"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
+checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
dependencies = [
"adler",
"simd-adler32",
@@ -2932,10 +2994,10 @@ checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b"
[[package]]
name = "naga"
-version = "0.14.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae585df4b6514cf8842ac0f1ab4992edc975892704835b549cf818dc0191249e"
+version = "0.19.0"
+source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109"
dependencies = [
+ "arrayvec",
"bit-set",
"bitflags 2.4.2",
"codespan-reporting",
@@ -2950,26 +3012,18 @@ dependencies = [
"unicode-xid",
]
-[[package]]
-name = "nanorand"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3"
-dependencies = [
- "getrandom",
-]
-
[[package]]
name = "ndk"
-version = "0.7.0"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0"
+checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7"
dependencies = [
- "bitflags 1.3.2",
+ "bitflags 2.4.2",
"jni-sys",
+ "log",
"ndk-sys",
- "num_enum 0.5.11",
- "raw-window-handle",
+ "num_enum",
+ "raw-window-handle 0.6.0",
"thiserror",
]
@@ -2981,38 +3035,13 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
[[package]]
name = "ndk-sys"
-version = "0.4.1+23.1.7779620"
+version = "0.5.0+25.2.9519653"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3"
+checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691"
dependencies = [
"jni-sys",
]
-[[package]]
-name = "nix"
-version = "0.24.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069"
-dependencies = [
- "bitflags 1.3.2",
- "cfg-if",
- "libc",
- "memoffset 0.6.5",
-]
-
-[[package]]
-name = "nix"
-version = "0.25.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4"
-dependencies = [
- "autocfg",
- "bitflags 1.3.2",
- "cfg-if",
- "libc",
- "memoffset 0.6.5",
-]
-
[[package]]
name = "nix"
version = "0.26.4"
@@ -3025,17 +3054,6 @@ dependencies = [
"memoffset 0.7.1",
]
-[[package]]
-name = "nix"
-version = "0.27.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
-dependencies = [
- "bitflags 2.4.2",
- "cfg-if",
- "libc",
-]
-
[[package]]
name = "notify"
version = "6.1.1"
@@ -3082,28 +3100,27 @@ dependencies = [
[[package]]
name = "num-complex"
-version = "0.4.4"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214"
+checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6"
dependencies = [
"num-traits",
]
[[package]]
name = "num-integer"
-version = "0.1.45"
+version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
dependencies = [
- "autocfg",
"num-traits",
]
[[package]]
name = "num-iter"
-version = "0.1.43"
+version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252"
+checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9"
dependencies = [
"autocfg",
"num-integer",
@@ -3124,9 +3141,9 @@ dependencies = [
[[package]]
name = "num-traits"
-version = "0.2.17"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
+checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
dependencies = [
"autocfg",
"libm",
@@ -3144,41 +3161,20 @@ dependencies = [
[[package]]
name = "num_enum"
-version = "0.5.11"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9"
+checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
dependencies = [
- "num_enum_derive 0.5.11",
-]
-
-[[package]]
-name = "num_enum"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1"
-dependencies = [
- "num_enum_derive 0.6.1",
+ "num_enum_derive",
]
[[package]]
name = "num_enum_derive"
-version = "0.5.11"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799"
+checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "num_enum_derive"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6"
-dependencies = [
- "proc-macro-crate",
+ "proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
"syn 2.0.48",
@@ -3207,29 +3203,41 @@ dependencies = [
[[package]]
name = "objc-sys"
-version = "0.2.0-beta.2"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7"
+checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459"
[[package]]
name = "objc2"
-version = "0.3.0-beta.3.patch-leaks.3"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468"
+checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d"
dependencies = [
- "block2",
"objc-sys",
- "objc2-encode",
+ "objc2-encode 3.0.0",
+]
+
+[[package]]
+name = "objc2"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a9c7f0d511a4ce26b078183179dca908171cfc69f88986fe36c5138e1834476"
+dependencies = [
+ "objc-sys",
+ "objc2-encode 4.0.0",
]
[[package]]
name = "objc2-encode"
-version = "2.0.0-pre.2"
+version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512"
-dependencies = [
- "objc-sys",
-]
+checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666"
+
+[[package]]
+name = "objc2-encode"
+version = "4.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ff06a6505cde0766484f38d8479ac8e6d31c66fbc2d5492f65ca8c091456379"
[[package]]
name = "objc_exception"
@@ -3482,26 +3490,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
-[[package]]
-name = "pin-project"
-version = "1.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0"
-dependencies = [
- "pin-project-internal",
-]
-
-[[package]]
-name = "pin-project-internal"
-version = "1.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.48",
-]
-
[[package]]
name = "pin-project-lite"
version = "0.2.13"
@@ -3562,9 +3550,9 @@ dependencies = [
[[package]]
name = "polling"
-version = "3.3.2"
+version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41"
+checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14"
dependencies = [
"cfg-if",
"concurrent-queue",
@@ -3596,6 +3584,15 @@ dependencies = [
"toml_edit 0.19.15",
]
+[[package]]
+name = "proc-macro-crate"
+version = "3.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
+dependencies = [
+ "toml_edit 0.21.1",
+]
+
[[package]]
name = "proc-macro-error"
version = "1.0.4"
@@ -3700,9 +3697,9 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab"
[[package]]
name = "rangemap"
-version = "1.4.0"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "977b1e897f9d764566891689e642653e5ed90c6895106acd005eb4c1d0203991"
+checksum = "795915a3930a5d6bafd9053d37602fea3e61be2e5d4d788983a8ba9654c1c6f2"
[[package]]
name = "raw-window-handle"
@@ -3710,6 +3707,12 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9"
+[[package]]
+name = "raw-window-handle"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544"
+
[[package]]
name = "rayon"
version = "1.8.1"
@@ -3738,9 +3741,9 @@ checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f"
[[package]]
name = "read-fonts"
-version = "0.15.2"
+version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7555e052e772f964a1c99f1434f6a2c3a47a5f8e4292236921f121a7753cb2b5"
+checksum = "d70252c718fb23d41771a4f927e924700edefc2a91ecd52a2ee6f2461d4e6b64"
dependencies = [
"font-types",
]
@@ -3831,7 +3834,7 @@ dependencies = [
"png",
"rgb",
"svgtypes",
- "tiny-skia 0.11.3",
+ "tiny-skia",
"usvg",
]
@@ -3852,7 +3855,7 @@ dependencies = [
"objc",
"objc-foundation",
"objc_id",
- "raw-window-handle",
+ "raw-window-handle 0.5.2",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
@@ -4021,14 +4024,15 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "sctk-adwaita"
-version = "0.5.4"
-source = "git+https://github.com/pop-os/sctk-adwaita?branch=wayland-resize#da85380dfb8f0c13aed51c5bddaad0ba3654cb1f"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550"
dependencies = [
"ab_glyph",
"log",
- "memmap2 0.5.10",
- "smithay-client-toolkit 0.16.1",
- "tiny-skia 0.8.4",
+ "memmap2",
+ "smithay-client-toolkit",
+ "tiny-skia",
]
[[package]]
@@ -4108,6 +4112,12 @@ dependencies = [
"digest",
]
+[[package]]
+name = "shlex"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
+
[[package]]
name = "signal-hook"
version = "0.3.17"
@@ -4174,44 +4184,26 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
[[package]]
name = "smithay-client-toolkit"
-version = "0.16.1"
-source = "git+https://github.com/pop-os/client-toolkit?branch=wayland-resize#515820fc86cf8cb3ac8d087dc6c87852767627ca"
-dependencies = [
- "bitflags 1.3.2",
- "calloop 0.10.6",
- "dlib",
- "lazy_static",
- "log",
- "memmap2 0.5.10",
- "nix 0.24.3",
- "pkg-config",
- "wayland-client 0.29.5",
- "wayland-cursor 0.29.5",
- "wayland-protocols 0.29.5",
-]
-
-[[package]]
-name = "smithay-client-toolkit"
-version = "0.18.0"
+version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f"
+checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a"
dependencies = [
"bitflags 2.4.2",
- "calloop 0.12.4",
+ "calloop",
"calloop-wayland-source",
"cursor-icon",
"libc",
"log",
- "memmap2 0.9.4",
+ "memmap2",
"rustix 0.38.28",
"thiserror",
"wayland-backend",
- "wayland-client 0.31.2",
+ "wayland-client",
"wayland-csd-frame",
- "wayland-cursor 0.31.1",
- "wayland-protocols 0.31.2",
+ "wayland-cursor",
+ "wayland-protocols",
"wayland-protocols-wlr",
- "wayland-scanner 0.31.1",
+ "wayland-scanner",
"xkeysym",
]
@@ -4222,10 +4214,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bb62b280ce5a5cba847669933a0948d00904cf83845c944eae96a4738cea1a6"
dependencies = [
"libc",
- "smithay-client-toolkit 0.18.0",
+ "smithay-client-toolkit",
"wayland-backend",
]
+[[package]]
+name = "smol_str"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "socket2"
version = "0.4.10"
@@ -4248,32 +4249,32 @@ dependencies = [
[[package]]
name = "softbuffer"
-version = "0.3.3"
-source = "git+https://github.com/pop-os/softbuffer?tag=v0.3-cosmic#6f0371ccece51d124c6c5d37082189df0dc5f9ba"
+version = "0.4.1"
+source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#6e75b1ad7e98397d37cb187886d05969bc480995"
dependencies = [
"as-raw-xcb-connection",
"bytemuck",
- "cfg_aliases",
+ "cfg_aliases 0.2.0",
"cocoa",
- "core-graphics 0.23.1",
+ "core-graphics",
"drm",
"fastrand 2.0.1",
- "foreign-types 0.5.0",
+ "foreign-types",
"js-sys",
"log",
- "memmap2 0.9.4",
+ "memmap2",
"objc",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"redox_syscall 0.4.1",
"rustix 0.38.28",
"tiny-xlib",
"wasm-bindgen",
"wayland-backend",
- "wayland-client 0.31.2",
- "wayland-sys 0.31.1",
+ "wayland-client",
+ "wayland-sys",
"web-sys",
- "windows-sys 0.48.0",
- "x11rb 0.12.0",
+ "windows-sys 0.52.0",
+ "x11rb",
]
[[package]]
@@ -4287,12 +4288,11 @@ dependencies = [
[[package]]
name = "spirv"
-version = "0.2.0+1.5.4"
+version = "0.3.0+sdk-1.3.268.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
+checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
dependencies = [
- "bitflags 1.3.2",
- "num-traits",
+ "bitflags 2.4.2",
]
[[package]]
@@ -4301,12 +4301,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-[[package]]
-name = "str-buf"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0"
-
[[package]]
name = "strict-num"
version = "0.1.1"
@@ -4340,9 +4334,9 @@ dependencies = [
[[package]]
name = "swash"
-version = "0.1.10"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53dab2b2dc9257aead8a24ef0481b253f4c73479ce4d3b4266792dce6870d4f3"
+checksum = "d06ff4664af8923625604261c645f5c4cc610cc83c84bec74b50d76237089de7"
dependencies = [
"read-fonts",
"yazi",
@@ -4389,7 +4383,7 @@ dependencies = [
"cfg-expr",
"heck",
"pkg-config",
- "toml 0.8.9",
+ "toml 0.8.10",
"version-compare",
]
@@ -4434,18 +4428,18 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "1.0.56"
+version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
+checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.56"
+version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
+checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
dependencies = [
"proc-macro2",
"quote",
@@ -4474,23 +4468,9 @@ dependencies = [
[[package]]
name = "tiny-skia"
-version = "0.8.4"
+version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67"
-dependencies = [
- "arrayref",
- "arrayvec",
- "bytemuck",
- "cfg-if",
- "png",
- "tiny-skia-path 0.8.4",
-]
-
-[[package]]
-name = "tiny-skia"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6a067b809476893fce6a254cf285850ff69c847e6cfbade6a20b655b6c7e80d"
+checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"
dependencies = [
"arrayref",
"arrayvec",
@@ -4498,25 +4478,14 @@ dependencies = [
"cfg-if",
"log",
"png",
- "tiny-skia-path 0.11.3",
+ "tiny-skia-path",
]
[[package]]
name = "tiny-skia-path"
-version = "0.8.4"
+version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adbfb5d3f3dd57a0e11d12f4f13d4ebbbc1b5c15b7ab0a156d030b21da5f677c"
-dependencies = [
- "arrayref",
- "bytemuck",
- "strict-num",
-]
-
-[[package]]
-name = "tiny-skia-path"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5de35e8a90052baaaf61f171680ac2f8e925a1e43ea9d2e3a00514772250e541"
+checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"
dependencies = [
"arrayref",
"bytemuck",
@@ -4561,9 +4530,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.35.1"
+version = "1.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104"
+checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931"
dependencies = [
"backtrace",
"bytes",
@@ -4588,14 +4557,14 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.8.9"
+version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325"
+checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
- "toml_edit 0.21.1",
+ "toml_edit 0.22.4",
]
[[package]]
@@ -4623,6 +4592,17 @@ name = "toml_edit"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
+dependencies = [
+ "indexmap",
+ "toml_datetime",
+ "winnow",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.22.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951"
dependencies = [
"indexmap",
"serde",
@@ -4766,9 +4746,9 @@ checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc"
[[package]]
name = "unicode-segmentation"
-version = "1.10.1"
+version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
+checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
[[package]]
name = "unicode-vo"
@@ -4858,7 +4838,7 @@ dependencies = [
"rctree",
"strict-num",
"svgtypes",
- "tiny-skia-path 0.11.3",
+ "tiny-skia-path",
]
[[package]]
@@ -4867,12 +4847,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
-[[package]]
-name = "vec_map"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
-
[[package]]
name = "version-compare"
version = "0.1.1"
@@ -4933,9 +4907,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.90"
+version = "0.2.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406"
+checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@@ -4943,9 +4917,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.90"
+version = "0.2.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd"
+checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b"
dependencies = [
"bumpalo",
"log",
@@ -4958,9 +4932,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.40"
+version = "0.4.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461"
+checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97"
dependencies = [
"cfg-if",
"js-sys",
@@ -4970,9 +4944,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.90"
+version = "0.2.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999"
+checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -4980,9 +4954,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.90"
+version = "0.2.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7"
+checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66"
dependencies = [
"proc-macro2",
"quote",
@@ -4993,9 +4967,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.90"
+version = "0.2.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b"
+checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838"
[[package]]
name = "wasm-timer"
@@ -5023,23 +4997,7 @@ dependencies = [
"rustix 0.38.28",
"scoped-tls",
"smallvec",
- "wayland-sys 0.31.1",
-]
-
-[[package]]
-name = "wayland-client"
-version = "0.29.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715"
-dependencies = [
- "bitflags 1.3.2",
- "downcast-rs",
- "libc",
- "nix 0.24.3",
- "scoped-tls",
- "wayland-commons",
- "wayland-scanner 0.29.5",
- "wayland-sys 0.29.5",
+ "wayland-sys",
]
[[package]]
@@ -5051,19 +5009,7 @@ dependencies = [
"bitflags 2.4.2",
"rustix 0.38.28",
"wayland-backend",
- "wayland-scanner 0.31.1",
-]
-
-[[package]]
-name = "wayland-commons"
-version = "0.29.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902"
-dependencies = [
- "nix 0.24.3",
- "once_cell",
- "smallvec",
- "wayland-sys 0.29.5",
+ "wayland-scanner",
]
[[package]]
@@ -5077,17 +5023,6 @@ dependencies = [
"wayland-backend",
]
-[[package]]
-name = "wayland-cursor"
-version = "0.29.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661"
-dependencies = [
- "nix 0.24.3",
- "wayland-client 0.29.5",
- "xcursor",
-]
-
[[package]]
name = "wayland-cursor"
version = "0.31.1"
@@ -5095,22 +5030,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba"
dependencies = [
"rustix 0.38.28",
- "wayland-client 0.31.2",
+ "wayland-client",
"xcursor",
]
-[[package]]
-name = "wayland-protocols"
-version = "0.29.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6"
-dependencies = [
- "bitflags 1.3.2",
- "wayland-client 0.29.5",
- "wayland-commons",
- "wayland-scanner 0.29.5",
-]
-
[[package]]
name = "wayland-protocols"
version = "0.31.2"
@@ -5119,8 +5042,21 @@ checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4"
dependencies = [
"bitflags 2.4.2",
"wayland-backend",
- "wayland-client 0.31.2",
- "wayland-scanner 0.31.1",
+ "wayland-client",
+ "wayland-scanner",
+]
+
+[[package]]
+name = "wayland-protocols-plasma"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479"
+dependencies = [
+ "bitflags 2.4.2",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-scanner",
]
[[package]]
@@ -5131,20 +5067,9 @@ checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6"
dependencies = [
"bitflags 2.4.2",
"wayland-backend",
- "wayland-client 0.31.2",
- "wayland-protocols 0.31.2",
- "wayland-scanner 0.31.1",
-]
-
-[[package]]
-name = "wayland-scanner"
-version = "0.29.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53"
-dependencies = [
- "proc-macro2",
- "quote",
- "xml-rs",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-scanner",
]
[[package]]
@@ -5158,17 +5083,6 @@ dependencies = [
"quote",
]
-[[package]]
-name = "wayland-sys"
-version = "0.29.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4"
-dependencies = [
- "dlib",
- "lazy_static",
- "pkg-config",
-]
-
[[package]]
name = "wayland-sys"
version = "0.31.1"
@@ -5183,9 +5097,19 @@ dependencies = [
[[package]]
name = "web-sys"
-version = "0.3.64"
+version = "0.3.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
+checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "web-time"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -5199,19 +5123,18 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082"
[[package]]
name = "wgpu"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30e7d227c9f961f2061c26f4cb0fbd4df0ef37e056edd0931783599d6c94ef24"
+version = "0.19.0"
+source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109"
dependencies = [
"arrayvec",
"cfg-if",
- "flume 0.11.0",
+ "cfg_aliases 0.1.1",
"js-sys",
"log",
"naga",
"parking_lot 0.12.1",
"profiling",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"smallvec",
"static_assertions",
"wasm-bindgen",
@@ -5224,19 +5147,21 @@ dependencies = [
[[package]]
name = "wgpu-core"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef91c1d62d1e9e81c79e600131a258edf75c9531cbdbde09c44a011a47312726"
+version = "0.19.0"
+source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109"
dependencies = [
"arrayvec",
"bit-vec",
"bitflags 2.4.2",
+ "cfg_aliases 0.1.1",
"codespan-reporting",
+ "indexmap",
"log",
"naga",
+ "once_cell",
"parking_lot 0.12.1",
"profiling",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"rustc-hash",
"smallvec",
"thiserror",
@@ -5247,9 +5172,8 @@ dependencies = [
[[package]]
name = "wgpu-hal"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b84ecc802da3eb67b4cf3dd9ea6fe45bbb47ef13e6c49c5c3240868a9cc6cdd9"
+version = "0.19.0"
+source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109"
dependencies = [
"android_system_properties",
"arrayvec",
@@ -5257,6 +5181,7 @@ dependencies = [
"bit-set",
"bitflags 2.4.2",
"block",
+ "cfg_aliases 0.1.1",
"core-graphics-types",
"d3d12",
"glow",
@@ -5277,7 +5202,7 @@ dependencies = [
"parking_lot 0.12.1",
"profiling",
"range-alloc",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"renderdoc-sys",
"rustc-hash",
"smallvec",
@@ -5290,9 +5215,8 @@ dependencies = [
[[package]]
name = "wgpu-types"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d5ed5f0edf0de351fe311c53304986315ce866f394a2e6df0c4b3c70774bcdd"
+version = "0.19.0"
+source = "git+https://github.com/gfx-rs/wgpu?rev=20fda69#20fda698341efbdc870b8027d6d49f5bf3f36109"
dependencies = [
"bitflags 2.4.2",
"js-sys",
@@ -5330,15 +5254,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "winapi-wsapoll"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e"
-dependencies = [
- "winapi",
-]
-
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
@@ -5347,53 +5262,53 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "window_clipboard"
-version = "0.3.0"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63287c9c4396ccf5346d035a9b0fcaead9e18377637f5eaa78b7ac65c873ff7d"
+checksum = "c6a197337269a469b5b2583d65dd7dfe475fd79a525be0aa647ff6d37ac6612c"
dependencies = [
"clipboard-win",
"clipboard_macos",
"clipboard_wayland",
"clipboard_x11",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"thiserror",
]
[[package]]
name = "windows"
-version = "0.44.0"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b"
+checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
dependencies = [
"windows-implement",
"windows-interface",
- "windows-targets 0.42.2",
+ "windows-targets 0.48.5",
]
[[package]]
name = "windows"
-version = "0.51.1"
+version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
+checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
- "windows-targets 0.48.5",
+ "windows-targets 0.52.0",
]
[[package]]
name = "windows-core"
-version = "0.51.1"
+version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
+checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
- "windows-targets 0.48.5",
+ "windows-targets 0.52.0",
]
[[package]]
name = "windows-implement"
-version = "0.44.0"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6"
+checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c"
dependencies = [
"proc-macro2",
"quote",
@@ -5402,9 +5317,9 @@ dependencies = [
[[package]]
name = "windows-interface"
-version = "0.44.0"
+version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f"
+checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7"
dependencies = [
"proc-macro2",
"quote",
@@ -5611,43 +5526,56 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
[[package]]
name = "winit"
-version = "0.28.6"
-source = "git+https://github.com/pop-os/winit.git?branch=master#c6ad672264b2e320cd15a531f67e133d9ecd39bf"
+version = "0.29.10"
+source = "git+https://github.com/pop-os/winit.git?branch=winit-0.29#bdc66109acc85c912264c9e4b864520345bdb45f"
dependencies = [
+ "ahash",
"android-activity",
- "bitflags 1.3.2",
- "cfg_aliases",
+ "atomic-waker",
+ "bitflags 2.4.2",
+ "bytemuck",
+ "calloop",
+ "cfg_aliases 0.1.1",
"core-foundation",
- "core-graphics 0.22.3",
- "dispatch",
- "instant",
+ "core-graphics",
+ "cursor-icon",
+ "icrate 0.0.4",
+ "js-sys",
"libc",
"log",
- "mio",
+ "memmap2",
"ndk",
- "objc2",
+ "ndk-sys",
+ "objc2 0.4.1",
"once_cell",
"orbclient",
"percent-encoding",
- "raw-window-handle",
+ "raw-window-handle 0.6.0",
"redox_syscall 0.3.5",
+ "rustix 0.38.28",
"sctk-adwaita",
- "smithay-client-toolkit 0.16.1",
+ "smithay-client-toolkit",
+ "smol_str",
+ "unicode-segmentation",
"wasm-bindgen",
- "wayland-client 0.29.5",
- "wayland-commons",
- "wayland-protocols 0.29.5",
- "wayland-scanner 0.29.5",
+ "wasm-bindgen-futures",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-protocols-plasma",
"web-sys",
- "windows-sys 0.45.0",
+ "web-time",
+ "windows-sys 0.48.0",
"x11-dl",
+ "x11rb",
+ "xkbcommon-dl",
]
[[package]]
name = "winnow"
-version = "0.5.35"
+version = "0.5.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d"
+checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29"
dependencies = [
"memchr",
]
@@ -5663,41 +5591,19 @@ dependencies = [
"pkg-config",
]
-[[package]]
-name = "x11rb"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a"
-dependencies = [
- "as-raw-xcb-connection",
- "gethostname 0.3.0",
- "libc",
- "libloading 0.7.4",
- "nix 0.26.4",
- "once_cell",
- "winapi",
- "winapi-wsapoll",
- "x11rb-protocol 0.12.0",
-]
-
[[package]]
name = "x11rb"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a"
dependencies = [
- "gethostname 0.4.3",
+ "as-raw-xcb-connection",
+ "gethostname",
+ "libc",
+ "libloading 0.8.1",
+ "once_cell",
"rustix 0.38.28",
- "x11rb-protocol 0.13.0",
-]
-
-[[package]]
-name = "x11rb-protocol"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc"
-dependencies = [
- "nix 0.26.4",
+ "x11rb-protocol",
]
[[package]]
@@ -5720,14 +5626,27 @@ checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546"
[[package]]
name = "xdg-home"
-version = "1.0.0"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd"
+checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e"
dependencies = [
- "nix 0.26.4",
+ "libc",
"winapi",
]
+[[package]]
+name = "xkbcommon-dl"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
+dependencies = [
+ "bitflags 2.4.2",
+ "dlib",
+ "log",
+ "once_cell",
+ "xkeysym",
+]
+
[[package]]
name = "xkeysym"
version = "0.2.0"
@@ -5760,9 +5679,9 @@ checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1"
[[package]]
name = "zbus"
-version = "3.14.1"
+version = "3.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948"
+checksum = "c45d06ae3b0f9ba1fb2671268b975557d8f5a84bb5ec6e43964f87e763d8bca8"
dependencies = [
"async-broadcast",
"async-executor",
@@ -5782,7 +5701,7 @@ dependencies = [
"futures-sink",
"futures-util",
"hex",
- "nix 0.26.4",
+ "nix",
"once_cell",
"ordered-stream",
"rand",
@@ -5802,11 +5721,11 @@ dependencies = [
[[package]]
name = "zbus_macros"
-version = "3.14.1"
+version = "3.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d"
+checksum = "b4a1ba45ed0ad344b85a2bb5a1fe9830aed23d67812ea39a586e7d0136439c7d"
dependencies = [
- "proc-macro-crate",
+ "proc-macro-crate 1.3.1",
"proc-macro2",
"quote",
"regex",
@@ -5881,7 +5800,7 @@ version = "3.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd"
dependencies = [
- "proc-macro-crate",
+ "proc-macro-crate 1.3.1",
"proc-macro2",
"quote",
"syn 1.0.109",
diff --git a/Cargo.toml b/Cargo.toml
index 5d8514e..2426e1c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,8 +11,10 @@ alacritty_terminal = "0.20"
env_logger = "0.10"
lazy_static = "1"
indexmap = "2"
+lexical-sort = "0.3.1"
log = "0.4"
serde = { version = "1", features = ["serde_derive"] }
+shlex = "1"
tokio = { version = "1", features = ["sync"] }
# Internationalization
i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] }
@@ -21,8 +23,13 @@ rust-embed = "6"
paste = "1.0"
palette = "0.7"
+[dependencies.smol_str]
+version = "0.2.1"
+features = ["serde"]
+
[dependencies.cosmic-text]
git = "https://github.com/pop-os/cosmic-text.git"
+features = ["shape-run-cache"]
[dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic.git"
@@ -36,7 +43,6 @@ wgpu = ["libcosmic/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" }
-smithay-client-toolkit = { git = "https://github.com/pop-os/client-toolkit", branch = "wayland-resize" }
[profile.release-with-debug]
inherits = "release"
diff --git a/debian/control b/debian/control
index b345f21..0cc4c8f 100644
--- a/debian/control
+++ b/debian/control
@@ -13,4 +13,5 @@ Homepage: https://github.com/pop-os/cosmic-term
Package: cosmic-term
Architecture: amd64 arm64
Depends: ${misc:Depends}, ${shlibs:Depends}
+Provides: x-terminal-emulator
Description: Cosmic Terminal
diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl
index 31de374..60d1253 100644
--- a/i18n/en/cosmic_term.ftl
+++ b/i18n/en/cosmic_term.ftl
@@ -1,5 +1,16 @@
+new-terminal = New terminal
+
# Context Pages
+## Profiles
+profiles = Profiles
+name = Name
+command-line = Command line
+tab-title = Tab title
+tab-title-description = Override the default tab title
+add-profile = Add profile
+new-profile = New profile
+
## Settings
settings = Settings
@@ -12,6 +23,7 @@ light = Light
syntax-dark = Color scheme dark
syntax-light = Color scheme light
default-zoom-step = Zoom steps
+opacity = Background opacity
### Font
font = Font
@@ -44,6 +56,8 @@ find-next = Find next
file = File
new-tab = New tab
new-window = New window
+profile = Profile
+menu-profiles = Profiles...
close-tab = Close tab
quit = Quit
diff --git a/i18n/ja/cosmic_term.ftl b/i18n/ja/cosmic_term.ftl
index f10f2ab..4252b70 100644
--- a/i18n/ja/cosmic_term.ftl
+++ b/i18n/ja/cosmic_term.ftl
@@ -1,25 +1,47 @@
# Context Pages
+## Profiles
+profiles = プロファイル
+name = 名前
+command-line = コマンドライン
+tab-title = タブのイトル
+tab-title-description = デフォルトのタブタイトルを無効にします
+add-profile = プロファイルを追加
+new-profile = 新しいプロファイル
+
## Settings
settings = 設定
### Appearance
appearance = 外観
theme = テーマ
-match-desktop = デスクトップに合わす
-dark = 暗い
-light = 明かり
-syntax-dark = 暗いシンタックス
-syntax-light = 明かりシンタックス
-advanced-font-settings = 詳細なフォント設定
-default-font = デフォルトフォント
-default-font-stretch = デフォルトのフォント幅
-default-font-weight = デフォルトのフォントの太さ
-default-dim-font-weight = デフォルトの暗いフォントの太さ
-default-bold-font-weight = デフォルトの太字の太さ
+match-desktop = システム設定に従う
+dark = ダーク
+light = ライト
+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 = 太字を明るい色で表示する
-default-font-size = デフォルトのフォントサイズ
-default-zoom-step =ズームの間隔
+
+### Splits
+splits = ウィンドウの分割
+focus-follow-mouse = フォーカスをマウスに追従
+
+### Advanced
+advanced = 高度な設定
+show-headerbar = ヘッダーを表示する
+show-header-description = 右クリックでヘッダーを表示する
# Find
find-placeholder = 検索...
@@ -32,6 +54,8 @@ find-next = 次を検索
file = ファイル
new-tab = 新しいタブ
new-window = 新しいウィンドウ
+profile = プロファイル
+menu-profiles = プロファイル...
close-tab = タブを閉じる
quit = 終了
@@ -44,7 +68,12 @@ find = 検索
## View
view = 表示
+zoom-in = 拡大
+zoom-reset = デフォルトに戻す
+zoom-out = 縮小
+next-tab = 次のタブ
+previous-tab = 前のタブ
+split-horizontal = 上下に分割
+split-vertical = 左右に分割
+pane-toggle-maximize = ペインの最大化を切替
menu-settings = 設定...
-
-# Context menu
-show-headerbar = ヘッダーバーを表す
diff --git a/i18n/pl/cosmic_term.ftl b/i18n/pl/cosmic_term.ftl
index b2adf60..d798beb 100644
--- a/i18n/pl/cosmic_term.ftl
+++ b/i18n/pl/cosmic_term.ftl
@@ -11,20 +11,32 @@ dark = Ciemny
light = Jasny
syntax-dark = Ciemna składnia
syntax-light = Jasna składnia
-advanced-font-settings = Advanced Font Settings
+default-zoom-step = Domyślny poziom przybliżenia
+
+### Font
+font = Czcionka
+advanced-font-settings = Zaawansowane Ustawienia Czcionek
default-font = Domyślna czcionka
+default-font-size = Domyślny rozmiar czcionki
default-font-stretch = Domyślne rozciągnięcie czcionki
default-font-weight = Domyślna grubość czcionki
default-dim-font-weight = Domyślna grubość przyciemnionej czcionki
default-bold-font-weight = Domyślna grubość pogrubionej czcionki
-use-bright-bold = Użyj jasnych kolorów przy pogrubionym tekście
-default-font-size = Domyślny rozmiar czcionki
-default-zoom-step = Domyślny poziom przybliżenia
+use-bright-bold = Rozjaśnij pogrubiony tekst
+
+### Splits
+splits = Podziel
+focus-follow-mouse = Aktywne okno pisania odpowiada położeniu myszki
+
+### Advanced
+advanced = Zaawansowane
+show-headerbar = Pokaż pasek nagłówka
+show-header-description = Ukazuje pasek nagłówka z menu wybieranego prawym przyciskiem myszki.
# Find
-find-placeholder = Find...
-find-previous = Find previous
-find-next = Find next
+find-placeholder = Szukaj...
+find-previous = Szukaj poprzedni
+find-next = Szukaj następny
# Menu
@@ -44,7 +56,12 @@ find = Szukaj
## View
view = Widok
+zoom-in = Większy tekst
+zoom-reset = Domyślny rozmiar tekstu
+zoom-out = Mniejszy tekst
+next-tab = Natępna karta
+previous-tab = Poprzednia karta
+split-horizontal = Podziel w poziomie
+split-vertical = Podziel w pionie
+pane-toggle-maximize = Przełącznik maksymalizacji
menu-settings = Ustawienia...
-
-# Context menu
-show-headerbar = Pokaż pasek nagłówka
diff --git a/i18n/ru/cosmic_term.ftl b/i18n/ru/cosmic_term.ftl
index 336d771..5abde5e 100644
--- a/i18n/ru/cosmic_term.ftl
+++ b/i18n/ru/cosmic_term.ftl
@@ -9,17 +9,29 @@ theme = Тема
match-desktop = Как в системе
dark = Темная
light = Светлая
-syntax-dark = Синтаксис темный
-syntax-light = Синтаксис светлый
+syntax-dark = Цветовая схема темная
+syntax-light = Цветовая схема светлая
+default-zoom-step = Шаги масштабирования
+
+### Font
+font = Шрифт
advanced-font-settings = Дополнительные настройки шрифта
default-font = Шрифт по умолчанию
-default-font-stretch = Растяжение шрифта по умолчанию
-default-font-weight = Масса шрифта по умолчанию
-default-dim-font-weight = Масса dim шрифта по умолчанию
-default-bold-font-weight = Масса жирного шрифта по умолчанию
-use-bright-bold = Использовать яркие цвета и жирный текст
-default-font-size = Размер шрифта по умолчанию
-default-zoom-step = Шаг масштабирования по умолчанию
+default-font-size = Размер шрифта
+default-font-stretch = Растяжение шрифта
+default-font-weight = Масса шрифта
+default-dim-font-weight = Масса dim шрифта
+default-bold-font-weight = Масса жирного шрифта
+use-bright-bold = Сделать жирный текст ярче
+
+### Splits
+splits = Деления
+focus-follow-mouse = Фокус при наборе следует за мышью
+
+### Advanced
+advanced = Дополнительно
+show-headerbar = Отображать заголовок
+show-header-description = Раскройте заголовок из меню правой кнопки мыши.
# Find
find-placeholder = Найти...
@@ -44,7 +56,12 @@ find = Найти
## View
view = Вид
+zoom-in = Текст крупнее
+zoom-reset = Размер текста по умолчанию
+zoom-out = Текст меньше
+next-tab = Следующая вкладка
+previous-tab = Предыдущая вкладка
+split-horizontal = Разделение по горизонтали
+split-vertical = Разделение по вертикали
+pane-toggle-maximize = Переключить на весь экран
menu-settings = Параметры...
-
-# Context menu
-show-headerbar = Отображать заголовок
\ No newline at end of file
diff --git a/i18n/sv-SE/cosmic_term.ftl b/i18n/sv-SE/cosmic_term.ftl
new file mode 100644
index 0000000..30a14a2
--- /dev/null
+++ b/i18n/sv-SE/cosmic_term.ftl
@@ -0,0 +1,67 @@
+# Context sidor
+
+## Settings
+settings = Inställningar
+
+### Appearance
+appearance = Utseende
+theme = Tema
+match-desktop = Matcha skrivbordet
+dark = Mörkt
+light = Ljust
+syntax-dark = Färgschema mörkt
+syntax-light = Färgschema ljust
+default-zoom-step = Zoom steg
+
+### Teckensnitt
+font = Teckensnitt
+advanced-font-settings = Avancerade teckensnittsinställningar
+default-font = Teckensnitt
+default-font-size = Teckenstorlek
+default-font-stretch = Teckenstretch
+default-font-weight = Normal teckensnittsvikt
+default-dim-font-weight = Dämpad teckensnittsvikt
+default-bold-font-weight = Fet teckensnittsvikt
+use-bright-bold = Gör fet text ljusare
+
+### Delar
+splits = Delar
+focus-follow-mouse = Skrivfokus följer mus
+
+### Avancerat
+advanced = Avancerat
+show-headerbar = Visa rubrikrad
+show-header-description = Visa rubrikrad från högerklicksmenyn.
+
+# Sök
+find-placeholder = Sök…
+find-previous = Hitta föregående
+find-next = Hitta nästa
+
+# Meny
+
+## Fil
+file = Fil
+new-tab = Ny flik
+new-window = Nytt fönster
+close-tab = Stäng flik
+quit = Avsluta
+
+## Redigera
+edit = Redigera
+copy = Kopiera
+paste = Klistra in
+select-all = Välj alla
+find = Sök
+
+## Visa
+view = Visa
+zoom-in = Zooma in
+zoom-reset = Återställ zoom
+zoom-out = Zooma ut
+next-tab = Nästa flik
+previous-tab = Föregående flik
+split-horizontal = Dela horisontellt
+split-vertical = Dela vertikalt
+pane-toggle-maximize = Växla maximerad
+menu-settings = Inställningar…
diff --git a/i18n/tr/cosmic-term.ftl b/i18n/tr/cosmic-term.ftl
new file mode 100644
index 0000000..4ff0f19
--- /dev/null
+++ b/i18n/tr/cosmic-term.ftl
@@ -0,0 +1,78 @@
+# Context Pages
+
+## Profiles
+profiles = Profiller
+name = İsim
+command-line = Komut satırı
+tab-title = Sekme başlığı
+tab-title-description = Varsayılan sekme başlığını geçersiz kılar
+add-profile = Profil ekle
+new-profile = Yeni profil
+
+## Settings
+settings = Ayarlar
+
+### Appearance
+appearance = Görünüm
+theme = Tema
+match-desktop = Masaüstüyle eşle
+dark = Karanlık
+light = Aydınlık
+syntax-dark = Karanlık renk şeması
+syntax-light = Aydınlık renk şeması
+default-zoom-step = Yakınlaştırma basamakları
+
+### Font
+font = Yazı tipi
+advanced-font-settings = Gelişmiş Yazı tipi Seçenekleri
+default-font = Yazı tipi
+default-font-size = Yazı tipi boyutu
+default-font-stretch = Yazı tipi esnekliği
+default-font-weight = Normal yazı tipi ağırlığı
+default-dim-font-weight = Soluk yazı tipi ağırlığı
+default-bold-font-weight = Kalın yazı tipi ağırlığı
+use-bright-bold = Kalın metni daha parlak yap
+
+### Splits
+splits = Bölmeler
+focus-follow-mouse = Yazma odağı fareyi takip etsin
+
+### Advanced
+advanced = Gelişmiş
+show-headerbar = Başlığı göster
+show-header-description = Sağ tıklama menüsünden başlığı gösterin.
+
+# Find
+find-placeholder = Bul...
+find-previous = Öncekini bul
+find-next = Sonrakini bul
+
+# Menu
+
+## File
+file = Dosyal
+new-tab = Yeni sekme
+new-window = Yeni pencere
+profile = Profil
+menu-profiles = Profiller...
+close-tab = Sekmeyi kapat
+quit = Çık
+
+## Edit
+edit = Düzenle
+copy = Kopyala
+paste = Yapıştır
+select-all = Hepsini seç
+find = Bul
+
+## View
+view = Görünüş
+zoom-in = Daha büyük metin
+zoom-reset = Varsayılan metin boyutu
+zoom-out = Daha küçük metin
+next-tab = Sonraki sekme
+previous-tab = Önceki sekme
+split-horizontal = Yatay böl
+split-vertical = Dikey böl
+pane-toggle-maximize = En üste geç
+menu-settings = Ayarlar...
diff --git a/justfile b/justfile
index 3518f18..23d5ad8 100644
--- a/justfile
+++ b/justfile
@@ -46,9 +46,13 @@ check *args:
# Runs a clippy check with JSON message format
check-json: (check '--message-format=json')
+dev *args:
+ cargo fmt
+ just run {{args}}
+
# Run with debug logs
run *args:
- env RUST_LOG=debug RUST_BACKTRACE=full cargo run --release {{args}}
+ env RUST_LOG=cosmic_term=debug RUST_BACKTRACE=full cargo run --release {{args}}
# Installs files
install:
diff --git a/res/icons/edit-delete-symbolic.svg b/res/icons/edit-delete-symbolic.svg
new file mode 100644
index 0000000..22efd68
--- /dev/null
+++ b/res/icons/edit-delete-symbolic.svg
@@ -0,0 +1,4 @@
+
diff --git a/res/icons/list-add-symbolic.svg b/res/icons/list-add-symbolic.svg
new file mode 100644
index 0000000..59b2fb0
--- /dev/null
+++ b/res/icons/list-add-symbolic.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/config.rs b/src/config.rs
index d2c4680..dd0427c 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -10,6 +10,8 @@ use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
use std::sync::OnceLock;
+use crate::fl;
+
pub const CONFIG_VERSION: u64 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
@@ -29,6 +31,35 @@ impl AppTheme {
}
}
+#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
+#[serde(transparent)]
+pub struct ProfileId(pub u64);
+
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
+pub struct Profile {
+ pub name: String,
+ #[serde(default)]
+ pub command: String,
+ #[serde(default)]
+ pub syntax_theme_dark: String,
+ #[serde(default)]
+ pub syntax_theme_light: String,
+ #[serde(default)]
+ pub tab_title: String,
+}
+
+impl Default for Profile {
+ fn default() -> Self {
+ Self {
+ name: fl!("new-profile"),
+ command: String::new(),
+ syntax_theme_dark: "COSMIC Dark".to_string(),
+ syntax_theme_light: "COSMIC Light".to_string(),
+ tab_title: String::new(),
+ }
+ }
+}
+
#[derive(Clone, CosmicConfigEntry, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Config {
pub app_theme: AppTheme,
@@ -39,6 +70,8 @@ pub struct Config {
pub bold_font_weight: u16,
pub font_stretch: u16,
pub font_size_zoom_step_mul_100: u16,
+ pub opacity: u8,
+ pub profiles: BTreeMap,
pub show_headerbar: bool,
pub use_bright_bold: bool,
pub syntax_theme_dark: String,
@@ -50,18 +83,20 @@ impl Default for Config {
fn default() -> Self {
Self {
app_theme: AppTheme::System,
+ bold_font_weight: Weight::BOLD.0,
+ dim_font_weight: Weight::NORMAL.0,
+ focus_follow_mouse: false,
font_name: "Fira Mono".to_string(),
font_size: 14,
- font_weight: Weight::NORMAL.0,
- dim_font_weight: Weight::NORMAL.0,
- bold_font_weight: Weight::BOLD.0,
- font_stretch: Stretch::Normal.to_number(),
font_size_zoom_step_mul_100: 100,
+ font_stretch: Stretch::Normal.to_number(),
+ font_weight: Weight::NORMAL.0,
+ opacity: 100,
+ profiles: BTreeMap::new(),
show_headerbar: true,
- use_bright_bold: false,
syntax_theme_dark: "COSMIC Dark".to_string(),
syntax_theme_light: "COSMIC Light".to_string(),
- focus_follow_mouse: false,
+ use_bright_bold: false,
}
}
}
@@ -81,13 +116,46 @@ impl Config {
Metrics::new(font_size, line_height)
}
+ pub fn opacity_ratio(&self) -> f32 {
+ (self.opacity as f32) / 100.0
+ }
+
+ // Get a sorted and adjusted for duplicates list of profiles 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() {
+ let mut name = profile.name.clone();
+
+ let mut copies = 1;
+ while profile_names.iter().find(|x| x.0 == name).is_some() {
+ copies += 1;
+ name = format!("{} ({})", profile.name, copies);
+ }
+
+ profile_names.push((name, *profile_id));
+ }
+ profile_names.sort_by(|a, b| lexical_sort::natural_lexical_cmp(&a.0, &b.0));
+ profile_names
+ }
+
// Get current syntax theme based on dark mode
- pub fn syntax_theme(&self) -> &str {
+ pub fn syntax_theme(&self, profile_id_opt: Option) -> &str {
let dark = self.app_theme.theme().theme_type.is_dark();
- if dark {
- &self.syntax_theme_dark
- } else {
- &self.syntax_theme_light
+ 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
+ }
+ }
}
}
diff --git a/src/icon_cache.rs b/src/icon_cache.rs
index 24d5024..a06f3fa 100644
--- a/src/icon_cache.rs
+++ b/src/icon_cache.rs
@@ -31,6 +31,8 @@ impl IconCache {
}
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!("window-close-symbolic", 16);
diff --git a/src/key_bind.rs b/src/key_bind.rs
index bf54cad..edeef4e 100644
--- a/src/key_bind.rs
+++ b/src/key_bind.rs
@@ -1,4 +1,7 @@
-use cosmic::iced::keyboard::{KeyCode, Modifiers};
+use cosmic::{
+ iced::keyboard::{Key, Modifiers},
+ iced_core::keyboard::key::Named,
+};
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, fmt};
@@ -15,12 +18,12 @@ pub enum Modifier {
#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
pub struct KeyBind {
pub modifiers: Vec,
- pub key_code: KeyCode,
+ pub key: Key,
}
impl KeyBind {
- pub fn matches(&self, modifiers: Modifiers, key_code: KeyCode) -> bool {
- self.key_code == key_code
+ pub fn matches(&self, modifiers: Modifiers, key: &Key) -> bool {
+ key == &self.key
&& modifiers.logo() == self.modifiers.contains(&Modifier::Super)
&& modifiers.control() == self.modifiers.contains(&Modifier::Ctrl)
&& modifiers.alt() == self.modifiers.contains(&Modifier::Alt)
@@ -33,7 +36,11 @@ impl fmt::Display for KeyBind {
for modifier in self.modifiers.iter() {
write!(f, "{:?} + ", modifier)?;
}
- write!(f, "{:?}", self.key_code)
+ match &self.key {
+ Key::Character(c) => write!(f, "{}", c.to_uppercase()),
+ Key::Named(named) => write!(f, "{:?}", named),
+ other => write!(f, "{:?}", other),
+ }
}
}
@@ -42,11 +49,11 @@ pub fn key_binds() -> HashMap {
let mut key_binds = HashMap::new();
macro_rules! bind {
- ([$($modifier:ident),+ $(,)?], $key_code:ident, $action:ident) => {{
+ ([$($modifier:ident),+ $(,)?], $key:expr, $action:ident) => {{
key_binds.insert(
KeyBind {
modifiers: vec![$(Modifier::$modifier),+],
- key_code: KeyCode::$key_code,
+ key: $key,
},
Action::$action,
);
@@ -54,52 +61,56 @@ pub fn key_binds() -> HashMap {
}
// Standard key bindings
- bind!([Ctrl, Shift], A, SelectAll);
- bind!([Ctrl, Shift], C, Copy);
- bind!([Ctrl, Shift], F, Find);
- bind!([Ctrl, Shift], N, WindowNew);
- bind!([Ctrl, Shift], Q, WindowClose);
- bind!([Ctrl, Shift], T, TabNew);
- bind!([Ctrl, Shift], V, Paste);
- bind!([Shift], Insert, PastePrimary);
- bind!([Ctrl, Shift], W, TabClose);
+ bind!([Ctrl, Shift], Key::Character("A".into()), SelectAll);
+ bind!([Ctrl, Shift], Key::Character("C".into()), Copy);
+ bind!([Ctrl, Shift], Key::Character("F".into()), Find);
+ bind!([Ctrl, Shift], Key::Character("N".into()), WindowNew);
+ bind!([Ctrl, Shift], Key::Character("Q".into()), WindowClose);
+ bind!([Ctrl, Shift], Key::Character("T".into()), TabNew);
+ bind!([Ctrl, Shift], Key::Character("V".into()), Paste);
+ bind!([Shift], Key::Named(Named::Insert), PastePrimary);
+ bind!([Ctrl, Shift], Key::Character("W".into()), TabClose);
// Ctrl+Alt+D splits horizontally, Ctrl+Alt+R splits vertically, Ctrl+Shift+X maximizes split
//TODO: Adjust bindings as desired by UX
- bind!([Ctrl, Alt], D, PaneSplitHorizontal);
- bind!([Ctrl, Alt], R, PaneSplitVertical);
- bind!([Ctrl, Shift], X, PaneToggleMaximized);
+ bind!([Ctrl, Alt], Key::Character("d".into()), PaneSplitHorizontal);
+ bind!([Ctrl, Alt], Key::Character("r".into()), PaneSplitVertical);
+ bind!(
+ [Ctrl, Shift],
+ Key::Character("X".into()),
+ PaneToggleMaximized
+ );
// Ctrl+Tab and Ctrl+Shift+Tab cycle through tabs
// Ctrl+Tab is not a special key for terminals and is free to use
- bind!([Ctrl], Tab, TabNext);
- bind!([Ctrl, Shift], Tab, TabPrev);
+ bind!([Ctrl], Key::Named(Named::Tab), TabNext);
+ bind!([Ctrl, Shift], Key::Named(Named::Tab), TabPrev);
// Ctrl+Shift+# activates tabs by index
- bind!([Ctrl, Shift], Key1, TabActivate0);
- bind!([Ctrl, Shift], Key2, TabActivate1);
- bind!([Ctrl, Shift], Key3, TabActivate2);
- bind!([Ctrl, Shift], Key4, TabActivate3);
- bind!([Ctrl, Shift], Key5, TabActivate4);
- bind!([Ctrl, Shift], Key6, TabActivate5);
- bind!([Ctrl, Shift], Key7, TabActivate6);
- bind!([Ctrl, Shift], Key8, TabActivate7);
- bind!([Ctrl, Shift], Key9, TabActivate8);
+ bind!([Ctrl, Shift], Key::Character("!".into()), TabActivate0);
+ bind!([Ctrl, Shift], Key::Character("@".into()), TabActivate1);
+ bind!([Ctrl, Shift], Key::Character("#".into()), TabActivate2);
+ bind!([Ctrl, Shift], Key::Character("$".into()), TabActivate3);
+ bind!([Ctrl, Shift], Key::Character("%".into()), TabActivate4);
+ bind!([Ctrl, Shift], Key::Character("^".into()), TabActivate5);
+ bind!([Ctrl, Shift], Key::Character("&".into()), TabActivate6);
+ bind!([Ctrl, Shift], Key::Character("*".into()), TabActivate7);
+ bind!([Ctrl, Shift], Key::Character("(".into()), TabActivate8);
// Ctrl+0, Ctrl+-, and Ctrl+= are not special keys for terminals and are free to use
- bind!([Ctrl], Key0, ZoomReset);
- bind!([Ctrl], Minus, ZoomOut);
- bind!([Ctrl], Equals, ZoomIn);
+ bind!([Ctrl], Key::Character("0".into()), ZoomReset);
+ bind!([Ctrl], Key::Character("-".into()), ZoomOut);
+ bind!([Ctrl], Key::Character("=".into()), ZoomIn);
// Ctrl+Arrows and Ctrl+HJKL move between splits
- bind!([Ctrl, Shift], Left, PaneFocusLeft);
- bind!([Ctrl, Shift], H, PaneFocusLeft);
- bind!([Ctrl, Shift], Down, PaneFocusDown);
- bind!([Ctrl, Shift], J, PaneFocusDown);
- bind!([Ctrl, Shift], Up, PaneFocusUp);
- bind!([Ctrl, Shift], K, PaneFocusUp);
- bind!([Ctrl, Shift], Right, PaneFocusRight);
- bind!([Ctrl, Shift], L, PaneFocusRight);
+ bind!([Ctrl, Shift], Key::Named(Named::ArrowLeft), PaneFocusLeft);
+ bind!([Ctrl, Shift], Key::Character("H".into()), PaneFocusLeft);
+ bind!([Ctrl, Shift], Key::Named(Named::ArrowDown), PaneFocusDown);
+ bind!([Ctrl, Shift], Key::Character("J".into()), PaneFocusDown);
+ bind!([Ctrl, Shift], Key::Named(Named::ArrowUp), PaneFocusUp);
+ bind!([Ctrl, Shift], Key::Character("K".into()), PaneFocusUp);
+ bind!([Ctrl, Shift], Key::Named(Named::ArrowRight), PaneFocusRight);
+ bind!([Ctrl, Shift], Key::Character("L".into()), PaneFocusRight);
key_binds
}
diff --git a/src/main.rs b/src/main.rs
index 37cc93e..1f6576a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,32 +6,32 @@ use alacritty_terminal::{
};
use cosmic::{
app::{message, Command, Core, Settings},
- cosmic_config::{self, CosmicConfigEntry},
+ cosmic_config::{self, ConfigSet, CosmicConfigEntry},
cosmic_theme, executor,
iced::{
advanced::graphics::text::font_system,
clipboard, event,
futures::SinkExt,
- keyboard::{Event as KeyEvent, KeyCode, Modifiers},
+ keyboard::{Event as KeyEvent, Key, Modifiers},
mouse::{Button as MouseButton, Event as MouseEvent},
subscription::{self, Subscription},
window, Alignment, Color, Event, Length, Limits, Padding, Point,
},
style,
- widget::{self, button, container, pane_grid, segmented_button, PaneGrid},
+ widget::{self, button, pane_grid, segmented_button, PaneGrid},
Application, ApplicationExt, Element,
};
use cosmic_text::{fontdb::FaceInfo, Family, Stretch, Weight};
use std::{
any::TypeId,
+ cmp,
collections::{BTreeMap, BTreeSet, HashMap},
env, process,
sync::{atomic::Ordering, Mutex},
- time::Duration,
};
use tokio::sync::mpsc;
-use config::{AppTheme, Config, CONFIG_VERSION};
+use config::{AppTheme, Config, Profile, ProfileId, CONFIG_VERSION};
mod config;
mod mouse_reporter;
@@ -120,8 +120,10 @@ fn main() -> Result<(), Box> {
}
let startup_options = if let Some(shell_program) = shell_program_opt {
- let mut options = tty::Options::default();
- options.shell = Some(tty::Shell::new(shell_program, shell_args));
+ let options = tty::Options {
+ shell: Some(tty::Shell::new(shell_program, shell_args)),
+ ..tty::Options::default()
+ };
Some(options)
} else {
None
@@ -177,6 +179,8 @@ pub enum Action {
PaneToggleMaximized,
Paste,
PastePrimary,
+ ProfileOpen(ProfileId),
+ Profiles,
SelectAll,
Settings,
ShowHeaderBar(bool),
@@ -215,6 +219,8 @@ impl Action {
Action::PaneToggleMaximized => Message::PaneToggleMaximized,
Action::Paste => Message::Paste(entity_opt),
Action::PastePrimary => Message::PastePrimary(entity_opt),
+ Action::ProfileOpen(profile_id) => Message::ProfileOpen(profile_id),
+ Action::Profiles => Message::ToggleContextPage(ContextPage::Profiles),
Action::SelectAll => Message::SelectAll(entity_opt),
Action::Settings => Message::ToggleContextPage(ContextPage::Settings),
Action::ShowHeaderBar(show_headerbar) => Message::ShowHeaderBar(show_headerbar),
@@ -254,7 +260,7 @@ pub enum Message {
DefaultDimFontWeight(usize),
DefaultBoldFontWeight(usize),
DefaultZoomStep(usize),
- Key(Modifiers, KeyCode),
+ Key(Modifiers, Key),
Find(bool),
FindNext,
FindPrevious,
@@ -268,9 +274,19 @@ pub enum Message {
PaneResized(pane_grid::ResizeEvent),
Modifiers(Modifiers),
MouseEnter(pane_grid::Pane),
+ Opacity(u8),
Paste(Option),
PastePrimary(Option),
PasteValue(Option, String),
+ ProfileCollapse(ProfileId),
+ ProfileCommand(ProfileId, String),
+ ProfileExpand(ProfileId),
+ ProfileName(ProfileId, String),
+ ProfileNew,
+ ProfileOpen(ProfileId),
+ ProfileRemove(ProfileId),
+ ProfileSyntaxTheme(ProfileId, usize, bool),
+ ProfileTabTitle(ProfileId, String),
SelectAll(Option),
UseBrightBold(bool),
ShowHeaderBar(bool),
@@ -280,7 +296,7 @@ pub enum Message {
TabActivateJump(usize),
TabClose(Option),
TabContextAction(segmented_button::Entity, Action),
- TabContextMenu(segmented_button::Entity, Option),
+ TabContextMenu(pane_grid::Pane, Option),
TabNew,
TabPrev,
TabNext,
@@ -298,12 +314,14 @@ pub enum Message {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ContextPage {
+ Profiles,
Settings,
}
impl ContextPage {
fn title(&self) -> String {
match self {
+ Self::Profiles => fl!("profiles"),
Self::Settings => fl!("settings"),
}
}
@@ -340,17 +358,29 @@ pub struct App {
term_event_tx_opt: Option>,
startup_options: Option,
term_config: TermConfig,
+ profile_expanded: Option,
show_advanced_font_settings: bool,
modifiers: Modifiers,
}
impl App {
fn update_config(&mut self) -> Command {
- //TODO: provide iterator over data
- let panes: Vec<_> = self.pane_model.panes.iter().collect();
- for (_pane, tab_model) in panes {
- let entities: Vec<_> = tab_model.iter().collect();
- for entity in entities {
+ let theme = self.config.app_theme.theme();
+
+ // Update terminal window background color
+ {
+ let color = Color::from(theme.cosmic().background.base);
+ let bytes = color.into_rgba8();
+ let data = (bytes[2] as u32)
+ | ((bytes[1] as u32) << 8)
+ | ((bytes[0] as u32) << 16)
+ | 0xFF000000;
+ terminal::WINDOW_BG_COLOR.store(data, Ordering::SeqCst);
+ }
+
+ // Set config of all tabs
+ for (_pane, tab_model) in self.pane_model.panes.iter() {
+ for entity in tab_model.iter() {
if let Some(terminal) = tab_model.data::>(entity) {
let mut terminal = terminal.lock().unwrap();
terminal.set_config(&self.config, &self.themes, self.zoom_adj);
@@ -358,27 +388,40 @@ impl App {
}
}
+ // Set headerbar state
self.core.window.show_headerbar = self.config.show_headerbar;
- cosmic::app::command::set_theme(self.config.app_theme.theme())
+
+ // Update application theme
+ cosmic::app::command::set_theme(theme)
}
fn save_config(&mut self) -> Command {
- match self.config_handler {
- Some(ref config_handler) => match self.config.write_entry(&config_handler) {
+ if let Some(ref config_handler) = self.config_handler {
+ match self.config.write_entry(config_handler) {
Ok(()) => {}
Err(err) => {
log::error!("failed to save config: {}", err);
}
- },
- None => {}
+ }
}
self.update_config()
}
+ fn save_profiles(&mut self) -> Command {
+ // Optimized for just saving profiles
+ if let Some(ref config_handler) = self.config_handler {
+ match config_handler.set("profiles", &self.config.profiles) {
+ Ok(()) => {}
+ Err(err) => {
+ log::error!("failed to save config: {}", err);
+ }
+ }
+ }
+ Command::none()
+ }
+
fn update_focus(&self) -> Command {
- if self.core.window.show_context {
- Command::none()
- } else if self.find {
+ if self.find {
widget::text_input::focus(self.find_search_id.clone())
} else if let Some(terminal_id) = self.terminal_ids.get(&self.pane_model.focus).cloned() {
widget::text_input::focus(terminal_id)
@@ -486,6 +529,146 @@ impl App {
}
}
+ fn profiles(&self) -> Element {
+ let cosmic_theme::Spacing {
+ space_s,
+ space_xs,
+ space_xxs,
+ space_xxxs,
+ ..
+ } = self.core().system_theme().cosmic().spacing;
+
+ let mut sections = Vec::with_capacity(2);
+
+ if !self.config.profiles.is_empty() {
+ let mut profiles_section = widget::settings::view_section("");
+ for (profile_name, profile_id) in self.config.profile_names() {
+ let profile = match self.config.profiles.get(&profile_id) {
+ Some(some) => some,
+ None => continue,
+ };
+
+ let expanded = self.profile_expanded == Some(profile_id);
+
+ profiles_section = profiles_section.add(
+ widget::settings::item::builder(profile_name).control(
+ widget::row::with_children(vec![
+ widget::button(icon_cache_get("edit-delete-symbolic", 16))
+ .on_press(Message::ProfileRemove(profile_id))
+ .style(style::Button::Icon)
+ .into(),
+ if expanded {
+ widget::button(icon_cache_get("go-up-symbolic", 16))
+ .on_press(Message::ProfileCollapse(profile_id))
+ } else {
+ widget::button(icon_cache_get("go-down-symbolic", 16))
+ .on_press(Message::ProfileExpand(profile_id))
+ }
+ .style(style::Button::Icon)
+ .into(),
+ ])
+ .align_items(Alignment::Center)
+ .spacing(space_xxs),
+ ),
+ );
+
+ if expanded {
+ let dark_selected = self
+ .theme_names
+ .iter()
+ .position(|theme_name| theme_name == &profile.syntax_theme_dark);
+ let light_selected = self
+ .theme_names
+ .iter()
+ .position(|theme_name| theme_name == &profile.syntax_theme_light);
+
+ let expanded_section = widget::settings::view_section("")
+ .add(
+ widget::column::with_children(vec![
+ widget::column::with_children(vec![
+ widget::text(fl!("name")).into(),
+ widget::text_input("", &profile.name)
+ .on_input(move |text| {
+ Message::ProfileName(profile_id, text)
+ })
+ .into(),
+ ])
+ .spacing(space_xxxs)
+ .into(),
+ widget::column::with_children(vec![
+ widget::text(fl!("command-line")).into(),
+ widget::text_input("", &profile.command)
+ .on_input(move |text| {
+ Message::ProfileCommand(profile_id, text)
+ })
+ .into(),
+ ])
+ .spacing(space_xxxs)
+ .into(),
+ widget::column::with_children(vec![
+ widget::text(fl!("tab-title")).into(),
+ widget::text_input("", &profile.tab_title)
+ .on_input(move |text| {
+ Message::ProfileTabTitle(profile_id, text)
+ })
+ .into(),
+ widget::text::caption(fl!("tab-title-description")).into(),
+ ])
+ .spacing(space_xxxs)
+ .into(),
+ ])
+ .padding([0, space_s])
+ .spacing(space_xs),
+ )
+ .add(
+ //TODO: rename to color-scheme-dark?
+ widget::settings::item::builder(fl!("syntax-dark")).control(
+ widget::dropdown(
+ &self.theme_names,
+ dark_selected,
+ move |theme_i| {
+ Message::ProfileSyntaxTheme(profile_id, theme_i, true)
+ },
+ ),
+ ),
+ )
+ .add(
+ //TODO: rename to color-scheme-light?
+ widget::settings::item::builder(fl!("syntax-light")).control(
+ widget::dropdown(
+ &self.theme_names,
+ light_selected,
+ move |theme_i| {
+ Message::ProfileSyntaxTheme(profile_id, theme_i, false)
+ },
+ ),
+ ),
+ );
+
+ let padding = Padding {
+ top: 0.0,
+ bottom: 0.0,
+ left: space_s as f32,
+ right: space_s as f32,
+ };
+ profiles_section =
+ profiles_section.add(widget::container(expanded_section).padding(padding))
+ }
+ }
+ sections.push(profiles_section.into());
+ }
+
+ let add_profile = widget::row::with_children(vec![
+ widget::horizontal_space(Length::Fill).into(),
+ widget::button(widget::text(fl!("add-profile")))
+ .on_press(Message::ProfileNew)
+ .into(),
+ ]);
+ sections.push(add_profile.into());
+
+ widget::settings::view_column(sections).into()
+ }
+
fn settings(&self) -> Element {
let app_theme_selected = match self.config.app_theme {
AppTheme::Dark => 1,
@@ -568,15 +751,21 @@ impl App {
Message::DefaultZoomStep(index)
}),
),
+ )
+ .add(
+ widget::settings::item::builder(fl!("opacity"))
+ .description(format!("{}%", self.config.opacity))
+ .control(widget::slider(0..=100, self.config.opacity, |opacity| {
+ Message::Opacity(opacity)
+ })),
);
- //TODO: background opacity
let mut font_section = widget::settings::view_section(fl!("font"))
.add(
widget::settings::item::builder(fl!("default-font")).control(widget::dropdown(
&self.font_names,
font_selected,
- |index| Message::DefaultFont(index),
+ Message::DefaultFont,
)),
)
.add(
@@ -600,7 +789,7 @@ impl App {
widget::dropdown(
&self.curr_font_stretch_names,
font_stretch_selected,
- |index| Message::DefaultFontStretch(index),
+ Message::DefaultFontStretch,
),
),
)
@@ -609,7 +798,7 @@ impl App {
widget::dropdown(
&self.curr_font_weight_names,
font_weight_selected,
- |index| Message::DefaultFontWeight(index),
+ Message::DefaultFontWeight,
),
),
)
@@ -618,7 +807,7 @@ impl App {
widget::dropdown(
&self.curr_font_weight_names,
dim_font_weight_selected,
- |index| Message::DefaultDimFontWeight(index),
+ Message::DefaultDimFontWeight,
),
),
)
@@ -627,7 +816,7 @@ impl App {
widget::dropdown(
&self.curr_font_weight_names,
bold_font_weight_selected,
- |index| Message::DefaultBoldFontWeight(index),
+ Message::DefaultBoldFontWeight,
),
),
)
@@ -668,48 +857,97 @@ impl App {
.into()
}
- fn create_and_focus_new_terminal(&mut self, pane: pane_grid::Pane) {
+ fn create_and_focus_new_terminal(
+ &mut self,
+ pane: pane_grid::Pane,
+ profile_id_opt: Option,
+ ) -> Command {
self.pane_model.focus = pane;
match &self.term_event_tx_opt {
- Some(term_event_tx) => match self.themes.get(self.config.syntax_theme()) {
- Some(colors) => {
- let current_pane = self.pane_model.focus;
- if let Some(tab_model) = self.pane_model.active_mut() {
- let entity = tab_model
- .insert()
- .text("New Terminal")
- .closable()
- .activate()
- .id();
- // Use the startup options, or defaults
- let options = self.startup_options.take().unwrap_or_default();
- let mut terminal = Terminal::new(
- current_pane,
- entity,
- term_event_tx.clone(),
- self.term_config.clone(),
- options,
- &self.config,
- *colors,
+ Some(term_event_tx) => {
+ 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() {
+ // Use the profile options, startup options, or defaults
+ let (options, tab_title_override) = match profile_id_opt
+ .and_then(|profile_id| self.config.profiles.get(&profile_id))
+ {
+ Some(profile) => {
+ if !profile.tab_title.is_empty() {}
+ let mut shell = None;
+ if let Some(mut args) = shlex::split(&profile.command) {
+ if !args.is_empty() {
+ let command = args.remove(0);
+ shell = Some(tty::Shell::new(command, args));
+ }
+ }
+ let options = tty::Options {
+ shell,
+ //TODO: configurable working directory?
+ working_directory: None,
+ //TODO: configurable hold (keep open when child exits)?
+ hold: false,
+ };
+ let tab_title_override = if !profile.tab_title.is_empty() {
+ Some(profile.tab_title.clone())
+ } else {
+ None
+ };
+ (options, tab_title_override)
+ }
+ None => (self.startup_options.take().unwrap_or_default(), None),
+ };
+ let entity = tab_model
+ .insert()
+ .text(
+ tab_title_override
+ .clone()
+ .unwrap_or_else(|| fl!("new-terminal")),
+ )
+ .closable()
+ .activate()
+ .id();
+ match Terminal::new(
+ current_pane,
+ entity,
+ term_event_tx.clone(),
+ self.term_config.clone(),
+ options,
+ &self.config,
+ *colors,
+ profile_id_opt,
+ tab_title_override,
+ ) {
+ Ok(mut terminal) => {
+ terminal.set_config(&self.config, &self.themes, self.zoom_adj);
+ tab_model
+ .data_set::>(entity, Mutex::new(terminal));
+ }
+ Err(err) => {
+ log::error!("failed to open terminal: {}", err);
+ // Clean up partially created tab
+ return self.update(Message::TabClose(Some(entity)));
+ }
+ }
+ } else {
+ log::error!("Found no active pane");
+ }
+ }
+ None => {
+ log::error!(
+ "failed to find terminal theme {:?}",
+ self.config.syntax_theme(profile_id_opt)
);
- terminal.set_config(&self.config, &self.themes, self.zoom_adj);
- tab_model.data_set::>(entity, Mutex::new(terminal));
- } else {
- log::error!("Found no active pane");
+ //TODO: fall back to known good theme
}
}
- None => {
- log::error!(
- "failed to find terminal theme {:?}",
- self.config.syntax_theme()
- );
- //TODO: fall back to known good theme
- }
- },
+ }
None => {
log::warn!("tried to create new tab before having event channel");
}
}
+ return self.update_title(Some(pane));
}
}
@@ -762,7 +1000,7 @@ impl Application for App {
//TODO: get localized name if possible
let font_name = face
.families
- .get(0)
+ .first()
.map_or_else(|| face.post_script_name.to_string(), |x| x.0.to_string());
font_name_faces_map
.entry(font_name)
@@ -838,7 +1076,7 @@ impl Application for App {
}
let themes = terminal_theme::terminal_themes();
- let mut theme_names: Vec<_> = themes.keys().map(|x| x.clone()).collect();
+ 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();
@@ -874,12 +1112,13 @@ impl Application for App {
startup_options: flags.startup_options,
term_config: flags.term_config,
term_event_tx_opt: None,
+ profile_expanded: None,
show_advanced_font_settings: false,
modifiers: Modifiers::empty(),
};
app.set_curr_font_weights_and_stretches();
- let command = app.update_title(None);
+ let command = Command::batch([app.update_config(), app.update_title(None)]);
(app, command)
}
@@ -892,6 +1131,7 @@ impl Application for App {
} else if self.find {
// Close find if open
self.find = false;
+ self.find_search_value.clear();
}
// Focus correct widget
@@ -908,6 +1148,33 @@ impl Application for App {
/// Handle application events here.
fn update(&mut self, message: Self::Message) -> Command {
+ // Helper for updating config values efficiently
+ macro_rules! config_set {
+ ($name: ident, $value: expr) => {
+ match &self.config_handler {
+ Some(config_handler) => {
+ match paste::paste! { self.config.[](config_handler, $value) } {
+ Ok(_) => {}
+ Err(err) => {
+ log::warn!(
+ "failed to save config {:?}: {}",
+ stringify!($name),
+ err
+ );
+ }
+ }
+ }
+ None => {
+ self.config.$name = $value;
+ log::warn!(
+ "failed to save config {:?}: no config handler",
+ stringify!($name)
+ );
+ }
+ }
+ };
+ }
+
match message {
Message::AppTheme(app_theme) => {
self.config.app_theme = app_theme;
@@ -928,12 +1195,13 @@ impl Application for App {
let terminal = terminal.lock().unwrap();
let term = terminal.term.lock();
if let Some(text) = term.selection_to_string() {
- return clipboard::write(text);
+ return Command::batch([clipboard::write(text), self.update_focus()]);
}
}
} else {
log::warn!("Failed to get focused pane");
}
+ return self.update_focus();
}
Message::CopyPrimary(entity_opt) => {
if let Some(tab_model) = self.pane_model.active() {
@@ -1039,15 +1307,31 @@ impl Application for App {
log::warn!("failed to find zoom step with index {}", index);
}
},
- Message::Key(modifiers, key_code) => {
+ Message::Key(modifiers, key) => {
for (key_bind, action) in self.key_binds.iter() {
- if key_bind.matches(modifiers, key_code) {
+ if key_bind.matches(modifiers, &key) {
return self.update(action.message(None));
}
}
}
Message::Find(find) => {
self.find = find;
+ if find {
+ if let Some(tab_model) = self.pane_model.active() {
+ let entity = tab_model.active();
+ if let Some(terminal) = tab_model.data::>(entity) {
+ let terminal = terminal.lock().unwrap();
+ let term = terminal.term.lock();
+ if let Some(text) = term.selection_to_string() {
+ self.find_search_value = text;
+ }
+ }
+ } else {
+ log::warn!("Failed to get focused pane");
+ }
+ } else {
+ self.find_search_value.clear();
+ }
// Focus correct input
return self.update_focus();
@@ -1100,6 +1384,9 @@ impl Application for App {
self.pane_model.focus = pane;
return self.update_focus();
}
+ Message::Opacity(opacity) => {
+ config_set!(opacity, cmp::min(100, opacity));
+ }
Message::PaneClicked(pane) => {
self.pane_model.focus = pane;
return self.update_title(Some(pane));
@@ -1112,9 +1399,9 @@ impl Application for App {
);
if let Some((pane, _)) = result {
self.terminal_ids.insert(pane, widget::Id::unique());
- self.create_and_focus_new_terminal(pane);
+ let command = self.create_and_focus_new_terminal(pane, None);
self.pane_model.panes_created += 1;
- return self.update_title(Some(pane));
+ return command;
}
}
Message::PaneToggleMaximized => {
@@ -1162,6 +1449,78 @@ impl Application for App {
terminal.paste(value);
}
}
+ return self.update_focus();
+ }
+ Message::ProfileCollapse(_profile_id) => {
+ self.profile_expanded = None;
+ }
+ Message::ProfileCommand(profile_id, text) => {
+ if let Some(profile) = self.config.profiles.get_mut(&profile_id) {
+ profile.command = text;
+ return self.save_profiles();
+ }
+ }
+ Message::ProfileExpand(profile_id) => {
+ self.profile_expanded = Some(profile_id);
+ }
+ Message::ProfileName(profile_id, text) => {
+ if let Some(profile) = self.config.profiles.get_mut(&profile_id) {
+ profile.name = text;
+ return self.save_profiles();
+ }
+ }
+ Message::ProfileNew => {
+ // Get next profile ID
+ let profile_id = self
+ .config
+ .profiles
+ .last_key_value()
+ .map(|(id, _)| ProfileId(id.0 + 1))
+ .unwrap_or_default();
+ self.config.profiles.insert(profile_id, Profile::default());
+ self.profile_expanded = Some(profile_id);
+ return self.save_profiles();
+ }
+ Message::ProfileOpen(profile_id) => {
+ return self.create_and_focus_new_terminal(self.pane_model.focus, Some(profile_id));
+ }
+ Message::ProfileRemove(profile_id) => {
+ // Reset matching terminals to default profile
+ for (_pane, tab_model) in self.pane_model.panes.iter() {
+ for entity in tab_model.iter() {
+ if let Some(terminal) = tab_model.data::>(entity) {
+ let mut terminal = terminal.lock().unwrap();
+ if terminal.profile_id_opt == Some(profile_id) {
+ terminal.profile_id_opt = None;
+ }
+ }
+ }
+ }
+ self.config.profiles.remove(&profile_id);
+ return self.save_profiles();
+ }
+ Message::ProfileSyntaxTheme(profile_id, theme_i, dark) => {
+ match self.theme_names.get(theme_i) {
+ 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();
+ }
+ return self.save_profiles();
+ }
+ }
+ None => {
+ log::warn!("failed to find syntax theme with index {}", theme_i);
+ }
+ }
+ }
+ Message::ProfileTabTitle(profile_id, text) => {
+ if let Some(profile) = self.config.profiles.get_mut(&profile_id) {
+ profile.tab_title = text;
+ return self.save_profiles();
+ }
}
Message::SelectAll(entity_opt) => {
if let Some(tab_model) = self.pane_model.active() {
@@ -1171,6 +1530,7 @@ impl Application for App {
terminal.select_all();
}
}
+ return self.update_focus();
}
Message::ShowHeaderBar(show_headerbar) => {
if show_headerbar != self.config.show_headerbar {
@@ -1185,10 +1545,7 @@ impl Application for App {
}
}
Message::FocusFollowMouse(focus_follow_mouse) => {
- if focus_follow_mouse != self.config.focus_follow_mouse {
- self.config.focus_follow_mouse = focus_follow_mouse;
- return self.save_config();
- }
+ config_set!(focus_follow_mouse, focus_follow_mouse);
}
Message::SystemThemeChange => {
return self.update_config();
@@ -1263,33 +1620,46 @@ impl Application for App {
}
Message::TabContextAction(entity, action) => {
if let Some(tab_model) = self.pane_model.active() {
- match tab_model.data::>(entity) {
- Some(terminal) => {
- // Close context menu
- {
- let mut terminal = terminal.lock().unwrap();
- terminal.context_menu = None;
- }
- // Run action's message
- return self.update(action.message(Some(entity)));
- }
- _ => {}
- }
- }
- }
- Message::TabContextMenu(entity, position_opt) => {
- if let Some(tab_model) = self.pane_model.active() {
- match tab_model.data::>(entity) {
- Some(terminal) => {
- // Update context menu position
+ if let Some(terminal) = tab_model.data::>(entity) {
+ // Close context menu
+ {
let mut terminal = terminal.lock().unwrap();
- terminal.context_menu = position_opt;
+ terminal.context_menu = None;
}
- _ => {}
+ // Run action's message
+ return self.update(action.message(Some(entity)));
}
}
}
- Message::TabNew => self.create_and_focus_new_terminal(self.pane_model.focus),
+ Message::TabContextMenu(pane, position_opt) => {
+ // Close any existing context menues
+ let panes: Vec<_> = self.pane_model.panes.iter().collect();
+ for (_pane, tab_model) in panes {
+ let entity = tab_model.active();
+ if let Some(terminal) = tab_model.data::>(entity) {
+ let mut terminal = terminal.lock().unwrap();
+ terminal.context_menu = None;
+ }
+ }
+
+ // Show the context menu on the correct pane / terminal
+ if let Some(tab_model) = self.pane_model.panes.get(pane) {
+ let entity = tab_model.active();
+ if let Some(terminal) = tab_model.data::>(entity) {
+ // Update context menu position
+ let mut terminal = terminal.lock().unwrap();
+ terminal.context_menu = position_opt;
+ }
+ }
+
+ // Shift focus to the pane / terminal
+ // with the context menu
+ self.pane_model.focus = pane;
+ return self.update_title(Some(pane));
+ }
+ Message::TabNew => {
+ return self.create_and_focus_new_terminal(self.pane_model.focus, None)
+ }
Message::TabNext => {
if let Some(tab_model) = self.pane_model.active() {
let len = tab_model.iter().count();
@@ -1348,7 +1718,17 @@ impl Application for App {
}
TermEvent::ResetTitle => {
if let Some(tab_model) = self.pane_model.panes.get_mut(pane) {
- tab_model.text_set(entity, "New Terminal");
+ let tab_title_override =
+ if let Some(terminal) = tab_model.data::>(entity) {
+ let terminal = terminal.lock().unwrap();
+ terminal.tab_title_override.clone()
+ } else {
+ None
+ };
+ tab_model.text_set(
+ entity,
+ tab_title_override.unwrap_or_else(|| fl!("new-terminal")),
+ );
}
return self.update_title(Some(pane));
}
@@ -1363,7 +1743,16 @@ impl Application for App {
}
TermEvent::Title(title) => {
if let Some(tab_model) = self.pane_model.panes.get_mut(pane) {
- tab_model.text_set(entity, title);
+ let has_override =
+ if let Some(terminal) = tab_model.data::>(entity) {
+ let terminal = terminal.lock().unwrap();
+ terminal.tab_title_override.is_some()
+ } else {
+ false
+ };
+ if !has_override {
+ tab_model.text_set(entity, title);
+ }
}
return self.update_title(Some(pane));
}
@@ -1381,7 +1770,33 @@ impl Application for App {
}
}
Message::TermEventTx(term_event_tx) => {
+ // Check if the terminal event channel was reset
+ if self.term_event_tx_opt.is_some() {
+ // Close tabs using old terminal event channel
+ log::warn!("terminal event channel reset, closing tabs");
+
+ // First, close other panes
+ while let Some((_state, sibling)) =
+ self.pane_model.panes.close(self.pane_model.focus)
+ {
+ self.terminal_ids.remove(&self.pane_model.focus);
+ self.pane_model.focus = sibling;
+ }
+
+ // Next, close all tabs in the active pane
+ if let Some(tab_model) = self.pane_model.active_mut() {
+ let entities: Vec<_> = tab_model.iter().collect();
+ for entity in entities {
+ tab_model.remove(entity);
+ }
+ }
+ }
+
+ // Set new terminal event channel
self.term_event_tx_opt = Some(term_event_tx);
+
+ // Spawn first tab
+ return self.update(Message::TabNew);
}
Message::ToggleContextPage(context_page) => {
if self.context_page == context_page {
@@ -1432,17 +1847,18 @@ impl Application for App {
}
Some(match self.context_page {
+ ContextPage::Profiles => self.profiles(),
ContextPage::Settings => self.settings(),
})
}
fn header_start(&self) -> Vec> {
- vec![menu_bar(&self.key_binds).into()]
+ vec![menu_bar(&self.config, &self.key_binds)]
}
fn header_end(&self) -> Vec> {
let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
- vec![widget::button(widget::icon::from_name("list-add-symbolic"))
+ vec![widget::button(icon_cache_get("list-add-symbolic", 16))
.on_press(Message::TabNew)
.padding(space_xxs)
.style(style::Button::Icon)
@@ -1451,17 +1867,8 @@ impl Application for App {
/// Creates a view after each update.
fn view(&self) -> Element {
- let cosmic_theme = self.core().system_theme().cosmic();
- let cosmic_theme::Spacing { space_xxs, .. } = cosmic_theme.spacing;
- {
- let color = Color::from(cosmic_theme.bg_color());
- let bytes = color.into_rgba8();
- let data = (bytes[2] as u32)
- | ((bytes[1] as u32) << 8)
- | ((bytes[0] as u32) << 16)
- | 0xFF000000;
- terminal::WINDOW_BG_COLOR.store(data, Ordering::SeqCst);
- }
+ let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
+
let pane_grid = PaneGrid::new(&self.pane_model.panes, |pane, tab_model, _is_maximized| {
let mut tab_column = widget::column::with_capacity(1);
@@ -1491,11 +1898,13 @@ impl Application for App {
let mut terminal_box = terminal_box(terminal)
.id(terminal_id)
.on_context_menu(move |position_opt| {
- Message::TabContextMenu(entity, position_opt)
+ Message::TabContextMenu(pane, position_opt)
})
.on_middle_click(move || {
Message::MiddleClick(pane, Some(entity_middle_click))
- });
+ })
+ .opacity(self.config.opacity_ratio())
+ .padding(space_xxs);
if self.config.focus_follow_mouse {
terminal_box =
@@ -1523,7 +1932,8 @@ impl Application for App {
}
}
- if self.find {
+ //Only draw find in the currently focused pane
+ if self.find && pane == self.pane_model.focus {
let find_input = widget::text_input::text_input(
fl!("find-placeholder"),
&self.find_search_value,
@@ -1585,17 +1995,12 @@ impl Application for App {
})
.width(Length::Fill)
.height(Length::Fill)
- .spacing(space_xxs)
.on_click(Message::PaneClicked)
.on_resize(space_xxs, Message::PaneResized)
.on_drag(Message::PaneDragged);
- container(pane_grid)
- .width(Length::Fill)
- .height(Length::Fill)
- .padding(space_xxs)
- .style(style::Container::Background)
- .into()
+ //TODO: apply window border radius xs at bottom of window
+ pane_grid.into()
}
fn subscription(&self) -> Subscription {
@@ -1606,10 +2011,9 @@ impl Application for App {
Subscription::batch([
event::listen_with(|event, _status| match event {
- Event::Keyboard(KeyEvent::KeyPressed {
- key_code,
- modifiers,
- }) => Some(Message::Key(modifiers, key_code)),
+ Event::Keyboard(KeyEvent::KeyPressed { key, modifiers, .. }) => {
+ Some(Message::Key(modifiers, key))
+ }
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
Some(Message::Modifiers(modifiers))
}
@@ -1625,12 +2029,6 @@ impl Application for App {
let (event_tx, mut event_rx) = mpsc::channel(100);
output.send(Message::TermEventTx(event_tx)).await.unwrap();
- // Avoid creating two tabs at startup
- tokio::time::sleep(Duration::from_millis(50)).await;
-
- // Create first terminal tab
- output.send(Message::TabNew).await.unwrap();
-
while let Some((pane, entity, event)) = event_rx.recv().await {
output
.send(Message::TermEvent(pane, entity, event))
diff --git a/src/menu.rs b/src/menu.rs
index 012682c..6aed4dd 100644
--- a/src/menu.rs
+++ b/src/menu.rs
@@ -6,6 +6,7 @@ use cosmic::{
widget::{column, horizontal_rule, horizontal_space},
Alignment, Background, Length,
},
+ iced_core::Border,
theme,
widget::{
self,
@@ -95,16 +96,19 @@ pub fn context_menu<'a>(
icon_color: Some(component.on.into()),
text_color: Some(component.on.into()),
background: Some(Background::Color(component.base.into())),
- border_radius: 8.0.into(),
- border_width: 1.0,
- border_color: component.divider.into(),
+ border: Border {
+ radius: 8.0.into(),
+ width: 1.0,
+ color: component.divider.into(),
+ },
+ ..Default::default()
}
}))
.width(Length::Fixed(240.0))
.into()
}
-pub fn menu_bar<'a>(key_binds: &HashMap) -> Element<'a, Message> {
+pub fn menu_bar<'a>(config: &Config, key_binds: &HashMap) -> Element<'a, Message> {
//TODO: port to libcosmic
let menu_root = |label| {
widget::button(widget::text(label))
@@ -112,6 +116,9 @@ pub fn menu_bar<'a>(key_binds: &HashMap) -> Element<'a, Message
.style(theme::Button::MenuRoot)
};
+ let menu_folder =
+ |label| menu_button!(widget::text(label), horizontal_space(Length::Fill), ">");
+
let find_key = |action: &Action| -> String {
for (key_bind, key_action) in key_binds.iter() {
if action == key_action {
@@ -133,6 +140,12 @@ pub fn menu_bar<'a>(key_binds: &HashMap) -> Element<'a, Message
)
};
+ let mut profile_items = Vec::with_capacity(config.profiles.len());
+ for (name, id) in config.profile_names() {
+ profile_items.push(menu_item(name, Action::ProfileOpen(id)));
+ }
+ //TODO: what to do if there are no profiles?
+
MenuBar::new(vec![
MenuTree::with_children(
menu_root(fl!("file")),
@@ -140,6 +153,9 @@ pub fn menu_bar<'a>(key_binds: &HashMap) -> Element<'a, Message
menu_item(fl!("new-tab"), Action::TabNew),
menu_item(fl!("new-window"), Action::WindowNew),
MenuTree::new(horizontal_rule(1)),
+ MenuTree::with_children(menu_folder(fl!("profile")), profile_items),
+ menu_item(fl!("menu-profiles"), Action::Profiles),
+ MenuTree::new(horizontal_rule(1)),
menu_item(fl!("close-tab"), Action::TabClose),
MenuTree::new(horizontal_rule(1)),
menu_item(fl!("quit"), Action::WindowClose),
diff --git a/src/mouse_reporter.rs b/src/mouse_reporter.rs
index d9a339a..e97075b 100644
--- a/src/mouse_reporter.rs
+++ b/src/mouse_reporter.rs
@@ -172,6 +172,7 @@ impl MouseReporter {
}
}
+ #[allow(clippy::too_many_arguments)]
pub fn report_sgr_mouse_wheel_scroll(
&self,
terminal: &Terminal,
diff --git a/src/terminal.rs b/src/terminal.rs
index 36f0e4d..d71e841 100644
--- a/src/terminal.rs
+++ b/src/terminal.rs
@@ -9,7 +9,7 @@ use alacritty_terminal::{
cell::Flags,
color::{self, Colors},
search::RegexSearch,
- viewport_to_point, Config, TermMode,
+ viewport_to_point, Config, TermDamage, TermMode,
},
tty::{self, Options},
vte::ansi::{Color, NamedColor, Rgb},
@@ -27,7 +27,7 @@ use indexmap::IndexSet;
use std::{
borrow::Cow,
collections::HashMap,
- mem,
+ io, mem,
sync::{
atomic::{AtomicU32, Ordering},
Arc, Weak,
@@ -38,7 +38,10 @@ use tokio::sync::mpsc;
pub use alacritty_terminal::grid::Scroll as TerminalScroll;
-use crate::{config::Config as AppConfig, mouse_reporter::MouseReporter};
+use crate::{
+ config::{Config as AppConfig, ProfileId},
+ mouse_reporter::MouseReporter,
+};
#[derive(Clone, Copy, Debug)]
pub struct Size {
@@ -187,21 +190,23 @@ impl Metadata {
}
pub struct Terminal {
- default_attrs: Attrs<'static>,
- buffer: Arc,
- size: Size,
- pub term: Arc>>,
- colors: Colors,
- dim_font_weight: Weight,
- bold_font_weight: Weight,
- use_bright_bold: bool,
- notifier: Notifier,
pub context_menu: Option,
+ pub metadata_set: IndexSet,
pub needs_update: bool,
+ pub profile_id_opt: Option,
+ pub tab_title_override: Option,
+ pub term: Arc>>,
+ bold_font_weight: Weight,
+ buffer: Arc,
+ colors: Colors,
+ default_attrs: Attrs<'static>,
+ dim_font_weight: Weight,
+ mouse_reporter: MouseReporter,
+ notifier: Notifier,
search_regex_opt: Option,
search_value: String,
- pub metadata_set: IndexSet,
- mouse_reporter: MouseReporter,
+ size: Size,
+ use_bright_bold: bool,
}
impl Terminal {
@@ -214,7 +219,9 @@ impl Terminal {
options: Options,
app_config: &AppConfig,
colors: Colors,
- ) -> Self {
+ profile_id_opt: Option,
+ tab_title_override: Option,
+ ) -> Result {
let font_stretch = app_config.typed_font_stretch();
let font_weight = app_config.font_weight;
let dim_font_weight = app_config.dim_font_weight;
@@ -242,12 +249,12 @@ impl Terminal {
let (cell_width, cell_height) = {
let mut font_system = font_system().write().unwrap();
- let mut font_system = font_system.raw();
- buffer.set_wrap(&mut font_system, Wrap::None);
+ let font_system = font_system.raw();
+ buffer.set_wrap(font_system, Wrap::None);
// Use size of space to determine cell size
- buffer.set_text(&mut font_system, " ", default_attrs, Shaping::Advanced);
- let layout = buffer.line_layout(&mut font_system, 0).unwrap();
+ buffer.set_text(font_system, " ", default_attrs, Shaping::Advanced);
+ let layout = buffer.line_layout(font_system, 0).unwrap();
let w = layout[0].w;
buffer.set_monospace_width(font_system, Some(w));
(w, metrics.line_height)
@@ -267,29 +274,31 @@ impl Terminal {
)));
let window_id = 0;
- let pty = tty::new(&options, size.into(), window_id).unwrap();
+ let pty = tty::new(&options, size.into(), window_id)?;
let pty_event_loop = EventLoop::new(term.clone(), event_proxy, pty, options.hold, false);
let notifier = Notifier(pty_event_loop.channel());
let _pty_join_handle = pty_event_loop.spawn();
- Self {
- colors,
- dim_font_weight: Weight(dim_font_weight),
+ Ok(Self {
bold_font_weight: Weight(bold_font_weight),
- use_bright_bold,
- default_attrs,
buffer: Arc::new(buffer),
- size,
- term,
- notifier,
+ colors,
context_menu: None,
- needs_update: true,
- search_regex_opt: None,
- search_value: String::new(),
+ default_attrs,
+ dim_font_weight: Weight(dim_font_weight),
metadata_set,
mouse_reporter: Default::default(),
- }
+ needs_update: true,
+ notifier,
+ profile_id_opt,
+ search_regex_opt: None,
+ search_value: String::new(),
+ size,
+ tab_title_override,
+ term,
+ use_bright_bold,
+ })
}
pub fn buffer_weak(&self) -> Weak {
@@ -371,6 +380,8 @@ impl Terminal {
buffer.set_size(font_system.raw(), width as f32, height as f32);
});
+ self.needs_update = true;
+
log::debug!("resize {:?}", instant.elapsed());
}
}
@@ -459,7 +470,7 @@ impl Terminal {
};
// Find next search match
- match term.search_next(
+ if let Some(search_match) = term.search_next(
search_regex,
search_origin,
if forwards {
@@ -471,21 +482,18 @@ impl Terminal {
if forwards { Side::Left } else { Side::Right },
None,
) {
- Some(search_match) => {
- // Scroll to match
- if forwards {
- term.scroll_to_point(*search_match.end());
- } else {
- term.scroll_to_point(*search_match.start());
- }
-
- // Set selection to match
- let mut selection =
- Selection::new(SelectionType::Simple, *search_match.start(), Side::Left);
- selection.update(*search_match.end(), Side::Right);
- term.selection = Some(selection);
+ // Scroll to match
+ if forwards {
+ term.scroll_to_point(*search_match.end());
+ } else {
+ term.scroll_to_point(*search_match.start());
}
- None => {}
+
+ // Set selection to match
+ let mut selection =
+ Selection::new(SelectionType::Simple, *search_match.start(), Side::Left);
+ selection.update(*search_match.end(), Side::Right);
+ term.selection = Some(selection);
}
}
@@ -551,7 +559,7 @@ impl Terminal {
update_cell_size = true;
}
- if let Some(colors) = themes.get(config.syntax_theme()) {
+ 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] {
@@ -560,19 +568,7 @@ impl Terminal {
}
}
if changed {
- self.metadata_set.clear();
- let default_bg = convert_color(&colors, Color::Named(NamedColor::Background));
- let default_fg = convert_color(&colors, Color::Named(NamedColor::Foreground));
-
- let default_metadata = Metadata::new(default_bg, default_fg);
- let (default_metadata_idx, _) = self.metadata_set.insert_full(default_metadata);
-
- self.default_attrs = Attrs::new()
- .family(Family::Monospace)
- .weight(Weight(config.font_weight))
- .stretch(config.typed_font_stretch())
- .color(default_fg)
- .metadata(default_metadata_idx);
+ self.update_colors(config);
update = true;
}
}
@@ -584,6 +580,22 @@ impl Terminal {
}
}
+ pub fn update_colors(&mut self, config: &AppConfig) {
+ self.metadata_set.clear();
+ let default_bg = convert_color(&self.colors, Color::Named(NamedColor::Background));
+ let default_fg = convert_color(&self.colors, Color::Named(NamedColor::Foreground));
+
+ let default_metadata = Metadata::new(default_bg, default_fg);
+ let (default_metadata_idx, _) = self.metadata_set.insert_full(default_metadata);
+
+ self.default_attrs = Attrs::new()
+ .family(Family::Monospace)
+ .weight(Weight(config.font_weight))
+ .stretch(config.typed_font_stretch())
+ .color(default_fg)
+ .metadata(default_metadata_idx);
+ }
+
pub fn update_cell_size(&mut self) {
let default_attrs = self.default_attrs;
let (cell_width, cell_height) = {
@@ -634,7 +646,14 @@ impl Terminal {
let mut text = String::from(LRI);
let mut attrs_list = AttrsList::new(self.default_attrs);
{
- let term = self.term.lock();
+ let mut term = self.term.lock();
+ //TODO: use damage?
+ match term.damage() {
+ TermDamage::Full => {}
+ TermDamage::Partial(_damage_lines) => {}
+ }
+ term.reset_damage();
+
let grid = term.grid();
for indexed in grid.display_iter() {
if indexed.point.line != last_point.unwrap_or(indexed.point).line {
@@ -647,10 +666,7 @@ impl Terminal {
buffer.set_redraw(true);
}
- // Tab skip/stop is handled by alacritty_terminal
- if buffer.lines[line_i]
- .set_text(text.replace('\t', " "), attrs_list.clone())
- {
+ if buffer.lines[line_i].set_text(text.clone(), attrs_list.clone()) {
buffer.set_redraw(true);
}
line_i += 1;
@@ -668,7 +684,11 @@ impl Terminal {
}
let start = text.len();
- text.push(indexed.cell.c);
+ // Tab skip/stop is handled by alacritty_terminal
+ text.push(match indexed.cell.c {
+ '\t' => ' ',
+ c => c,
+ });
if let Some(zerowidth) = indexed.cell.zerowidth() {
for &c in zerowidth {
text.push(c);
@@ -775,9 +795,11 @@ impl Terminal {
buffer.set_redraw(true);
}
+ // Shape and trim shape run cache
{
let mut font_system = font_system().write().unwrap();
buffer.shape_until_scroll(font_system.raw(), true);
+ font_system.raw().shape_run_cache.trim(1024);
}
}
@@ -800,6 +822,7 @@ impl Terminal {
) {
let term_lock = self.term.lock();
let mode = term_lock.mode();
+ #[allow(clippy::collapsible_else_if)]
if mode.contains(TermMode::SGR_MOUSE) {
if let Some(code) = self.mouse_reporter.sgr_mouse_code(event, modifiers, x, y) {
self.input_no_scroll(code)
@@ -849,6 +872,6 @@ impl Terminal {
impl Drop for Terminal {
fn drop(&mut self) {
// Ensure shutdown on terminal drop
- let _ = self.notifier.0.send(Msg::Shutdown);
+ self.notifier.0.send(Msg::Shutdown);
}
}
diff --git a/src/terminal_box.rs b/src/terminal_box.rs
index 93c34b1..361c793 100644
--- a/src/terminal_box.rs
+++ b/src/terminal_box.rs
@@ -8,14 +8,15 @@ use alacritty_terminal::{
use cosmic::{
cosmic_theme::palette::{blend::Compose, WithAlpha},
iced::{
- advanced::graphics::text::{font_system, Raw},
+ advanced::graphics::text::Raw,
event::{Event, Status},
- keyboard::{Event as KeyEvent, KeyCode, Modifiers},
+ keyboard::{Event as KeyEvent, Key, Modifiers},
mouse::{self, Button, Event as MouseEvent, ScrollDelta},
Color, Element, Length, Padding, Point, Rectangle, Size, Vector,
},
iced_core::{
clipboard::Clipboard,
+ keyboard::key::Named,
layout::{self, Layout},
renderer::{self, Quad, Renderer as _},
text::Renderer as _,
@@ -24,7 +25,7 @@ use cosmic::{
operation::{self, Operation, OperationOutputWrapper},
tree, Id, Widget,
},
- Shell,
+ Border, Shell,
},
theme::Theme,
Renderer,
@@ -34,22 +35,30 @@ use indexmap::IndexSet;
use std::{
cell::Cell,
cmp,
+ collections::HashMap,
sync::Mutex,
time::{Duration, Instant},
};
-use crate::{terminal::Metadata, Terminal, TerminalScroll};
+use crate::{
+ key_bind::{key_binds, KeyBind},
+ terminal::Metadata,
+ Action, Terminal, TerminalScroll,
+};
pub struct TerminalBox<'a, Message> {
terminal: &'a Mutex,
id: Option,
+ border: Border,
padding: Padding,
click_timing: Duration,
context_menu: Option,
on_context_menu: Option) -> Message + 'a>>,
on_mouse_enter: Option Message + 'a>>,
+ opacity: Option,
mouse_inside_boundary: Option,
on_middle_click: Option Message + 'a>>,
+ key_binds: HashMap,
}
impl<'a, Message> TerminalBox<'a, Message>
@@ -60,13 +69,16 @@ where
Self {
terminal,
id: None,
+ border: Border::default(),
padding: Padding::new(0.0),
click_timing: Duration::from_millis(500),
context_menu: None,
on_context_menu: None,
on_mouse_enter: None,
+ opacity: None,
mouse_inside_boundary: None,
on_middle_click: None,
+ key_binds: key_binds(),
}
}
@@ -75,6 +87,11 @@ where
self
}
+ pub fn border>(mut self, border: B) -> Self {
+ self.border = border.into();
+ self
+ }
+
pub fn padding>(mut self, padding: P) -> Self {
self.padding = padding.into();
self
@@ -107,16 +124,21 @@ where
self.on_middle_click = Some(Box::new(on_middle_click));
self
}
+
+ pub fn opacity(mut self, opacity: f32) -> Self {
+ self.opacity = Some(opacity);
+ self
+ }
}
-pub fn terminal_box<'a, Message>(terminal: &'a Mutex) -> TerminalBox<'a, Message>
+pub fn terminal_box(terminal: &Mutex) -> TerminalBox<'_, Message>
where
Message: Clone,
{
TerminalBox::new(terminal)
}
-impl<'a, Message> Widget for TerminalBox<'a, Message>
+impl<'a, Message> Widget for TerminalBox<'a, Message>
where
Message: Clone,
{
@@ -128,12 +150,8 @@ where
tree::State::new(State::new())
}
- fn width(&self) -> Length {
- Length::Fill
- }
-
- fn height(&self) -> Length {
- Length::Fill
+ fn size(&self) -> Size {
+ Size::new(Length::Fill, Length::Fill)
}
fn layout(
@@ -154,12 +172,6 @@ where
terminal.needs_update = false;
}
- // Ensure terminal is shaped
- terminal.with_buffer_mut(|buffer| {
- let mut font_system = font_system().write().unwrap();
- buffer.shape_until_scroll(font_system.raw(), true);
- });
-
// Calculate layout lines
terminal.with_buffer(|buffer| {
let mut layout_lines = 0;
@@ -173,7 +185,7 @@ where
let height = layout_lines as f32 * buffer.metrics().line_height;
let size = Size::new(limits.max().width, height);
- layout::Node::new(limits.resolve(size))
+ layout::Node::new(limits.resolve(Length::Fill, Length::Fill, size))
})
}
@@ -199,9 +211,8 @@ where
) -> mouse::Interaction {
let state = tree.state.downcast_ref::();
- match &state.dragging {
- Some(Dragging::Scrollbar { .. }) => return mouse::Interaction::Idle,
- _ => {}
+ if let Some(Dragging::Scrollbar { .. }) = &state.dragging {
+ return mouse::Interaction::Idle;
}
if let Some(p) = cursor_position.position_in(layout.bounds()) {
@@ -235,8 +246,7 @@ where
let cosmic_theme = theme.cosmic();
let scrollbar_w = cosmic_theme.spacing.space_xxs as f32;
- let view_position =
- layout.position() + [self.padding.left as f32, self.padding.top as f32].into();
+ let view_position = layout.position() + [self.padding.left, self.padding.top].into();
let view_w = cmp::min(viewport.width as i32, layout.bounds().width as i32)
- self.padding.horizontal() as i32
- scrollbar_w as i32;
@@ -259,12 +269,6 @@ where
terminal.needs_update = false;
}
- // Ensure terminal is shaped
- terminal.with_buffer_mut(|buffer| {
- let mut font_system = font_system().write().unwrap();
- buffer.shape_until_scroll(font_system.raw(), true);
- });
-
// Render default background
{
let meta = &terminal.metadata_set[terminal.default_attrs().metadata];
@@ -272,19 +276,18 @@ where
renderer.fill_quad(
Quad {
- bounds: Rectangle::new(
- view_position,
- Size::new(view_w as f32 + scrollbar_w, view_h as f32),
- ),
- border_radius: 0.0.into(),
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
+ bounds: layout.bounds(),
+ border: self.border,
+ ..Default::default()
},
Color::new(
background_color.r() as f32 / 255.0,
background_color.g() as f32 / 255.0,
background_color.b() as f32 / 255.0,
- background_color.a() as f32 / 255.0,
+ match self.opacity {
+ Some(opacity) => opacity,
+ None => background_color.a() as f32 / 255.0,
+ },
),
);
}
@@ -327,10 +330,6 @@ where
renderer: &mut Renderer,
is_focused: bool,
) {
- if self.metadata == self.default_metadata {
- return;
- }
-
let cosmic_text_to_iced_color = |color: cosmic_text::Color| {
Color::new(
color.r() as f32 / 255.0,
@@ -356,9 +355,7 @@ where
self.view_position + $pos_offset,
Size::new($width, $style_line_height),
),
- border_radius: 0.0.into(),
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
+ ..Default::default()
}
};
($pos_offset:expr, $style_line_height:expr) => {
@@ -367,11 +364,13 @@ where
}
let metadata = &self.metadata_set[self.metadata];
- let color = shade(metadata.bg, is_focused);
- renderer.fill_quad(
- mk_quad!(mk_pos_offset!(0.0, self.line_height), self.line_height),
- cosmic_text_to_iced_color(color),
- );
+ if metadata.bg != self.metadata_set[self.default_metadata].bg {
+ let color = shade(metadata.bg, is_focused);
+ renderer.fill_quad(
+ mk_quad!(mk_pos_offset!(0.0, self.line_height), self.line_height),
+ cosmic_text_to_iced_color(color),
+ );
+ }
if !metadata.flags.is_empty() {
let style_line_height =
@@ -462,7 +461,7 @@ where
dot_width = dot_width.min(full_width - accu_width);
let dot_bottom_offset = match accu_width as u32 % 8 {
- 3 | 4 | 5 => bottom_offset + style_line_height,
+ 3..=5 => bottom_offset + style_line_height,
2 | 6 => bottom_offset + 2.0 * style_line_height / 3.0,
1 | 7 => bottom_offset + 1.0 * style_line_height / 3.0,
_ => bottom_offset,
@@ -515,10 +514,7 @@ where
Size::new(scrollbar_w, scrollbar_h),
);
- let pressed = match &state.dragging {
- Some(Dragging::Scrollbar { .. }) => true,
- _ => false,
- };
+ let pressed = matches!(&state.dragging, Some(Dragging::Scrollbar { .. }));
let mut hover = false;
if let Some(p) = cursor_position.position_in(layout.bounds()) {
@@ -568,9 +564,12 @@ where
renderer.fill_quad(
Quad {
bounds: scrollbar_draw,
- border_radius: (scrollbar_draw.width / 2.0).into(),
- border_width: 0.0,
- border_color: Color::TRANSPARENT,
+ border: Border {
+ radius: (scrollbar_draw.width / 2.0).into(),
+ width: 0.0,
+ color: Color::TRANSPARENT,
+ },
+ ..Default::default()
},
scrollbar_color,
);
@@ -606,238 +605,100 @@ where
let mut status = Status::Ignored;
match event {
Event::Keyboard(KeyEvent::KeyPressed {
- key_code,
+ key: Key::Named(named),
modifiers,
- }) if state.is_focused => match (
- modifiers.logo(),
- modifiers.control(),
- modifiers.alt(),
- modifiers.shift(),
- ) {
- (true, _, _, _) => {
- // Ignore super keys
+ ..
+ }) if state.is_focused => {
+ for (key_bind, _) in self.key_binds.iter() {
+ if key_bind.matches(modifiers, &Key::Named(named)) {
+ return Status::Captured;
+ }
}
- (_, true, _, _) => match key_code {
- KeyCode::Up => {
- terminal.input_scroll(b"\x1B[1;5A".as_slice());
+ let mod_no = calculate_modifier_number(state);
+ let escape_code = match named {
+ Named::Insert => csi("2", "~", mod_no),
+ Named::Delete => csi("3", "~", mod_no),
+ Named::PageUp => csi("5", "~", mod_no),
+ Named::PageDown => csi("6", "~", mod_no),
+ Named::ArrowUp => {
+ if is_app_cursor {
+ ss3("A", mod_no)
+ } else {
+ csi("A", "", mod_no)
+ }
+ }
+ Named::ArrowDown => {
+ if is_app_cursor {
+ ss3("B", mod_no)
+ } else {
+ csi("B", "", mod_no)
+ }
+ }
+ Named::ArrowRight => {
+ if is_app_cursor {
+ ss3("C", mod_no)
+ } else {
+ csi("C", "", mod_no)
+ }
+ }
+ Named::ArrowLeft => {
+ if is_app_cursor {
+ ss3("D", mod_no)
+ } else {
+ csi("D", "", mod_no)
+ }
+ }
+ Named::End => {
+ if is_app_cursor {
+ ss3("F", mod_no)
+ } else {
+ csi("F", "", mod_no)
+ }
+ }
+ Named::Home => {
+ if is_app_cursor {
+ ss3("H", mod_no)
+ } else {
+ csi("H", "", mod_no)
+ }
+ }
+ Named::F1 => ss3("P", mod_no),
+ Named::F2 => ss3("Q", mod_no),
+ Named::F3 => ss3("R", mod_no),
+ Named::F4 => ss3("S", mod_no),
+ Named::F5 => csi("15", "~", mod_no),
+ Named::F6 => csi("17", "~", mod_no),
+ Named::F7 => csi("18", "~", mod_no),
+ Named::F8 => csi("19", "~", mod_no),
+ Named::F9 => csi("20", "~", mod_no),
+ Named::F10 => csi("21", "~", mod_no),
+ Named::F11 => csi("23", "~", mod_no),
+ Named::F12 => csi("24", "~", mod_no),
+ _ => None,
+ };
+ if let Some(escape_code) = escape_code {
+ terminal.input_scroll(escape_code);
+ return Status::Captured;
+ }
+
+ //Special handle Enter, Escape, Backspace and Tab as described in
+ //https://sw.kovidgoyal.net/kitty/keyboard-protocol/#legacy-key-event-encoding
+ //Also special handle Ctrl-_ to behave like xterm
+ let alt_prefix = if modifiers.alt() { "\x1B" } else { "" };
+ match named {
+ Named::Backspace => {
+ let code = if modifiers.control() { "\x08" } else { "\x7f" };
+ terminal
+ .input_scroll(format!("{}{}", alt_prefix, code).as_bytes().to_vec());
status = Status::Captured;
}
- KeyCode::Down => {
- terminal.input_scroll(b"\x1B[1;5B".as_slice());
+ Named::Enter => {
+ terminal
+ .input_scroll(format!("{}{}", alt_prefix, "\x0D").as_bytes().to_vec());
status = Status::Captured;
}
- KeyCode::Right => {
- terminal.input_scroll(b"\x1B[1;5C".as_slice());
- status = Status::Captured;
- }
- KeyCode::Left => {
- terminal.input_scroll(b"\x1B[1;5D".as_slice());
- status = Status::Captured;
- }
- KeyCode::End => {
- terminal.input_scroll(b"\x1B[1;5F".as_slice());
- status = Status::Captured;
- }
- KeyCode::Home => {
- terminal.input_scroll(b"\x1B[1;5H".as_slice());
- status = Status::Captured;
- }
- KeyCode::Insert => {
- terminal.input_scroll(b"\x1B[2;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::Delete => {
- terminal.input_scroll(b"\x1B[3;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::PageUp => {
- terminal.input_scroll(b"\x1B[5;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::PageDown => {
- terminal.input_scroll(b"\x1B[6;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F1 => {
- terminal.input_scroll(b"\x1BO;5P".as_slice());
- status = Status::Captured;
- }
- KeyCode::F2 => {
- terminal.input_scroll(b"\x1BO;5Q".as_slice());
- status = Status::Captured;
- }
- KeyCode::F3 => {
- terminal.input_scroll(b"\x1BO;5R".as_slice());
- status = Status::Captured;
- }
- KeyCode::F4 => {
- terminal.input_scroll(b"\x1BO;5S".as_slice());
- status = Status::Captured;
- }
- KeyCode::F5 => {
- terminal.input_scroll(b"\x1B[15;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F6 => {
- terminal.input_scroll(b"\x1B[17;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F7 => {
- terminal.input_scroll(b"\x1B[18;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F8 => {
- terminal.input_scroll(b"\x1B[19;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F9 => {
- terminal.input_scroll(b"\x1B[20;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F10 => {
- terminal.input_scroll(b"\x1B[21;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F11 => {
- terminal.input_scroll(b"\x1B[23;5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F12 => {
- terminal.input_scroll(b"\x1B[24;5~".as_slice());
- status = Status::Captured;
- }
- _ => (),
- },
- // Handle alt keys
- (_, _, true, _) => match key_code {
- KeyCode::Up => {
- terminal.input_scroll(b"\x1B[1;3A".as_slice());
- status = Status::Captured;
- }
- KeyCode::Down => {
- terminal.input_scroll(b"\x1B[1;3B".as_slice());
- status = Status::Captured;
- }
- KeyCode::Right => {
- terminal.input_scroll(b"\x1B[1;3C".as_slice());
- status = Status::Captured;
- }
- KeyCode::Left => {
- terminal.input_scroll(b"\x1B[1;3D".as_slice());
- status = Status::Captured;
- }
- KeyCode::End => {
- terminal.input_scroll(b"\x1B[1;3F".as_slice());
- status = Status::Captured;
- }
- KeyCode::Home => {
- terminal.input_scroll(b"\x1B[1;3H".as_slice());
- status = Status::Captured;
- }
- KeyCode::Insert => {
- terminal.input_scroll(b"\x1B[2;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::Delete => {
- terminal.input_scroll(b"\x1B[3;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::PageUp => {
- terminal.input_scroll(b"\x1B[5;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::PageDown => {
- terminal.input_scroll(b"\x1B[6;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F1 => {
- terminal.input_scroll(b"\x1B[1;3P".as_slice());
- status = Status::Captured;
- }
- KeyCode::F2 => {
- terminal.input_scroll(b"\x1B1;3Q".as_slice());
- status = Status::Captured;
- }
- KeyCode::F3 => {
- terminal.input_scroll(b"\x1B1;3R".as_slice());
- status = Status::Captured;
- }
- KeyCode::F4 => {
- terminal.input_scroll(b"\x1B1;3S".as_slice());
- status = Status::Captured;
- }
- KeyCode::F5 => {
- terminal.input_scroll(b"\x1B[15;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F6 => {
- terminal.input_scroll(b"\x1B[17;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F7 => {
- terminal.input_scroll(b"\x1B[18;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F8 => {
- terminal.input_scroll(b"\x1B[19;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F9 => {
- terminal.input_scroll(b"\x1B[20;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F10 => {
- terminal.input_scroll(b"\x1B[21;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F11 => {
- terminal.input_scroll(b"\x1B[23;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F12 => {
- terminal.input_scroll(b"\x1B[24;3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::Backspace => {
- terminal.input_scroll(b"\x1B\x7F".as_slice());
- status = Status::Captured;
- }
- _ => (),
- },
- // Handle shift keys
- (_, _, _, true) => match key_code {
- KeyCode::End => {
- terminal.scroll(TerminalScroll::Bottom);
- }
- KeyCode::Home => {
- terminal.scroll(TerminalScroll::Top);
- }
- KeyCode::PageDown => {
- terminal.scroll(TerminalScroll::PageDown);
- }
- KeyCode::PageUp => {
- terminal.scroll(TerminalScroll::PageUp);
- }
- KeyCode::Tab => {
- terminal.input_scroll(b"\x1B[Z".as_slice());
- }
- _ => {}
- },
- // Handle keys with no modifiers
- (_, _, _, false) => match key_code {
- KeyCode::Backspace => {
- terminal.input_scroll(b"\x7F".as_slice());
- status = Status::Captured;
- }
- KeyCode::Tab => {
- terminal.input_scroll(b"\t".as_slice());
- status = Status::Captured;
- }
- KeyCode::Enter => {
- terminal.input_scroll(b"\r".as_slice());
- status = Status::Captured;
- }
- KeyCode::Escape => {
+ Named::Escape => {
+ //Escape with any modifier will cancel selection
let had_selection = {
let mut term = terminal.term.lock();
term.selection.take().is_some()
@@ -845,138 +706,60 @@ where
if had_selection {
terminal.update();
} else {
- terminal.input_scroll(b"\x1B".as_slice());
+ terminal.input_scroll(
+ format!("{}{}", alt_prefix, "\x1B").as_bytes().to_vec(),
+ );
}
status = Status::Captured;
}
- KeyCode::Up => {
- let code = if is_app_cursor { b"\x1BOA" } else { b"\x1B[A" };
-
- terminal.input_scroll(code.as_slice());
+ Named::Space => {
+ terminal.input_scroll(format!("{}{}", alt_prefix, " ").as_bytes().to_vec());
status = Status::Captured;
}
- KeyCode::Down => {
- let code = if is_app_cursor { b"\x1BOB" } else { b"\x1B[B" };
-
- terminal.input_scroll(code.as_slice());
+ Named::Tab => {
+ let code = if modifiers.shift() { "\x1b[Z" } else { "\x09" };
+ terminal
+ .input_scroll(format!("{}{}", alt_prefix, code).as_bytes().to_vec());
status = Status::Captured;
}
- KeyCode::Right => {
- let code = if is_app_cursor { b"\x1BOC" } else { b"\x1B[C" };
-
- terminal.input_scroll(code.as_slice());
- status = Status::Captured;
- }
- KeyCode::Left => {
- let code = if is_app_cursor { b"\x1BOD" } else { b"\x1B[D" };
-
- terminal.input_scroll(code.as_slice());
- status = Status::Captured;
- }
- KeyCode::End => {
- let code = if is_app_cursor { b"\x1BOF" } else { b"\x1B[F" };
-
- terminal.input_scroll(code.as_slice());
- status = Status::Captured;
- }
- KeyCode::Home => {
- let code = if is_app_cursor { b"\x1BOH" } else { b"\x1B[H" };
-
- terminal.input_scroll(code.as_slice());
- status = Status::Captured;
- }
- KeyCode::Insert => {
- terminal.input_scroll(b"\x1B[2~".as_slice());
- status = Status::Captured;
- }
- KeyCode::Delete => {
- terminal.input_scroll(b"\x1B[3~".as_slice());
- status = Status::Captured;
- }
- KeyCode::PageUp => {
- terminal.input_scroll(b"\x1B[5~".as_slice());
- status = Status::Captured;
- }
- KeyCode::PageDown => {
- terminal.input_scroll(b"\x1B[6~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F1 => {
- terminal.input_scroll(b"\x1BOP".as_slice());
- status = Status::Captured;
- }
- KeyCode::F2 => {
- terminal.input_scroll(b"\x1BOQ".as_slice());
- status = Status::Captured;
- }
- KeyCode::F3 => {
- terminal.input_scroll(b"\x1BOR".as_slice());
- status = Status::Captured;
- }
- KeyCode::F4 => {
- terminal.input_scroll(b"\x1BOS".as_slice());
- status = Status::Captured;
- }
- KeyCode::F5 => {
- terminal.input_scroll(b"\x1B[15~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F6 => {
- terminal.input_scroll(b"\x1B[17~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F7 => {
- terminal.input_scroll(b"\x1B[18~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F8 => {
- terminal.input_scroll(b"\x1B[19~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F9 => {
- terminal.input_scroll(b"\x1B[20~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F10 => {
- terminal.input_scroll(b"\x1B[21~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F11 => {
- terminal.input_scroll(b"\x1B[23~".as_slice());
- status = Status::Captured;
- }
- KeyCode::F12 => {
- terminal.input_scroll(b"\x1B[24~".as_slice());
- status = Status::Captured;
- }
- _ => (),
- },
- },
+ _ => {}
+ }
+ }
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
state.modifiers = modifiers;
}
- Event::Keyboard(KeyEvent::CharacterReceived(character)) if state.is_focused => {
+ Event::Keyboard(KeyEvent::KeyPressed {
+ text,
+ modifiers,
+ key,
+ ..
+ }) if state.is_focused => {
+ for (key_bind, _) in self.key_binds.iter() {
+ if key_bind.matches(modifiers, &key) {
+ return Status::Captured;
+ }
+ }
+ let character = text.and_then(|c| c.chars().next()).unwrap_or_default();
match (
- state.modifiers.logo(),
- state.modifiers.control(),
- state.modifiers.alt(),
- state.modifiers.shift(),
+ modifiers.logo(),
+ modifiers.control(),
+ modifiers.alt(),
+ modifiers.shift(),
) {
(true, _, _, _) => {
// Ignore super
}
- (false, true, true, false) => {
+ (false, true, true, _) => {
// Handle ctrl-alt for non-control characters
- // Or should I try to minimize this to only
- // catch control sequences that conflicts with
- // keykodes for Split
- // if character != '\u{4}' && character != '\u{12}' {
- // is there any valid case for control characters with modifers
- // ctrl-alt?
- if !character.is_control() {
- let mut buf = [0, 0, 0, 0];
- let str = character.encode_utf8(&mut buf);
- terminal.input_scroll(str.as_bytes().to_vec());
+ // and control characters 0-32
+ if !character.is_control() || (character as u32) < 32 {
+ // Handle alt for non-control characters
+ let mut buf = [0x1B, 0, 0, 0, 0];
+ let len = {
+ let str = character.encode_utf8(&mut buf[1..]);
+ str.len() + 1
+ };
+ terminal.input_scroll(buf[..len].to_vec());
status = Status::Captured;
}
}
@@ -990,7 +773,14 @@ where
}
}
(false, true, _, true) => {
- // Ignore ctrl+shift
+ //This is normally Ctrl+Minus, but since that
+ //is taken by zoom, we send that code for
+ //Ctrl+Underline instead, like xterm and
+ //gnome-terminal
+ if key == Key::Character("_".into()) {
+ terminal.input_scroll(b"\x1F".as_slice());
+ status = Status::Captured;
+ }
}
(false, false, true, _) => {
if !character.is_control() {
@@ -1029,6 +819,7 @@ where
state.is_focused = true;
// Handle left click drag
+ #[allow(clippy::collapsible_if)]
if let Button::Left = button {
let x = p.x - self.padding.left;
let y = p.y - self.padding.top;
@@ -1264,7 +1055,7 @@ fn shade(color: cosmic_text::Color, is_focused: bool) -> cosmic_text::Color {
}
}
-impl<'a, Message> From> for Element<'a, Message, Renderer>
+impl<'a, Message> From> for Element<'a, Message, cosmic::Theme, Renderer>
where
Message: Clone + 'a,
{
@@ -1323,3 +1114,52 @@ impl operation::Focusable for State {
self.is_focused = false;
}
}
+
+/*
+ shift 0b1 (1)
+alt 0b10 (2)
+ctrl 0b100 (4)
+super 0b1000 (8)
+hyper 0b10000 (16)
+meta 0b100000 (32)
+caps_lock 0b1000000 (64)
+num_lock 0b10000000 (128)
+*/
+fn calculate_modifier_number(state: &mut State) -> u8 {
+ let mut mod_no = 0;
+ if state.modifiers.shift() {
+ mod_no |= 1;
+ }
+ if state.modifiers.alt() {
+ mod_no |= 2;
+ }
+ if state.modifiers.control() {
+ mod_no |= 4;
+ }
+ if state.modifiers.logo() {
+ mod_no |= 8;
+ }
+ mod_no + 1
+}
+
+#[inline(always)]
+fn csi(code: &str, suffix: &str, modifiers: u8) -> Option> {
+ if modifiers == 1 {
+ Some(format!("\x1B[{}{}", code, suffix).as_bytes().to_vec())
+ } else {
+ Some(
+ format!("\x1B[{};{}{}", code, modifiers, suffix)
+ .as_bytes()
+ .to_vec(),
+ )
+ }
+}
+
+#[inline(always)]
+fn ss3(code: &str, modifiers: u8) -> Option> {
+ if modifiers == 1 {
+ Some(format!("\x1B\x4F{}", code).as_bytes().to_vec())
+ } else {
+ Some(format!("\x1B[1;{}{}", modifiers, code).as_bytes().to_vec())
+ }
+}
diff --git a/src/terminal_theme.rs b/src/terminal_theme.rs
index 27df3f7..d626c20 100644
--- a/src/terminal_theme.rs
+++ b/src/terminal_theme.rs
@@ -656,6 +656,166 @@ fn pop_dark() -> 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
+}
+
pub fn terminal_themes() -> HashMap {
let mut themes = HashMap::new();
themes.insert("Tango Dark".to_string(), tango_dark());
@@ -672,5 +832,9 @@ pub fn terminal_themes() -> HashMap {
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
}