diff --git a/Cargo.lock b/Cargo.lock index 4ad8a82..80a9753 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,17 +97,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.7" @@ -352,9 +341,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" dependencies = [ "async-lock 3.3.0", "cfg-if", @@ -423,7 +412,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.3.0", + "async-io 2.3.1", "async-lock 2.8.0", "atomic-waker", "cfg-if", @@ -452,6 +441,18 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "atk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -616,9 +617,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" dependencies = [ "bytemuck_derive", ] @@ -646,6 +647,16 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "libc", + "system-deps", +] + [[package]] name = "calloop" version = "0.10.6" @@ -683,7 +694,7 @@ dependencies = [ "calloop 0.12.4", "rustix 0.38.28", "wayland-backend", - "wayland-client 0.31.1", + "wayland-client 0.31.2", ] [[package]] @@ -696,6 +707,16 @@ dependencies = [ "libc", ] +[[package]] +name = "cfg-expr" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -810,6 +831,26 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const-random" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aaf16c9c2c612020bcfd042e170f6e32de9b9d75adb5277cdbbd2e2c8c8299a" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -866,22 +907,24 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "atomicwrites", "cosmic-config-derive", - "dirs 5.0.1", + "dirs", "iced_futures", + "known-folders", "notify", "once_cell", "ron", "serde", + "xdg", ] [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "quote", "syn 1.0.109", @@ -911,7 +954,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.10.0" -source = "git+https://github.com/pop-os/cosmic-text.git#db1530c4ec14bcbb290f9c971d8a6197c90e189a" +source = "git+https://github.com/pop-os/cosmic-text.git#0cea55630c97a47207f84e4cc3530404e17b6bfe" dependencies = [ "bitflags 2.4.2", "fontdb", @@ -933,7 +976,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "almost", "cosmic-config", @@ -1057,9 +1100,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" dependencies = [ "darling_core", "darling_macro", @@ -1067,9 +1110,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" dependencies = [ "fnv", "ident_case", @@ -1081,9 +1124,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", "quote", @@ -1097,7 +1140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown", "lock_api", "once_cell", "parking_lot_core 0.9.9", @@ -1142,33 +1185,13 @@ dependencies = [ "crypto-common", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys 0.3.7", -] - [[package]] name = "dirs" version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys 0.4.1", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", + "dirs-sys", ] [[package]] @@ -1211,9 +1234,12 @@ dependencies = [ [[package]] name = "dlv-list" -version = "0.3.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] [[package]] name = "downcast-rs" @@ -1544,12 +1570,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fontconfig-parser" -version = "0.5.3" +name = "font-types" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "674e258f4b5d2dcd63888c01c68413c51f565e8af99d2f7701c7b81d79ef41c4" +checksum = "0bd7f3ea17572640b606b35df42cfb6ecdf003704b062580e59918692190b73d" + +[[package]] +name = "fontconfig-parser" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a595cb550439a117696039dfc69830492058211b771a2a165379f2a1a53d84d" dependencies = [ - "roxmltree 0.18.1", + "roxmltree", ] [[package]] @@ -1560,7 +1592,7 @@ checksum = "98b88c54a38407f7352dd2c4238830115a6377741098ffd1f997c813d0e088a6" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.9.3", + "memmap2 0.9.4", "slotmap", "tinyvec", "ttf-parser", @@ -1638,11 +1670,11 @@ dependencies = [ [[package]] name = "freedesktop-icons" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9d46a9ae065c46efb83854bb10315de6d333bb6f4526ebe320c004dab7857e" +checksum = "b5339cbd60b2ff6b95ef212ab96bc80bf1a9dff2821b9966c417cdfae2808796" dependencies = [ - "dirs 4.0.0", + "dirs", "once_cell", "rust-ini", "thiserror", @@ -1776,6 +1808,36 @@ dependencies = [ "slab", ] +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1835,6 +1897,19 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + [[package]] name = "gl_generator" version = "0.14.0" @@ -1852,6 +1927,16 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + [[package]] name = "glow" version = "0.13.1" @@ -1884,6 +1969,17 @@ dependencies = [ "wgpu", ] +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + [[package]] name = "gpu-alloc" version = "0.6.0" @@ -1925,7 +2021,7 @@ checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ "bitflags 2.4.2", "gpu-descriptor-types", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -1943,6 +2039,24 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df00eed8d1f0db937f6be10e46e8072b0671accb504cf0f959c5c52c679f5b9" +[[package]] +name = "gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + [[package]] name = "guillotiere" version = "0.6.2" @@ -1963,22 +2077,13 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.7", -] - [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.7", + "ahash", "allocator-api2", ] @@ -2046,7 +2151,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "toml 0.8.8", + "toml 0.8.9", "unic-langid", ] @@ -2109,7 +2214,7 @@ dependencies = [ [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "iced_accessibility", "iced_core", @@ -2124,7 +2229,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "accesskit", "accesskit_winit", @@ -2133,7 +2238,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "bitflags 1.3.2", "instant", @@ -2149,7 +2254,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "futures", "iced_core", @@ -2162,7 +2267,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2185,7 +2290,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2198,7 +2303,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "iced_core", "iced_futures", @@ -2208,7 +2313,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "iced_core", "once_cell", @@ -2218,7 +2323,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "bytemuck", "cosmic-text", @@ -2236,7 +2341,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2256,7 +2361,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "iced_renderer", "iced_runtime", @@ -2270,7 +2375,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic.git#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "iced_graphics", "iced_runtime", @@ -2326,12 +2431,12 @@ checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -2472,6 +2577,15 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +[[package]] +name = "known-folders" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4397c789f2709d23cfcb703b316e0766a8d4b17db2d47b0ab096ef6047cae1d8" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "kqueue" version = "1.0.8" @@ -2521,7 +2635,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#efe4ce2f5b514e4d553ab82c0c873dca7585c028" +source = "git+https://github.com/pop-os/libcosmic.git#ca1469a6b26eb7fbdc8e28d6135e86593e6a77fd" dependencies = [ "apply", "ashpd", @@ -2543,6 +2657,7 @@ dependencies = [ "iced_winit", "lazy_static", "palette", + "rfd", "slotmap", "taffy", "thiserror", @@ -2644,11 +2759,11 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" +checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" dependencies = [ - "hashbrown 0.14.3", + "hashbrown", ] [[package]] @@ -2729,9 +2844,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ "libc", ] @@ -3166,12 +3281,12 @@ dependencies = [ [[package]] name = "ordered-multimap" -version = "0.4.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +checksum = "a4d6a8c22fc714f0c2373e6091bf6f5e9b37b1bc0b1184874b7e0a4e303d318f" dependencies = [ "dlv-list", - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -3219,9 +3334,9 @@ dependencies = [ [[package]] name = "palette" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e2f34147767aa758aa649415b50a69eeb46a67f9dc7db8011eeb3d84b351dc" +checksum = "3d38e6e5ca1612e2081cc31188f08c3cba630ce4ba44709a153f1a0f38d678f2" dependencies = [ "approx", "fast-srgb8", @@ -3232,15 +3347,27 @@ dependencies = [ [[package]] name = "palette_derive" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7db010ec5ff3d4385e4f133916faacd9dad0f6a09394c92d825b3aed310fa0a" +checksum = "e05d1c929301fee6830dafa764341118829b2535c216b0571e3821ecac5c885b" dependencies = [ "proc-macro2", "quote", "syn 2.0.48", ] +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + [[package]] name = "parking" version = "2.2.0" @@ -3357,18 +3484,18 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", @@ -3495,18 +3622,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135ede8821cf6376eb7a64148901e1690b788c11ae94dc297ae917dbc91dc0e" +checksum = "0f0f7f43585c34e4fdd7497d746bc32e14458cf11c69341cc0587b1d825dde42" [[package]] name = "qoi" @@ -3519,9 +3646,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] @@ -3609,6 +3736,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" +[[package]] +name = "read-fonts" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7555e052e772f964a1c99f1434f6a2c3a47a5f8e4292236921f121a7753cb2b5" +dependencies = [ + "font-types", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -3649,9 +3785,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -3661,9 +3797,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -3699,6 +3835,30 @@ dependencies = [ "usvg", ] +[[package]] +name = "rfd" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0d8ab342bcc5436e04d3a4c1e09e17d74958bfaddf8d5fad6f85607df0f994f" +dependencies = [ + "ashpd", + "block", + "dispatch", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "log", + "objc", + "objc-foundation", + "objc_id", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.48.0", +] + [[package]] name = "rgb" version = "0.8.37" @@ -3720,15 +3880,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "roxmltree" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302" -dependencies = [ - "xmlparser", -] - [[package]] name = "roxmltree" version = "0.19.0" @@ -3771,9 +3922,9 @@ dependencies = [ [[package]] name = "rust-ini" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a" dependencies = [ "cfg-if", "ordered-multimap", @@ -3897,18 +4048,18 @@ checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -4051,16 +4202,16 @@ dependencies = [ "cursor-icon", "libc", "log", - "memmap2 0.9.3", + "memmap2 0.9.4", "rustix 0.38.28", "thiserror", "wayland-backend", - "wayland-client 0.31.1", + "wayland-client 0.31.2", "wayland-csd-frame", - "wayland-cursor 0.31.0", - "wayland-protocols 0.31.0", + "wayland-cursor 0.31.1", + "wayland-protocols 0.31.2", "wayland-protocols-wlr", - "wayland-scanner 0.31.0", + "wayland-scanner 0.31.1", "xkeysym", ] @@ -4110,7 +4261,7 @@ dependencies = [ "foreign-types 0.5.0", "js-sys", "log", - "memmap2 0.9.3", + "memmap2 0.9.4", "objc", "raw-window-handle", "redox_syscall 0.4.1", @@ -4118,7 +4269,7 @@ dependencies = [ "tiny-xlib", "wasm-bindgen", "wayland-backend", - "wayland-client 0.31.1", + "wayland-client 0.31.2", "wayland-sys 0.31.1", "web-sys", "windows-sys 0.48.0", @@ -4189,10 +4340,11 @@ dependencies = [ [[package]] name = "swash" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7c73c813353c347272919aa1af2885068b05e625e5532b43049e4f641ae77f" +checksum = "53dab2b2dc9257aead8a24ef0481b253f4c73479ce4d3b4266792dce6870d4f3" dependencies = [ + "read-fonts", "yazi", "zeno", ] @@ -4228,6 +4380,19 @@ dependencies = [ "libc", ] +[[package]] +name = "system-deps" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 0.8.9", + "version-compare", +] + [[package]] name = "taffy" version = "0.3.11" @@ -4239,6 +4404,12 @@ dependencies = [ "slotmap", ] +[[package]] +name = "target-lexicon" +version = "0.12.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" + [[package]] name = "tempfile" version = "3.9.0" @@ -4292,6 +4463,15 @@ dependencies = [ "weezl", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tiny-skia" version = "0.8.4" @@ -4408,14 +4588,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.21.1", ] [[package]] @@ -4440,9 +4620,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "serde", @@ -4646,7 +4826,7 @@ dependencies = [ "imagesize", "kurbo", "log", - "roxmltree 0.19.0", + "roxmltree", "simplecss", "siphasher", "svgtypes", @@ -4693,6 +4873,12 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + [[package]] name = "version_check" version = "0.9.4" @@ -4828,13 +5014,13 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" +checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" dependencies = [ "cc", "downcast-rs", - "nix 0.26.4", + "rustix 0.38.28", "scoped-tls", "smallvec", "wayland-sys 0.31.1", @@ -4858,14 +5044,14 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" +checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ "bitflags 2.4.2", - "nix 0.26.4", + "rustix 0.38.28", "wayland-backend", - "wayland-scanner 0.31.0", + "wayland-scanner 0.31.1", ] [[package]] @@ -4904,12 +5090,12 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44aa20ae986659d6c77d64d808a046996a932aa763913864dc40c359ef7ad5b" +checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ - "nix 0.26.4", - "wayland-client 0.31.1", + "rustix 0.38.28", + "wayland-client 0.31.2", "xcursor", ] @@ -4927,14 +5113,14 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.31.0" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" +checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ "bitflags 2.4.2", "wayland-backend", - "wayland-client 0.31.1", - "wayland-scanner 0.31.0", + "wayland-client 0.31.2", + "wayland-scanner 0.31.1", ] [[package]] @@ -4945,9 +5131,9 @@ checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ "bitflags 2.4.2", "wayland-backend", - "wayland-client 0.31.1", - "wayland-protocols 0.31.0", - "wayland-scanner 0.31.0", + "wayland-client 0.31.2", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.1", ] [[package]] @@ -4963,9 +5149,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" +checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" dependencies = [ "proc-macro2", "quick-xml", @@ -5007,9 +5193,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu" @@ -5459,9 +5645,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.5.34" +version = "0.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" dependencies = [ "memchr", ] @@ -5554,12 +5740,6 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" -[[package]] -name = "xmlparser" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" - [[package]] name = "xmlwriter" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 3675f0b..5d8514e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "cosmic-term" version = "0.1.0" edition = "2021" +rust-version = "1.71" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -27,7 +28,6 @@ git = "https://github.com/pop-os/cosmic-text.git" git = "https://github.com/pop-os/libcosmic.git" default-features = false features = ["tokio", "winit"] -#path = "../libcosmic" [features] default = ["wgpu"] diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index de8681a..31de374 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -9,17 +9,29 @@ theme = Theme match-desktop = Match desktop dark = Dark light = Light -syntax-dark = Syntax dark -syntax-light = Syntax light +syntax-dark = Color scheme dark +syntax-light = Color scheme light +default-zoom-step = Zoom steps + +### Font +font = Font advanced-font-settings = Advanced Font Settings -default-font = Default font -default-font-stretch = Default font stretch -default-font-weight = Default font weight -default-dim-font-weight = Default dim font weight -default-bold-font-weight = Default bold font weight -use-bright-bold = Use bright colors with bold text -default-font-size = Default font size -default-zoom-step = Default zoom step +default-font = Font +default-font-size = Font size +default-font-stretch = Font stretch +default-font-weight = Normal font weight +default-dim-font-weight = Dim font weight +default-bold-font-weight = Bold font weight +use-bright-bold = Make bold text brighter + +### Splits +splits = Splits +focus-follow-mouse = Typing focus follows mouse + +### Advanced +advanced = Advanced +show-headerbar = Show header +show-header-description = Reveal the header from the right-click menu. # Find find-placeholder = Find... @@ -53,6 +65,3 @@ split-horizontal = Split horizontal split-vertical = Split vertical pane-toggle-maximize = Toggle maximized menu-settings = Settings... - -# Context menu -show-headerbar = Show header bar diff --git a/i18n/ja/cosmic_term.ftl b/i18n/ja/cosmic_term.ftl new file mode 100644 index 0000000..f10f2ab --- /dev/null +++ b/i18n/ja/cosmic_term.ftl @@ -0,0 +1,50 @@ +# Context Pages + +## 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 = デフォルトの太字の太さ +use-bright-bold = 太字を明るい色で表示する +default-font-size = デフォルトのフォントサイズ +default-zoom-step =ズームの間隔 + +# Find +find-placeholder = 検索... +find-previous = 前を検索 +find-next = 次を検索 + +# Menu + +## File +file = ファイル +new-tab = 新しいタブ +new-window = 新しいウィンドウ +close-tab = タブを閉じる +quit = 終了 + +## Edit +edit = 編集 +copy = コピー +paste = 貼り付け +select-all = すべて選択 +find = 検索 + +## View +view = 表示 +menu-settings = 設定... + +# Context menu +show-headerbar = ヘッダーバーを表す diff --git a/src/config.rs b/src/config.rs index ed855b5..d2c4680 100644 --- a/src/config.rs +++ b/src/config.rs @@ -43,6 +43,7 @@ pub struct Config { pub use_bright_bold: bool, pub syntax_theme_dark: String, pub syntax_theme_light: String, + pub focus_follow_mouse: bool, } impl Default for Config { @@ -60,6 +61,7 @@ impl Default for Config { use_bright_bold: false, syntax_theme_dark: "COSMIC Dark".to_string(), syntax_theme_light: "COSMIC Light".to_string(), + focus_follow_mouse: false, } } } diff --git a/src/main.rs b/src/main.rs index 02edb54..37cc93e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ use cosmic::{ keyboard::{Event as KeyEvent, KeyCode, Modifiers}, mouse::{Button as MouseButton, Event as MouseEvent}, subscription::{self, Subscription}, - window, Alignment, Event, Length, Padding, Point, + window, Alignment, Color, Event, Length, Limits, Padding, Point, }, style, widget::{self, button, container, pane_grid, segmented_button, PaneGrid}, @@ -26,13 +26,14 @@ use std::{ any::TypeId, collections::{BTreeMap, BTreeSet, HashMap}, env, process, - sync::Mutex, + sync::{atomic::Ordering, Mutex}, time::Duration, }; use tokio::sync::mpsc; use config::{AppTheme, Config, CONFIG_VERSION}; mod config; +mod mouse_reporter; use icon_cache::IconCache; mod icon_cache; @@ -141,8 +142,7 @@ fn main() -> Result<(), Box> { settings = settings.client_decorations(false); } - //TODO: allow size limits on iced_winit - //settings = settings.size_limits(Limits::NONE.min_width(400.0).min_height(200.0)); + settings = settings.size_limits(Limits::NONE.min_width(360.0).min_height(180.0)); let flags = Flags { config_handler, @@ -267,6 +267,7 @@ pub enum Message { PaneDragged(pane_grid::DragEvent), PaneResized(pane_grid::ResizeEvent), Modifiers(Modifiers), + MouseEnter(pane_grid::Pane), Paste(Option), PastePrimary(Option), PasteValue(Option, String), @@ -274,7 +275,7 @@ pub enum Message { UseBrightBold(bool), ShowHeaderBar(bool), SyntaxTheme(usize, bool), - SystemThemeModeChange(cosmic_theme::ThemeMode), + SystemThemeChange, TabActivate(segmented_button::Entity), TabActivateJump(usize), TabClose(Option), @@ -292,6 +293,7 @@ pub enum Message { ZoomIn, ZoomOut, ZoomReset, + FocusFollowMouse(bool), } #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -530,6 +532,67 @@ impl App { .iter() .position(|zoom_step| zoom_step == &self.config.font_size_zoom_step_mul_100); + let appearance_section = widget::settings::view_section(fl!("appearance")) + .add( + widget::settings::item::builder(fl!("theme")).control(widget::dropdown( + &self.app_themes, + Some(app_theme_selected), + move |index| { + Message::AppTheme(match index { + 1 => AppTheme::Dark, + 2 => AppTheme::Light, + _ => AppTheme::System, + }) + }, + )), + ) + .add( + //TODO: rename to color-scheme-dark? + widget::settings::item::builder(fl!("syntax-dark")).control(widget::dropdown( + &self.theme_names, + dark_selected, + move |index| Message::SyntaxTheme(index, true), + )), + ) + .add( + //TODO: rename to color-scheme-light? + widget::settings::item::builder(fl!("syntax-light")).control(widget::dropdown( + &self.theme_names, + light_selected, + move |index| Message::SyntaxTheme(index, false), + )), + ) + .add( + widget::settings::item::builder(fl!("default-zoom-step")).control( + widget::dropdown(&self.zoom_step_names, zoom_step_selected, |index| { + Message::DefaultZoomStep(index) + }), + ), + ); + //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), + )), + ) + .add( + widget::settings::item::builder(fl!("default-font-size")).control( + widget::dropdown(&self.font_size_names, font_size_selected, |index| { + Message::DefaultFontSize(index) + }), + ), + ) + .add( + widget::settings::item::builder(fl!("advanced-font-settings")).toggler( + self.show_advanced_font_settings, + Message::ShowAdvancedFontSettings, + ), + ); + let advanced_font_settings = || { let section = widget::settings::view_section("") .add( @@ -567,6 +630,10 @@ impl App { |index| Message::DefaultBoldFontWeight(index), ), ), + ) + .add( + widget::settings::item::builder(fl!("use-bright-bold")) + .toggler(self.config.use_bright_bold, Message::UseBrightBold), ); let padding = Padding { top: 0.0, @@ -577,77 +644,28 @@ impl App { widget::container(section).padding(padding) }; - let mut settings_view = widget::settings::view_section(fl!("appearance")) - .add( - widget::settings::item::builder(fl!("theme")).control(widget::dropdown( - &self.app_themes, - Some(app_theme_selected), - move |index| { - Message::AppTheme(match index { - 1 => AppTheme::Dark, - 2 => AppTheme::Light, - _ => AppTheme::System, - }) - }, - )), - ) - .add( - widget::settings::item::builder(fl!("syntax-dark")).control(widget::dropdown( - &self.theme_names, - dark_selected, - move |index| Message::SyntaxTheme(index, true), - )), - ) - .add( - widget::settings::item::builder(fl!("syntax-light")).control(widget::dropdown( - &self.theme_names, - light_selected, - move |index| Message::SyntaxTheme(index, false), - )), - ) - .add( - widget::settings::item::builder(fl!("default-font")).control(widget::dropdown( - &self.font_names, - font_selected, - |index| Message::DefaultFont(index), - )), - ) - .add( - widget::settings::item::builder(fl!("advanced-font-settings")).toggler( - self.show_advanced_font_settings, - Message::ShowAdvancedFontSettings, - ), - ); - if self.show_advanced_font_settings { - settings_view = settings_view.add(advanced_font_settings()); + font_section = font_section.add(advanced_font_settings()); } - let settings_view = settings_view - .add( - widget::settings::item::builder(fl!("use-bright-bold")) - .toggler(self.config.use_bright_bold, Message::UseBrightBold), - ) - .add( - widget::settings::item::builder(fl!("default-font-size")).control( - widget::dropdown(&self.font_size_names, font_size_selected, |index| { - Message::DefaultFontSize(index) - }), - ), - ) - .add( - widget::settings::item::builder(fl!("default-zoom-step")).control( - widget::dropdown(&self.zoom_step_names, zoom_step_selected, |index| { - Message::DefaultZoomStep(index) - }), - ), - ) - .add( - widget::settings::item::builder(fl!("show-headerbar")) - .toggler(self.config.show_headerbar, Message::ShowHeaderBar), - ); + let splits_section = widget::settings::view_section(fl!("splits")).add( + widget::settings::item::builder(fl!("focus-follow-mouse")) + .toggler(self.config.focus_follow_mouse, Message::FocusFollowMouse), + ); - widget::settings::view_column(vec![settings_view.into()]).into() + let advanced_section = widget::settings::view_section(fl!("advanced")).add( + widget::settings::item::builder(fl!("show-headerbar")) + .description(fl!("show-header-description")) + .toggler(self.config.show_headerbar, Message::ShowHeaderBar), + ); + + widget::settings::view_column(vec![ + appearance_section.into(), + font_section.into(), + splits_section.into(), + advanced_section.into(), + ]) + .into() } fn create_and_focus_new_terminal(&mut self, pane: pane_grid::Pane) { @@ -719,8 +737,7 @@ impl Application for App { /// Creates the application, and optionally emits command on initialize. fn init(mut core: Core, flags: Self::Flags) -> (Self, Command) { - //TODO: fix window resizing interfering with scrolling when not using content container - //core.window.content_container = false; + core.window.content_container = false; core.window.show_headerbar = flags.config.show_headerbar; // Update font name from config @@ -1079,6 +1096,10 @@ impl Application for App { Message::Modifiers(modifiers) => { self.modifiers = modifiers; } + Message::MouseEnter(pane) => { + self.pane_model.focus = pane; + return self.update_focus(); + } Message::PaneClicked(pane) => { self.pane_model.focus = pane; return self.update_title(Some(pane)); @@ -1163,7 +1184,13 @@ impl Application for App { return self.save_config(); } } - Message::SystemThemeModeChange(_theme_mode) => { + 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(); + } + } + Message::SystemThemeChange => { return self.update_config(); } Message::SyntaxTheme(index, dark) => match self.theme_names.get(index) { @@ -1413,9 +1440,28 @@ impl Application for App { vec![menu_bar(&self.key_binds).into()] } + 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")) + .on_press(Message::TabNew) + .padding(space_xxs) + .style(style::Button::Icon) + .into()] + } + /// Creates a view after each update. fn view(&self) -> Element { - let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; + 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 pane_grid = PaneGrid::new(&self.pane_model.panes, |pane, tab_model, _is_maximized| { let mut tab_column = widget::column::with_capacity(1); @@ -1442,7 +1488,7 @@ impl Application for App { .unwrap_or_else(widget::Id::unique); match tab_model.data::>(entity) { Some(terminal) => { - let terminal_box = terminal_box(terminal) + let mut terminal_box = terminal_box(terminal) .id(terminal_id) .on_context_menu(move |position_opt| { Message::TabContextMenu(entity, position_opt) @@ -1451,6 +1497,11 @@ impl Application for App { Message::MiddleClick(pane, Some(entity_middle_click)) }); + if self.config.focus_follow_mouse { + terminal_box = + terminal_box.on_mouse_enter(move || Message::MouseEnter(pane)); + } + let context_menu = { let terminal = terminal.lock().unwrap(); terminal.context_menu @@ -1543,6 +1594,7 @@ impl Application for App { .width(Length::Fill) .height(Length::Fill) .padding(space_xxs) + .style(style::Container::Background) .into() } @@ -1550,6 +1602,7 @@ impl Application for App { struct ConfigSubscription; struct TerminalEventSubscription; struct ThemeSubscription; + struct ThemeModeSubscription; Subscription::batch([ event::listen_with(|event, _status| match event { @@ -1603,21 +1656,23 @@ impl Application for App { } Message::Config(update.config) }), - cosmic_config::config_subscription::<_, cosmic_theme::ThemeMode>( + cosmic_config::config_subscription::<_, cosmic_theme::Theme>( TypeId::of::(), + if self.core.system_theme_mode().is_dark { + cosmic_theme::DARK_THEME_ID + } else { + cosmic_theme::LIGHT_THEME_ID + } + .into(), + cosmic_theme::Theme::version(), + ) + .map(|_update| Message::SystemThemeChange), + cosmic_config::config_subscription::<_, cosmic_theme::ThemeMode>( + TypeId::of::(), cosmic_theme::THEME_MODE_ID.into(), cosmic_theme::ThemeMode::version(), ) - .map(|update| { - if !update.errors.is_empty() { - log::debug!( - "errors loading theme mode {:?}: {:?}", - update.keys, - update.errors - ); - } - Message::SystemThemeModeChange(update.config) - }), + .map(|_update| Message::SystemThemeChange), ]) } } diff --git a/src/mouse_reporter.rs b/src/mouse_reporter.rs new file mode 100644 index 0000000..d9a339a --- /dev/null +++ b/src/mouse_reporter.rs @@ -0,0 +1,238 @@ +use cosmic::{ + iced::mouse::{Event as MouseEvent, ScrollDelta}, + iced::{keyboard::Modifiers, mouse::Button, Event}, +}; + +use crate::terminal::Terminal; + +const SCROLL_SPEED: u32 = 3; + +#[derive(Default)] +pub struct MouseReporter { + last_movment_x: Option, + last_movment_y: Option, + button: Option