From 4abb0faf0a0b8eae1919d8f34ac92643f3de35bc Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 19 Apr 2022 12:24:15 +0100 Subject: [PATCH] switch to opengl backend --- Cargo.lock | 1266 +++++++++++++++++---------------- lapce-data/Cargo.toml | 2 +- lapce-data/src/buffer.rs | 12 +- lapce-ui/Cargo.toml | 2 +- lapce-ui/src/editor.rs | 11 +- lapce-ui/src/editor/header.rs | 22 +- lapce-ui/src/menu.rs | 12 +- lapce-ui/src/palette.rs | 240 ++++--- lapce-ui/src/settings.rs | 23 +- lapce-ui/src/status.rs | 70 +- 10 files changed, 866 insertions(+), 794 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59363134..f84f7114 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,12 @@ dependencies = [ "regex", ] +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" + [[package]] name = "addr2line" version = "0.16.0" @@ -28,10 +34,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "ahash" -version = "0.4.7" +name = "adler32" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" @@ -73,7 +79,7 @@ dependencies = [ "alacritty_config_derive", "base64", "bitflags", - "dirs", + "dirs 3.0.2", "libc", "log", "mio 0.6.23", @@ -92,6 +98,25 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "andrew" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" +dependencies = [ + "bitflags", + "rusttype", + "walkdir", + "xdg", + "xml-rs", +] + +[[package]] +name = "android_glue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" + [[package]] name = "ansi_term" version = "0.12.1" @@ -107,27 +132,18 @@ version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf" +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + [[package]] name = "arrayvec" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" -[[package]] -name = "arrayvec" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" - -[[package]] -name = "ash" -version = "0.34.0+1.2.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f780da53d0063880d45554306489f09dd8d1bda47688b4a57bc579119356df" -dependencies = [ - "libloading", -] - [[package]] name = "autocfg" version = "1.0.1" @@ -144,7 +160,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.4.4", "object 0.26.2", "rustc-demangle", ] @@ -161,27 +177,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" -[[package]] -name = "bit-set" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" -dependencies = [ - "bit-vec 0.6.3", -] - [[package]] name = "bit-vec" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bitflags" version = "1.2.1" @@ -284,12 +285,12 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "calloop" -version = "0.9.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" +checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" dependencies = [ "log", - "nix 0.22.2", + "nix 0.18.0", ] [[package]] @@ -314,10 +315,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "cfg_aliases" -version = "0.1.1" +name = "cgl" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] [[package]] name = "chrono" @@ -389,14 +393,10 @@ dependencies = [ ] [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "color_quant" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "config" @@ -430,12 +430,6 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" -[[package]] -name = "copyless" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - [[package]] name = "copypasta" version = "0.7.1" @@ -622,6 +616,20 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crossbeam" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + [[package]] name = "crossbeam-channel" version = "0.5.1" @@ -656,6 +664,16 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.5" @@ -673,14 +691,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] -name = "d3d12" -version = "0.4.1" +name = "darling" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" dependencies = [ - "bitflags", - "libloading", - "winapi 0.3.9", + "darling_core 0.10.2", + "darling_macro 0.10.2", ] [[package]] @@ -689,8 +706,22 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.13.1", + "darling_macro 0.13.1", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn", ] [[package]] @@ -703,7 +734,18 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core 0.10.2", + "quote", "syn", ] @@ -713,7 +755,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" dependencies = [ - "darling_core", + "darling_core 0.13.1", "quote", "syn", ] @@ -727,6 +769,15 @@ dependencies = [ "matches", ] +[[package]] +name = "deflate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" +dependencies = [ + "adler32", +] + [[package]] name = "derivative" version = "2.2.0" @@ -771,6 +822,15 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -815,13 +875,22 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "dlib" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" +dependencies = [ + "libloading 0.6.7", +] + [[package]] name = "dlib" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ - "libloading", + "libloading 0.7.0", ] [[package]] @@ -833,7 +902,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "druid" version = "0.7.0" -source = "git+https://github.com/lapce/druid#ce620508b16511c2c42e6c5bf36051bc8bcf19b0" +source = "git+https://github.com/lapce/druid?branch=opengl#4132af82f6ab00d10fa7229d43dd01d064e75c02" dependencies = [ "console_error_panic_hook", "druid-derive", @@ -842,6 +911,7 @@ dependencies = [ "fluent-langneg", "fluent-syntax", "fnv", + "glutin", "im", "instant", "tracing", @@ -849,15 +919,14 @@ dependencies = [ "tracing-wasm", "unic-langid", "unicode-segmentation", - "usvg", - "winit", + "usvg 0.14.1", "xi-unicode", ] [[package]] name = "druid-derive" version = "0.4.0" -source = "git+https://github.com/lapce/druid#ce620508b16511c2c42e6c5bf36051bc8bcf19b0" +source = "git+https://github.com/lapce/druid?branch=opengl#4132af82f6ab00d10fa7229d43dd01d064e75c02" dependencies = [ "proc-macro2", "quote", @@ -867,23 +936,23 @@ dependencies = [ [[package]] name = "druid-shell" version = "0.7.0" -source = "git+https://github.com/lapce/druid#ce620508b16511c2c42e6c5bf36051bc8bcf19b0" +source = "git+https://github.com/lapce/druid?branch=opengl#4132af82f6ab00d10fa7229d43dd01d064e75c02" dependencies = [ "anyhow", "cfg-if 1.0.0", "copypasta", + "glutin", "instant", "js-sys", "keyboard-types", "kurbo", "lazy_static", "piet-wgpu", - "raw-window-handle", + "raw-window-handle 0.4.2", "time 0.2.27", "tracing", "wasm-bindgen", "web-sys", - "winit", ] [[package]] @@ -943,7 +1012,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" dependencies = [ - "darling", + "darling 0.13.1", "proc-macro2", "quote", "syn", @@ -1010,12 +1079,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" -[[package]] -name = "fixedbitset" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" - [[package]] name = "flate2" version = "1.0.22" @@ -1025,7 +1088,7 @@ dependencies = [ "cfg-if 1.0.0", "crc32fast", "libc", - "miniz_oxide", + "miniz_oxide 0.4.4", ] [[package]] @@ -1034,6 +1097,12 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75224bec9bfe1a65e2d34132933f2de7fe79900c96a0174307554244ece8150e" +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + [[package]] name = "float-ord" version = "0.2.0" @@ -1114,6 +1183,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "fontconfig-parser" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82cea2adebf32a9b104b8ffb308b5fb3b456f04cc76c294c3c85025c8a5d75f4" +dependencies = [ + "roxmltree", +] + [[package]] name = "fontdb" version = "0.5.4" @@ -1125,6 +1203,18 @@ dependencies = [ "ttf-parser 0.12.3", ] +[[package]] +name = "fontdb" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122fa73a5566372f9df09768a16e8e3dad7ad18abe07835f1f0b71f84078ba4c" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2 0.5.3", + "ttf-parser 0.15.0", +] + [[package]] name = "foreign-types" version = "0.3.2" @@ -1150,6 +1240,15 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fount" +version = "0.1.0" +source = "git+https://github.com/lapce/fount#684eb99db1c53a4fd6cd99d21884b86db7b50e95" +dependencies = [ + "memmap2 0.5.3", + "swash", +] + [[package]] name = "freetype" version = "0.7.0" @@ -1225,100 +1324,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -[[package]] -name = "futures" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" - -[[package]] -name = "futures-executor" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" - -[[package]] -name = "futures-macro" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" -dependencies = [ - "autocfg", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" - -[[package]] -name = "futures-task" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" - -[[package]] -name = "futures-util" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" -dependencies = [ - "autocfg", - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "proc-macro-hack", - "proc-macro-nested", - "slab", -] - [[package]] name = "fuzzy-matcher" version = "0.3.7" @@ -1367,6 +1372,16 @@ dependencies = [ "wasi", ] +[[package]] +name = "gif" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gimli" version = "0.25.0" @@ -1393,6 +1408,17 @@ dependencies = [ "url", ] +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glam" version = "0.10.2" @@ -1434,42 +1460,69 @@ dependencies = [ ] [[package]] -name = "gpu-alloc" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c481459c44304a1dfed23bd650bb3912e12c9f77d7871f86d7ed7c9730a52e79" +name = "glutin" +version = "0.26.0" +source = "git+https://github.com/lapce/glutin?branch=new-keyboard-all#7c313d91584492961b9efab0d611e35b977c0fea" dependencies = [ - "bitflags", - "gpu-alloc-types", + "android_glue", + "cgl", + "cocoa", + "core-foundation 0.9.1", + "glutin_egl_sys", + "glutin_emscripten_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "lazy_static", + "libloading 0.7.0", + "log", + "objc", + "osmesa-sys", + "parking_lot", + "wayland-client", + "wayland-egl", + "winapi 0.3.9", + "winit", ] [[package]] -name = "gpu-alloc-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +name = "glutin_egl_sys" +version = "0.1.5" +source = "git+https://github.com/lapce/glutin?branch=new-keyboard-all#7c313d91584492961b9efab0d611e35b977c0fea" dependencies = [ - "bitflags", + "gl_generator", + "winapi 0.3.9", ] [[package]] -name = "gpu-descriptor" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a237f0419ab10d17006d55c62ac4f689a6bf52c75d3f38b8361d249e8d4b0b" -dependencies = [ - "bitflags", - "gpu-descriptor-types", - "hashbrown 0.9.1", -] - -[[package]] -name = "gpu-descriptor-types" +name = "glutin_emscripten_sys" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" +source = "git+https://github.com/lapce/glutin?branch=new-keyboard-all#7c313d91584492961b9efab0d611e35b977c0fea" + +[[package]] +name = "glutin_gles2_sys" +version = "0.1.5" +source = "git+https://github.com/lapce/glutin?branch=new-keyboard-all#7c313d91584492961b9efab0d611e35b977c0fea" dependencies = [ - "bitflags", + "gl_generator", + "objc", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.1.7" +source = "git+https://github.com/lapce/glutin?branch=new-keyboard-all#7c313d91584492961b9efab0d611e35b977c0fea" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.1.5" +source = "git+https://github.com/lapce/glutin?branch=new-keyboard-all#7c313d91584492961b9efab0d611e35b977c0fea" +dependencies = [ + "gl_generator", ] [[package]] @@ -1511,22 +1564,13 @@ dependencies = [ "memmap2 0.3.1", ] -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" -dependencies = [ - "ahash 0.4.7", -] - [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.6", + "ahash", ] [[package]] @@ -1547,12 +1591,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hexf-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" - [[package]] name = "home" version = "0.5.3" @@ -1653,7 +1691,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", - "hashbrown 0.11.2", + "hashbrown", "serde 1.0.130", ] @@ -1688,12 +1726,6 @@ dependencies = [ "libc", ] -[[package]] -name = "inplace_it" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" - [[package]] name = "instant" version = "0.1.10" @@ -1765,6 +1797,12 @@ dependencies = [ "libc", ] +[[package]] +name = "jpeg-decoder" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744c24117572563a98a7e9168a5ac1ee4a1ca7f702211258797bbe0ed0346c3c" + [[package]] name = "js-sys" version = "0.3.53" @@ -1805,14 +1843,10 @@ dependencies = [ ] [[package]] -name = "khronos-egl" -version = "4.1.0" +name = "khronos_api" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" -dependencies = [ - "libc", - "libloading", -] +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "kqueue" @@ -1840,7 +1874,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e30b1df631d23875f230ed3ddd1a88c231f269a04b2044eb6ca87e763b5f4c42" dependencies = [ - "arrayvec 0.5.2", + "arrayvec", "serde 1.0.130", ] @@ -1887,7 +1921,7 @@ dependencies = [ "alacritty_terminal", "anyhow", "base64", - "bit-vec 0.5.1", + "bit-vec", "bitflags", "bytemuck", "cc", @@ -1901,7 +1935,7 @@ dependencies = [ "fern", "flate2", "fuzzy-matcher", - "hashbrown 0.11.2", + "hashbrown", "im", "include_dir", "indexmap", @@ -1911,7 +1945,7 @@ dependencies = [ "lapce-proxy", "lapce-rpc", "lazy_static", - "libloading", + "libloading 0.7.0", "log", "lsp-types", "notify 5.0.0-pre.13", @@ -1992,7 +2026,7 @@ dependencies = [ "alacritty_terminal", "anyhow", "base64", - "bit-vec 0.5.1", + "bit-vec", "cc", "chrono", "config", @@ -2004,7 +2038,7 @@ dependencies = [ "fern", "flate2", "fuzzy-matcher", - "hashbrown 0.11.2", + "hashbrown", "im", "include_dir", "indexmap", @@ -2013,7 +2047,7 @@ dependencies = [ "lapce-data", "lapce-rpc", "lazy_static", - "libloading", + "libloading 0.7.0", "log", "lsp-types", "notify 5.0.0-pre.13", @@ -2065,7 +2099,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "arrayvec 0.5.2", + "arrayvec", "bitflags", "cfg-if 1.0.0", "ryu", @@ -2092,6 +2126,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + [[package]] name = "libloading" version = "0.7.0" @@ -2225,7 +2269,7 @@ version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe153a6ce93cb97c85ba47a007fd437079bbff5592b9c0f77195973b8b169d69" dependencies = [ - "arrayvec 0.5.2", + "arrayvec", "euclid", "num-traits 0.2.14", ] @@ -2245,7 +2289,7 @@ version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56799e28a041fa98b0865a93d2e19f64de3c8f2708bfe96b8af5c7d491aef468" dependencies = [ - "arrayvec 0.5.2", + "arrayvec", "float_next_after", "lyon_path", "sid", @@ -2287,6 +2331,15 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +[[package]] +name = "memmap2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +dependencies = [ + "libc", +] + [[package]] name = "memmap2" version = "0.2.3" @@ -2307,9 +2360,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.5.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" dependencies = [ "libc", ] @@ -2323,20 +2376,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "metal" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084" -dependencies = [ - "bitflags", - "block", - "core-graphics-types", - "foreign-types", - "log", - "objc", -] - [[package]] name = "minimal-lexical" version = "0.1.2" @@ -2353,6 +2392,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miniz_oxide" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.6.23" @@ -2385,19 +2433,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "mio" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" -dependencies = [ - "libc", - "log", - "miow 0.3.7", - "ntapi", - "winapi 0.3.9", -] - [[package]] name = "mio-anonymous-pipes" version = "0.2.0" @@ -2423,6 +2458,18 @@ dependencies = [ "slab", ] +[[package]] +name = "mio-misc" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47412f3a52115b936ff2a229b803498c7b4d332adeb87c2f1498c9da54c398c" +dependencies = [ + "crossbeam", + "crossbeam-queue", + "log", + "mio 0.7.13", +] + [[package]] name = "mio-uds" version = "0.6.8" @@ -2461,25 +2508,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" -[[package]] -name = "naga" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4419062f8aa39fb25938169486341945758679e260ddbc1f94bfd1f33924dc2" -dependencies = [ - "bit-set", - "bitflags", - "codespan-reporting", - "hexf-parse", - "indexmap", - "log", - "num-traits 0.2.14", - "petgraph 0.6.0", - "rustc-hash", - "spirv", - "thiserror", -] - [[package]] name = "nameof" version = "1.2.2" @@ -2488,46 +2516,38 @@ checksum = "9ce8b389a86cabeb0d8b33a61e60f3cbb4de38914342fe274e69111f3b5d9c44" [[package]] name = "ndk" -version = "0.6.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" dependencies = [ - "bitflags", "jni-sys", "ndk-sys", "num_enum", "thiserror", ] -[[package]] -name = "ndk-context" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5cc68637e21fe8f077f6a1c9e0b9ca495bb74895226b476310f613325884" - [[package]] name = "ndk-glue" -version = "0.6.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ffb7443daba48349d545028777ca98853b018b4c16624aa01223bc29e078da" +checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" dependencies = [ "lazy_static", "libc", "log", "ndk", - "ndk-context", "ndk-macro", "ndk-sys", ] [[package]] name = "ndk-macro" -version = "0.3.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" dependencies = [ - "darling", - "proc-macro-crate", + "darling 0.10.2", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -2535,12 +2555,9 @@ dependencies = [ [[package]] name = "ndk-sys" -version = "0.3.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" -dependencies = [ - "jni-sys", -] +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" [[package]] name = "net2" @@ -2553,6 +2570,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "nix" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +dependencies = [ + "bitflags", + "cc", + "cfg-if 0.1.10", + "libc", +] + [[package]] name = "nix" version = "0.20.0" @@ -2699,7 +2728,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -2712,7 +2741,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", - "objc_exception", ] [[package]] @@ -2726,15 +2754,6 @@ dependencies = [ "objc_id", ] -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - [[package]] name = "objc_id" version = "0.1.1" @@ -2805,6 +2824,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "osmesa-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" +dependencies = [ + "shared_library", +] + [[package]] name = "ouroboros" version = "0.9.5" @@ -2828,6 +2856,15 @@ dependencies = [ "syn", ] +[[package]] +name = "owned_ttf_parser" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" +dependencies = [ + "ttf-parser 0.6.2", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -2849,13 +2886,22 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "petgraph 0.5.1", + "petgraph", "redox_syscall", "smallvec", "thread-id", "winapi 0.3.9", ] +[[package]] +name = "parley" +version = "0.1.0" +source = "git+https://github.com/lapce/parley#d9ad6158172da121a0143e5637a65a28d9fd98c6" +dependencies = [ + "fount", + "swash", +] + [[package]] name = "pathfinder_geometry" version = "0.5.1" @@ -2896,17 +2942,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" dependencies = [ - "fixedbitset 0.2.0", - "indexmap", -] - -[[package]] -name = "petgraph" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" -dependencies = [ - "fixedbitset 0.4.0", + "fixedbitset", "indexmap", ] @@ -2929,24 +2965,27 @@ dependencies = [ [[package]] name = "piet-wgpu" version = "0.1.0" -source = "git+https://github.com/lapce/piet-wgpu#65459b63c60a25da0a351ca733af1aa5d03e13b8" +source = "git+https://github.com/lapce/piet-wgpu?branch=opengl#215749dce6d1e4dcb214dfe95faa2e85e8e26f22" dependencies = [ "bytemuck", "font-kit", - "futures", "glam", - "hashbrown 0.11.2", + "glow", + "glutin", + "hashbrown", "include_dir", "linked-hash-map", "log", "lyon", + "parley", "pathfinder_geometry", "piet", - "raw-window-handle", + "resvg", "sha2", + "swash", + "tiny-skia", "unicode-width", - "usvg", - "wgpu", + "usvg 0.22.0", ] [[package]] @@ -2955,18 +2994,33 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkg-config" version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +[[package]] +name = "png" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba" +dependencies = [ + "bitflags", + "crc32fast", + "deflate", + "miniz_oxide 0.5.1", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + [[package]] name = "proc-macro-crate" version = "1.0.0" @@ -3007,12 +3061,6 @@ version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - [[package]] name = "proc-macro2" version = "1.0.36" @@ -3022,12 +3070,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "profiling" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd5592a8eed7e74f56ad7b125f8234763b805c30f0c7c95c486920026a6ec" - [[package]] name = "ptr_meta" version = "0.1.4" @@ -3073,10 +3115,14 @@ dependencies = [ ] [[package]] -name = "range-alloc" -version = "0.1.2" +name = "raw-window-handle" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" +checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" +dependencies = [ + "libc", + "raw-window-handle 0.4.2", +] [[package]] name = "raw-window-handle" @@ -3118,6 +3164,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be9e29cb19c8fe84169fcb07f8f11e66bc9e6e0280efd4715c54818296f8a4a8" +[[package]] +name = "rctree" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae028b272a6e99d9f8260ceefa3caa09300a8d6c8d2b2001316474bc52122e9" + [[package]] name = "redox_syscall" version = "0.2.10" @@ -3205,10 +3257,31 @@ dependencies = [ ] [[package]] -name = "renderdoc-sys" -version = "0.7.1" +name = "resvg" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" +checksum = "2e702d1e8e00a3a0717b96244cba840f34f542d8f23097c8903266c4e2975658" +dependencies = [ + "gif", + "jpeg-decoder", + "log", + "pico-args", + "png", + "rgb", + "svgfilters", + "svgtypes 0.8.0", + "tiny-skia", + "usvg 0.22.0", +] + +[[package]] +name = "rgb" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e74fdc210d8f24a7dbfedc13b04ba5764f5232754ccebfdf5fff1bad791ccbc6" +dependencies = [ + "bytemuck", +] [[package]] name = "ring" @@ -3232,7 +3305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "631f7d2a2854abb66724f492ce5256e79685a673dc210ac022194cedd5c914d3" dependencies = [ "bytecheck", - "hashbrown 0.11.2", + "hashbrown", "ptr_meta", "rend", "rkyv_derive", @@ -3307,6 +3380,16 @@ dependencies = [ "webpki", ] +[[package]] +name = "rusttype" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + [[package]] name = "rustversion" version = "1.0.6" @@ -3325,7 +3408,23 @@ dependencies = [ "ttf-parser 0.9.0", "unicode-bidi-mirroring", "unicode-ccc", - "unicode-general-category", + "unicode-general-category 0.2.0", + "unicode-script", +] + +[[package]] +name = "rustybuzz" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ff94f20221325d000e552781713e53b0d85c1d9551b6f420d12daf5a08eace" +dependencies = [ + "bitflags", + "bytemuck", + "smallvec", + "ttf-parser 0.15.0", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-general-category 0.4.0", "unicode-script", ] @@ -3335,6 +3434,15 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +[[package]] +name = "safe_arch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" +dependencies = [ + "bytemuck", +] + [[package]] name = "same-file" version = "1.0.6" @@ -3535,6 +3643,16 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared_library" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" +dependencies = [ + "lazy_static", + "libc", +] + [[package]] name = "sid" version = "0.6.1" @@ -3590,6 +3708,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + [[package]] name = "sized-chunks" version = "0.6.5" @@ -3637,6 +3761,25 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +[[package]] +name = "smithay-client-toolkit" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" +dependencies = [ + "andrew", + "bitflags", + "calloop", + "dlib 0.4.2", + "lazy_static", + "log", + "memmap2 0.1.0", + "nix 0.18.0", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + [[package]] name = "smithay-client-toolkit" version = "0.14.0" @@ -3644,33 +3787,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec783683499a2cfc85b6df3d04f83b1907b5cbd98a1aed44667dbdf1eac4e64c" dependencies = [ "bitflags", - "dlib", + "dlib 0.5.0", "lazy_static", "log", "memmap2 0.2.3", "nix 0.20.0", - "wayland-client 0.28.6", - "wayland-cursor 0.28.6", - "wayland-protocols 0.28.6", -] - -[[package]] -name = "smithay-client-toolkit" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1325f292209cee78d5035530932422a30aa4c8fda1a16593ac083c1de211e68a" -dependencies = [ - "bitflags", - "calloop", - "dlib", - "lazy_static", - "log", - "memmap2 0.3.1", - "nix 0.22.2", - "pkg-config", - "wayland-client 0.29.4", - "wayland-cursor 0.29.4", - "wayland-protocols 0.29.4", + "wayland-client", + "wayland-cursor", + "wayland-protocols", ] [[package]] @@ -3680,7 +3804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "986c5b4a7bd4f50d4c51f81f844745535cb488360f9cf63293780b109b9295f3" dependencies = [ "smithay-client-toolkit 0.14.0", - "wayland-client 0.28.6", + "wayland-client", ] [[package]] @@ -3689,16 +3813,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spirv" -version = "0.2.0+1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" -dependencies = [ - "bitflags", - "num-traits 0.2.14", -] - [[package]] name = "spsc-buffer" version = "0.1.1" @@ -3775,6 +3889,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "strsim" version = "0.10.0" @@ -3786,7 +3906,7 @@ name = "structdesc" version = "0.1.0" source = "git+https://github.com/lapce/structdesc#a6a2b8ab65d43475238f889736c4aa5dfff4500a" dependencies = [ - "darling", + "darling 0.13.1", "proc-macro2", "quote", "syn", @@ -3810,14 +3930,42 @@ dependencies = [ "syn", ] +[[package]] +name = "svgfilters" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "639abcebc15fdc2df179f37d6f5463d660c1c79cd552c12343a4600827a04bce" +dependencies = [ + "float-cmp 0.9.0", + "rgb", +] + [[package]] name = "svgtypes" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c536faaff1a10837cfe373142583f6e27d81e96beba339147e77b67c9f260ff" dependencies = [ - "float-cmp", - "siphasher", + "float-cmp 0.5.3", + "siphasher 0.2.3", +] + +[[package]] +name = "svgtypes" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dabb3eb59a457c56d5282ab4545609e2cc382b41f6af239bb8d59a7267ef94b3" +dependencies = [ + "siphasher 0.3.10", +] + +[[package]] +name = "swash" +version = "0.1.4" +source = "git+https://github.com/dfrg/swash#d3f8bbfa5f96688ab94278db6f85e00ba383e3f8" +dependencies = [ + "yazi", + "zeno", ] [[package]] @@ -3851,15 +3999,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "1.0.28" @@ -3958,6 +4097,20 @@ dependencies = [ "syn", ] +[[package]] +name = "tiny-skia" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bcfd4339bdd4545eabed74b208f2f1555f2e6540fb58135c01f46c0940aa138" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if 1.0.0", + "png", + "safe_arch", +] + [[package]] name = "tinyfiledialogs" version = "3.8.3" @@ -4203,6 +4356,12 @@ dependencies = [ "tree-sitter", ] +[[package]] +name = "ttf-parser" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" + [[package]] name = "ttf-parser" version = "0.9.0" @@ -4215,6 +4374,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ae2f58a822f08abdaf668897e96a5656fe72f5a9ce66422423e8849384872e6" +[[package]] +name = "ttf-parser" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74c96594835e10fa545e2a51e8709f30b173a092bfd6036ef2cec53376244f3" + [[package]] name = "type-map" version = "0.4.0" @@ -4329,6 +4494,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f9af028e052a610d99e066b33304625dea9613170a2563314490a4e6ec5cf7f" +[[package]] +name = "unicode-general-category" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07547e3ee45e28326cc23faac56d44f58f16ab23e413db526debce3b0bfd2742" + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -4415,17 +4586,17 @@ dependencies = [ "base64", "data-url", "flate2", - "fontdb", + "fontdb 0.5.4", "kurbo", "log", "memmap2 0.2.3", "pico-args", - "rctree", + "rctree 0.3.3", "roxmltree", - "rustybuzz", + "rustybuzz 0.3.0", "simplecss", - "siphasher", - "svgtypes", + "siphasher 0.2.3", + "svgtypes 0.5.0", "ttf-parser 0.12.3", "unicode-bidi", "unicode-script", @@ -4433,6 +4604,33 @@ dependencies = [ "xmlwriter", ] +[[package]] +name = "usvg" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a261d60a7215fa339482047cc3dafd4e22e2bf34396aaebef2b707355bbb39c0" +dependencies = [ + "base64", + "data-url", + "flate2", + "float-cmp 0.9.0", + "fontdb 0.9.1", + "kurbo", + "log", + "pico-args", + "rctree 0.4.0", + "roxmltree", + "rustybuzz 0.5.0", + "simplecss", + "siphasher 0.3.10", + "svgtypes 0.8.0", + "ttf-parser 0.15.0", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "xmlwriter", +] + [[package]] name = "utf8parse" version = "0.2.0" @@ -4522,18 +4720,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fded345a6559c2cfee778d562300c581f7d4ff3edb9b0d230d69800d213972" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.76" @@ -4651,7 +4837,7 @@ dependencies = [ "enumset", "lazy_static", "loupe", - "memmap2 0.5.0", + "memmap2 0.5.3", "more-asserts", "rustc-demangle", "serde 1.0.130", @@ -4672,7 +4858,7 @@ dependencies = [ "cfg-if 1.0.0", "enumset", "leb128", - "libloading", + "libloading 0.7.0", "loupe", "rkyv", "serde 1.0.130", @@ -4828,25 +5014,9 @@ dependencies = [ "libc", "nix 0.20.0", "scoped-tls", - "wayland-commons 0.28.6", - "wayland-scanner 0.28.6", - "wayland-sys 0.28.6", -] - -[[package]] -name = "wayland-client" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91223460e73257f697d9e23d401279123d36039a3f7a449e983f123292d4458f" -dependencies = [ - "bitflags", - "downcast-rs", - "libc", - "nix 0.22.2", - "scoped-tls", - "wayland-commons 0.29.4", - "wayland-scanner 0.29.4", - "wayland-sys 0.29.4", + "wayland-commons", + "wayland-scanner", + "wayland-sys", ] [[package]] @@ -4858,19 +5028,7 @@ dependencies = [ "nix 0.20.0", "once_cell", "smallvec", - "wayland-sys 0.28.6", -] - -[[package]] -name = "wayland-commons" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e" -dependencies = [ - "nix 0.22.2", - "once_cell", - "smallvec", - "wayland-sys 0.29.4", + "wayland-sys", ] [[package]] @@ -4880,19 +5038,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" dependencies = [ "nix 0.20.0", - "wayland-client 0.28.6", + "wayland-client", "xcursor", ] [[package]] -name = "wayland-cursor" -version = "0.29.4" +name = "wayland-egl" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" +checksum = "99ba1ab1e18756b23982d36f08856d521d7df45015f404a2d7c4f0b2d2f66956" dependencies = [ - "nix 0.22.2", - "wayland-client 0.29.4", - "xcursor", + "wayland-client", + "wayland-sys", ] [[package]] @@ -4902,21 +5059,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" dependencies = [ "bitflags", - "wayland-client 0.28.6", - "wayland-commons 0.28.6", - "wayland-scanner 0.28.6", -] - -[[package]] -name = "wayland-protocols" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60147ae23303402e41fe034f74fb2c35ad0780ee88a1c40ac09a3be1e7465741" -dependencies = [ - "bitflags", - "wayland-client 0.29.4", - "wayland-commons 0.29.4", - "wayland-scanner 0.29.4", + "wayland-client", + "wayland-commons", + "wayland-scanner", ] [[package]] @@ -4930,35 +5075,13 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "wayland-scanner" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a1ed3143f7a143187156a2ab52742e89dac33245ba505c17224df48939f9e0" -dependencies = [ - "proc-macro2", - "quote", - "xml-rs", -] - [[package]] name = "wayland-sys" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" dependencies = [ - "dlib", - "lazy_static", - "pkg-config", -] - -[[package]] -name = "wayland-sys" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4" -dependencies = [ - "dlib", + "dlib 0.5.0", "lazy_static", "pkg-config", ] @@ -4993,95 +5116,10 @@ dependencies = [ ] [[package]] -name = "wgpu" -version = "0.12.0" +name = "weezl" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97cd781ff044d6d697b632a2e212032c2e957d1afaa21dbf58069cbb8f78567" -dependencies = [ - "arrayvec 0.7.1", - "js-sys", - "log", - "naga", - "parking_lot", - "raw-window-handle", - "smallvec", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu-core", - "wgpu-hal", - "wgpu-types", -] - -[[package]] -name = "wgpu-core" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe9cb9c9d728c0f7ea0c309f1b3d5e9d5c7d379890d0a4e3df3103323ff7a84" -dependencies = [ - "arrayvec 0.7.1", - "bitflags", - "cfg_aliases", - "codespan-reporting", - "copyless", - "fxhash", - "log", - "naga", - "parking_lot", - "profiling", - "raw-window-handle", - "smallvec", - "thiserror", - "wgpu-hal", - "wgpu-types", -] - -[[package]] -name = "wgpu-hal" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "742ec904d0577e1a88b82dba6cf0347c12197cd664b859b05f868bceb8cfff4d" -dependencies = [ - "arrayvec 0.7.1", - "ash", - "bit-set", - "bitflags", - "block", - "core-graphics-types", - "d3d12", - "foreign-types", - "fxhash", - "glow", - "gpu-alloc", - "gpu-descriptor", - "inplace_it", - "js-sys", - "khronos-egl", - "libloading", - "log", - "metal", - "naga", - "objc", - "parking_lot", - "profiling", - "range-alloc", - "raw-window-handle", - "renderdoc-sys", - "thiserror", - "wasm-bindgen", - "web-sys", - "wgpu-types", - "winapi 0.3.9", -] - -[[package]] -name = "wgpu-types" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549533d9e1cdd4b4cda7718d33ff500fc4c34b5467b71d76b547ae0324f3b2a2" -dependencies = [ - "bitflags", -] +checksum = "d8b77fdfd5a253be4ab714e4ffa3c49caf146b4de743e97510c0656cf90f1e8e" [[package]] name = "which" @@ -5139,8 +5177,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winit" -version = "0.26.1" -source = "git+https://github.com/lapce/winit?branch=new-keyboard-all#75e9569593223823e9191686368d196de9df6581" +version = "0.24.0" +source = "git+https://github.com/neovide/winit?branch=new-keyboard-all#59eb01c19f78a8f81232448c2792dae39fd13efc" dependencies = [ "bitflags", "cocoa", @@ -5153,7 +5191,8 @@ dependencies = [ "libc", "log", "memmap2 0.2.3", - "mio 0.8.0", + "mio 0.7.13", + "mio-misc", "nameof", "ndk", "ndk-glue", @@ -5161,13 +5200,11 @@ dependencies = [ "objc", "parking_lot", "percent-encoding", - "raw-window-handle", - "smithay-client-toolkit 0.15.3", + "raw-window-handle 0.3.4", + "scopeguard", + "smithay-client-toolkit 0.12.3", "unicode-segmentation", - "wasm-bindgen", - "wayland-client 0.29.4", - "wayland-protocols 0.29.4", - "web-sys", + "wayland-client", "winapi 0.3.9", "x11-dl", "xkbcommon-dl", @@ -5232,6 +5269,15 @@ dependencies = [ "nom 7.0.0", ] +[[package]] +name = "xdg" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4583db5cbd4c4c0303df2d15af80f0539db703fa1c68802d4cbbd2dd0f88f6" +dependencies = [ + "dirs 4.0.0", +] + [[package]] name = "xi-rope" version = "0.3.0" @@ -5256,7 +5302,7 @@ version = "0.1.0" source = "git+https://github.com/maroider/xkbcommon-dl?rev=900832888ad6f11011d1369befb344a9aa8a9610#900832888ad6f11011d1369befb344a9aa8a9610" dependencies = [ "bitflags", - "dlib", + "dlib 0.5.0", "lazy_static", "log", "x11-dl", @@ -5288,3 +5334,15 @@ checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] + +[[package]] +name = "yazi" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03b3e19c937b5b9bd8e52b1c88f30cce5c0d33d676cf174866175bb794ff658" + +[[package]] +name = "zeno" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c110ba09c9b3a43edd4803d570df0da2414fed6e822e22b976a4e3ef50860701" diff --git a/lapce-data/Cargo.toml b/lapce-data/Cargo.toml index 78944fc1..75169753 100644 --- a/lapce-data/Cargo.toml +++ b/lapce-data/Cargo.toml @@ -47,7 +47,7 @@ xi-unicode = "0.3.0" fuzzy-matcher = "0.3.7" uuid = { version = "0.8.2", features = ["v4"] } lsp-types = { version = "0.89.2", features = ["proposed"] } -druid = { git = "https://github.com/lapce/druid", features = [ "svg", "im", "serde", ] } +druid = { git = "https://github.com/lapce/druid", branch = "opengl", features = [ "svg", "im", "serde", ] } #druid = { path = "../../druid/druid", features = ["svg", "im" , "serde"] } toml = { version = "0.5.8", features = ["preserve_order"] } structdesc = { git = "https://github.com/lapce/structdesc" } diff --git a/lapce-data/src/buffer.rs b/lapce-data/src/buffer.rs index cc4dccb5..6f61db15 100644 --- a/lapce-data/src/buffer.rs +++ b/lapce-data/src/buffer.rs @@ -28,9 +28,7 @@ }; use xi_unicode::EmojiExt; -use crate::buffer::data::{ - BufferData, BufferDataListener, EditableBufferData, -}; +use crate::buffer::data::{BufferData, BufferDataListener, EditableBufferData}; use crate::buffer::decoration::BufferDecoration; use crate::config::{Config, LapceTheme}; use crate::editor::EditorLocationNew; @@ -872,11 +870,7 @@ pub fn history_text_layout( } } } - Some(layout_builder.build_with_info( - true, - config.editor.tab_width, - Some(bounds), - )) + Some(layout_builder.build().unwrap()) } #[allow(clippy::too_many_arguments)] @@ -922,7 +916,7 @@ pub fn new_text_layout( } } } - layout_builder.build_with_info(true, config.editor.tab_width, Some(bounds)) + layout_builder.build().unwrap() } pub fn indent_on_line(&self, line: usize) -> String { diff --git a/lapce-ui/Cargo.toml b/lapce-ui/Cargo.toml index 3d390e66..49b37914 100644 --- a/lapce-ui/Cargo.toml +++ b/lapce-ui/Cargo.toml @@ -43,7 +43,7 @@ xi-rope = { git = "https://github.com/lapce/xi-editor", features = ["serde"] } xi-unicode = "0.3.0" fuzzy-matcher = "0.3.7" lsp-types = { version = "0.89.2", features = ["proposed"] } -druid = { git = "https://github.com/lapce/druid", features = [ "svg", "im", "serde", ] } +druid = { git = "https://github.com/lapce/druid", branch = "opengl", features = [ "svg", "im", "serde", ] } #druid = { path = "../../druid/druid", features = ["svg", "im" , "serde"] } toml = { version = "0.5.8", features = ["preserve_order"] } structdesc = { git = "https://github.com/lapce/structdesc" } diff --git a/lapce-ui/src/editor.rs b/lapce-ui/src/editor.rs index c22b7246..dca64898 100644 --- a/lapce-ui/src/editor.rs +++ b/lapce-ui/src/editor.rs @@ -561,11 +561,8 @@ fn paint_content( ) .clone(), ) - .build_with_info( - true, - data.config.editor.tab_width, - Some([rect.x0, rect.x1]), - ); + .build() + .unwrap(); ctx.draw_text( &text_layout, Point::new(0.0, line_height * line as f64 + y_shift), @@ -721,7 +718,9 @@ fn paint_content( &text_layout, Point::new( 0.0, - line_height * line as f64 + y_shift + line_padding, + line_height * line as f64 + + (line_height - text_layout.size().height) / 2.0 + + line_padding, ), ); } diff --git a/lapce-ui/src/editor/header.rs b/lapce-ui/src/editor/header.rs index 5bff44c0..d34e6642 100644 --- a/lapce-ui/src/editor/header.rs +++ b/lapce-ui/src/editor/header.rs @@ -13,12 +13,11 @@ data::LapceTabData, editor::LapceEditorBufferData, state::LapceWorkspace, - }; use crate::{ svg::{file_svg_new, get_svg}, - tab::LapceIcon + tab::LapceIcon, }; pub struct LapceEditorHeader { @@ -120,7 +119,8 @@ pub fn paint_buffer( workspace: &LapceWorkspace, ) { let shadow_width = 5.0; - let rect = ctx.size().to_rect(); + let size = ctx.size(); + let rect = size.to_rect(); ctx.blurred_rect( rect, shadow_width, @@ -174,7 +174,13 @@ pub fn paint_buffer( ) .build() .unwrap(); - ctx.draw_text(&text_layout, Point::new(30.0, 7.0)); + ctx.draw_text( + &text_layout, + Point::new( + 30.0, + (size.height - text_layout.size().height) / 2.0, + ), + ); if let Some(workspace_path) = workspace.path.as_ref() { path = path @@ -201,7 +207,13 @@ pub fn paint_buffer( ) .build() .unwrap(); - ctx.draw_text(&text_layout, Point::new(30.0 + x + 5.0, 7.0)); + ctx.draw_text( + &text_layout, + Point::new( + 30.0 + x + 5.0, + (size.height - text_layout.size().height) / 2.0, + ), + ); } }); } diff --git a/lapce-ui/src/menu.rs b/lapce-ui/src/menu.rs index b675107b..46ee1d8a 100644 --- a/lapce-ui/src/menu.rs +++ b/lapce-ui/src/menu.rs @@ -220,11 +220,13 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceWindowData, _env: &Env) { if let Some(keymaps) = data.keypress.command_keymaps.get(&item.command.cmd) { - let origin = Point::new( - rect.x1, - self.line_height * i as f64 + self.line_height / 2.0, - ); - keymaps[0].paint(ctx, origin, Alignment::Right, &data.config); + if !keymaps.is_empty() { + let origin = Point::new( + rect.x1, + self.line_height * i as f64 + self.line_height / 2.0, + ); + keymaps[0].paint(ctx, origin, Alignment::Right, &data.config); + } } } } diff --git a/lapce-ui/src/palette.rs b/lapce-ui/src/palette.rs index 8701cdf8..9d586dae 100644 --- a/lapce-ui/src/palette.rs +++ b/lapce-ui/src/palette.rs @@ -1,8 +1,9 @@ use std::path::Path; use std::sync::Arc; -use druid::FontWeight; +use druid::kurbo::Line; use druid::piet::{Svg, TextAttribute, TextLayout}; +use druid::FontWeight; use druid::{ kurbo::Rect, piet::{Text, TextLayoutBuilder}, @@ -26,7 +27,7 @@ use crate::{ editor::view::LapceEditorView, scroll::{LapceIdentityWrapper, LapceScrollNew}, - svg::{symbol_svg_new, file_svg_new}, + svg::{file_svg_new, symbol_svg_new}, }; #[derive(Clone, Debug, PartialEq)] @@ -515,7 +516,12 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &PaletteViewData, _env: &Env) { .unwrap() }; - let line = text_layout.cursor_line_for_text_position(cursor); + let pos = text_layout.hit_test_text_position(cursor); + let line_metric = text_layout.line_metric(0).unwrap(); + let p0 = (pos.point.x, line_metric.y_offset); + let p1 = (pos.point.x, line_metric.y_offset + line_metric.height); + let line = Line::new(p0, p1); + ctx.stroke( line, data.config @@ -546,95 +552,98 @@ fn paint_palette_item( indices: &[usize], line_height: f64, config: &Config, - ) - { - let (svg, text, text_indices, hint, hint_indices) = match palette_item_content { - PaletteItemContent::File(path, _) => Self::file_paint_items(path, indices), - #[allow(unused_variables)] - PaletteItemContent::DocumentSymbol { - kind, - name, - range, - container_name, - } => { - let text = name.to_string(); - let hint = container_name.clone().unwrap_or_else(|| "".to_string()); - let text_indices = indices - .iter() - .filter_map(|i| { - let i = *i; - if i < text.len() { - Some(i) - } else { - None + ) { + let (svg, text, text_indices, hint, hint_indices) = + match palette_item_content { + PaletteItemContent::File(path, _) => { + Self::file_paint_items(path, indices) + } + #[allow(unused_variables)] + PaletteItemContent::DocumentSymbol { + kind, + name, + range, + container_name, + } => { + let text = name.to_string(); + let hint = + container_name.clone().unwrap_or_else(|| "".to_string()); + let text_indices = indices + .iter() + .filter_map(|i| { + let i = *i; + if i < text.len() { + Some(i) + } else { + None + } + }) + .collect(); + let hint_indices = indices + .iter() + .filter_map(|i| { + let i = *i; + if i >= text.len() { + Some(i - text.len()) + } else { + None + } + }) + .collect(); + (symbol_svg_new(kind), text, text_indices, hint, hint_indices) + } + PaletteItemContent::Line(_, text) => { + (None, text.clone(), indices.to_vec(), "".to_string(), vec![]) + } + PaletteItemContent::ReferenceLocation(rel_path, _location) => { + Self::file_paint_items(rel_path, indices) + } + PaletteItemContent::Workspace(w) => { + let text = w.path.as_ref().unwrap().to_str().unwrap(); + let text = match &w.kind { + LapceWorkspaceType::Local => text.to_string(), + LapceWorkspaceType::RemoteSSH(user, host) => { + format!("[{user}@{host}] {text}") } - }) - .collect(); - let hint_indices = indices - .iter() - .filter_map(|i| { - let i = *i; - if i >= text.len() { - Some(i - text.len()) - } else { - None + LapceWorkspaceType::RemoteWSL => { + format!("[wsl] {text}") } - }) - .collect(); - (symbol_svg_new(kind), text, text_indices, hint, hint_indices) - } - PaletteItemContent::Line(_, text) => { - (None, text.clone(), indices.to_vec(), "".to_string(), vec![]) - } - PaletteItemContent::ReferenceLocation(rel_path, _location) => { - Self::file_paint_items(rel_path, indices) - } - PaletteItemContent::Workspace(w) => { - let text = w.path.as_ref().unwrap().to_str().unwrap(); - let text = match &w.kind { - LapceWorkspaceType::Local => text.to_string(), - LapceWorkspaceType::RemoteSSH(user, host) => { - format!("[{user}@{host}] {text}") - } - LapceWorkspaceType::RemoteWSL => { - format!("[wsl] {text}") - } - }; - (None, text, indices.to_vec(), "".to_string(), vec![]) - } - PaletteItemContent::Command(command) => ( - None, - command - .palette_desc - .as_ref() - .map(|m| m.to_string()) - .unwrap_or_else(|| "".to_string()), - indices.to_vec(), - "".to_string(), - vec![], - ), - PaletteItemContent::Theme(theme) => ( - None, - theme.to_string(), - indices.to_vec(), - "".to_string(), - vec![], - ), - PaletteItemContent::TerminalLine(_line, content) => ( - None, - content.clone(), - indices.to_vec(), - "".to_string(), - vec![], - ), - PaletteItemContent::SshHost(user, host) => ( - None, - format!("{user}@{host}"), - indices.to_vec(), - "".to_string(), - vec![], - ), - }; + }; + (None, text, indices.to_vec(), "".to_string(), vec![]) + } + PaletteItemContent::Command(command) => ( + None, + command + .palette_desc + .as_ref() + .map(|m| m.to_string()) + .unwrap_or_else(|| "".to_string()), + indices.to_vec(), + "".to_string(), + vec![], + ), + PaletteItemContent::Theme(theme) => ( + None, + theme.to_string(), + indices.to_vec(), + "".to_string(), + vec![], + ), + PaletteItemContent::TerminalLine(_line, content) => ( + None, + content.clone(), + indices.to_vec(), + "".to_string(), + vec![], + ), + PaletteItemContent::SshHost(user, host) => ( + None, + format!("{user}@{host}"), + indices.to_vec(), + "".to_string(), + vec![], + ), + }; if let Some(svg) = svg.as_ref() { let width = 14.0; @@ -655,16 +664,20 @@ fn paint_palette_item( let focus_color = config.get_color_unchecked(LapceTheme::EDITOR_FOCUS); + let full_text = if hint.is_empty() { + text.clone() + } else { + text.clone() + " " + &hint + }; let mut text_layout = ctx .text() - .new_text_layout(text) + .new_text_layout(full_text.clone()) .font(FontFamily::SYSTEM_UI, 14.0) .text_color( config .get_color_unchecked(LapceTheme::EDITOR_FOREGROUND) .clone(), ); - for i in &text_indices { let i = *i; text_layout = text_layout.range_attribute( @@ -674,23 +687,21 @@ fn paint_palette_item( text_layout = text_layout .range_attribute(i..i + 1, TextAttribute::Weight(FontWeight::BOLD)); } - let text_layout = text_layout.build().unwrap(); - let x = svg_x + 5.0; - let y = line_height * line as f64 + 4.0; - let point = Point::new(x, y); - ctx.draw_text(&text_layout, point); if !hint.is_empty() { - let text_x = text_layout.size().width; - let mut text_layout = ctx - .text() - .new_text_layout(hint) - .font(FontFamily::SYSTEM_UI, 13.0) - .text_color( - config.get_color_unchecked(LapceTheme::EDITOR_DIM).clone(), + text_layout = text_layout + .range_attribute( + text.len() + 1..full_text.len(), + TextAttribute::FontSize(13.0), + ) + .range_attribute( + text.len() + 1..full_text.len(), + TextAttribute::TextColor( + config.get_color_unchecked(LapceTheme::EDITOR_DIM).clone(), + ), ); for i in &hint_indices { - let i = *i; + let i = *i + text.len() + 1; text_layout = text_layout.range_attribute( i..i + 1, TextAttribute::TextColor(focus_color.clone()), @@ -700,19 +711,20 @@ fn paint_palette_item( TextAttribute::Weight(FontWeight::BOLD), ); } - let text_layout = text_layout.build().unwrap(); - ctx.draw_text( - &text_layout, - Point::new(x + text_x + 4.0, line as f64 * line_height + 5.0), - ); } + + let text_layout = text_layout.build().unwrap(); + let x = svg_x + 5.0; + let y = line_height * line as f64 + + (line_height - text_layout.size().height) / 2.0; + let point = Point::new(x, y); + ctx.draw_text(&text_layout, point); } fn file_paint_items( path: &Path, indices: &[usize], - ) -> (Option, String, Vec, String, Vec) - { + ) -> (Option, String, Vec, String, Vec) { let svg = file_svg_new(path); let file_name = path .file_name() @@ -844,7 +856,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &PaletteViewData, _env: &Env) { } let item = &items[line]; - + Self::paint_palette_item( &item.content, ctx, @@ -857,8 +869,6 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &PaletteViewData, _env: &Env) { } } - - pub struct PalettePreview {} impl PalettePreview { diff --git a/lapce-ui/src/settings.rs b/lapce-ui/src/settings.rs index 6de7e8ae..0f814798 100644 --- a/lapce-ui/src/settings.rs +++ b/lapce-ui/src/settings.rs @@ -388,12 +388,15 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) { ); } - ctx.blurred_rect( - self.header_rect, - shadow_width, - data.config - .get_color_unchecked(LapceTheme::LAPCE_DROPDOWN_SHADOW), - ); + ctx.with_save(|ctx| { + ctx.clip(self.header_rect.inflate(0.0, 50.0) + Vec2::new(0.0, 50.0)); + ctx.blurred_rect( + self.header_rect, + shadow_width, + data.config + .get_color_unchecked(LapceTheme::LAPCE_DROPDOWN_SHADOW), + ); + }); let text_layout = ctx .text() .new_text_layout("Settings") @@ -1024,10 +1027,6 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) { let text = ctx.text(); let text = self.name(text, data); - text.set_color( - data.config - .get_color_unchecked(LapceTheme::EDITOR_FOREGROUND), - ); y += padding; ctx.draw_text(text, Point::new(0.0, y)); y += text.size().height + padding; @@ -1063,10 +1062,6 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) { }; let text = ctx.text(); let text = self.desc(text, data); - text.set_color( - data.config - .get_color_unchecked(LapceTheme::EDITOR_FOREGROUND), - ); ctx.draw_text(text, Point::new(x, y)); if let Some(input) = self.input_widget.as_mut() { diff --git a/lapce-ui/src/status.rs b/lapce-ui/src/status.rs index 9e7d9ad4..ffc58e0f 100644 --- a/lapce-ui/src/status.rs +++ b/lapce-ui/src/status.rs @@ -13,10 +13,7 @@ state::Mode, }; -use crate::{ - svg::get_svg, - tab::LapceIcon, -}; +use crate::{svg::get_svg, tab::LapceIcon}; pub struct LapceStatusNew { height: f64, @@ -222,31 +219,27 @@ fn paint( if data.config.lapce.modal { let (mode, color) = { - let mode = - if data.focus_area == FocusArea::Panel(PanelKind::Terminal) { - match data.terminal.terminals.get(&data.terminal.active_term_id) { - Some(terminal) => terminal.mode, - None => Mode::Normal - } - } else { - data.main_split - .active_editor() - .map(|e| e.cursor.get_mode()) - .unwrap_or(Mode::Normal) - }; + let mode = if data.focus_area + == FocusArea::Panel(PanelKind::Terminal) + { + match data.terminal.terminals.get(&data.terminal.active_term_id) + { + Some(terminal) => terminal.mode, + None => Mode::Normal, + } + } else { + data.main_split + .active_editor() + .map(|e| e.cursor.get_mode()) + .unwrap_or(Mode::Normal) + }; match mode { - Mode::Normal => ( - "Normal", LapceTheme::STATUS_MODAL_NORMAL, - ), - Mode::Insert => ( - "Insert", LapceTheme::STATUS_MODAL_INSERT, - ), - Mode::Visual => ( - "Visual", LapceTheme::STATUS_MODAL_VISUAL, - ), - Mode::Terminal => ( - "Terminal", LapceTheme::STATUS_MODAL_TERMINAL, - ), + Mode::Normal => ("Normal", LapceTheme::STATUS_MODAL_NORMAL), + Mode::Insert => ("Insert", LapceTheme::STATUS_MODAL_INSERT), + Mode::Visual => ("Visual", LapceTheme::STATUS_MODAL_VISUAL), + Mode::Terminal => { + ("Terminal", LapceTheme::STATUS_MODAL_TERMINAL) + } } }; @@ -263,11 +256,11 @@ fn paint( .unwrap(); let text_size = text_layout.size(); let fill_size = Size::new(text_size.width + 10.0, size.height); - ctx.fill( - fill_size.to_rect(), - data.config.get_color_unchecked(color) + ctx.fill(fill_size.to_rect(), data.config.get_color_unchecked(color)); + ctx.draw_text( + &text_layout, + Point::new(5.0, (size.height - text_layout.size().height) / 2.0), ); - ctx.draw_text(&text_layout, Point::new(5.0, 4.0)); left += text_size.width + 10.0; } @@ -285,7 +278,10 @@ fn paint( ) .build() .unwrap(); - ctx.draw_text(&text_layout, Point::new(left + 10.0, 4.0)); + ctx.draw_text( + &text_layout, + Point::new(left + 10.0, (size.height - text_layout.size().height) / 2.0), + ); left += 10.0 + text_layout.size().width; for progress in data.progresses.iter() { @@ -306,7 +302,13 @@ fn paint( ) .build() .unwrap(); - ctx.draw_text(&text_layout, Point::new(left + 10.0, 4.0)); + ctx.draw_text( + &text_layout, + Point::new( + left + 10.0, + (size.height - text_layout.size().height) / 2.0, + ), + ); left += 10.0 + text_layout.size().width; }