diff --git a/Cargo.lock b/Cargo.lock
index f58ac4ff0f09e..952e5a0f89834 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1075,7 +1075,7 @@ dependencies = [
"smallvec",
"smartstring",
"textwrap",
- "toml",
+ "toml 0.7.6",
"tree-sitter",
"unicode-general-category",
"unicode-segmentation",
@@ -1119,7 +1119,7 @@ dependencies = [
"serde",
"tempfile",
"threadpool",
- "toml",
+ "toml 0.7.6",
"tree-sitter",
"which",
]
@@ -1187,9 +1187,10 @@ dependencies = [
"tempfile",
"tokio",
"tokio-stream",
- "toml",
+ "toml 0.7.6",
"url",
"which",
+ "winres",
]
[[package]]
@@ -1252,7 +1253,7 @@ dependencies = [
"slotmap",
"tokio",
"tokio-stream",
- "toml",
+ "toml 0.7.6",
"url",
"which",
]
@@ -2140,6 +2141,15 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "toml"
+version = "0.5.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "toml"
version = "0.7.6"
@@ -2600,6 +2610,15 @@ dependencies = [
"memchr",
]
+[[package]]
+name = "winres"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
+dependencies = [
+ "toml 0.5.11",
+]
+
[[package]]
name = "xtask"
version = "23.10.0"
@@ -2608,7 +2627,7 @@ dependencies = [
"helix-loader",
"helix-term",
"helix-view",
- "toml",
+ "toml 0.7.6",
]
[[package]]
diff --git a/README.md b/README.md
index 227e1c91fb71c..2911780f2f93e 100644
--- a/README.md
+++ b/README.md
@@ -2,9 +2,9 @@
@@ -16,7 +16,7 @@
-![Screenshot](./screenshot.png)
+![Screenshot](./assets/screenshot.png)
A Kakoune / Neovim inspired editor, written in Rust.
diff --git a/assets/logo.ico b/assets/logo.ico
new file mode 100644
index 0000000000000..d0f40729a17fb
Binary files /dev/null and b/assets/logo.ico differ
diff --git a/assets/logo.svg b/assets/logo.svg
new file mode 100644
index 0000000000000..bf6f29c4ec58b
--- /dev/null
+++ b/assets/logo.svg
@@ -0,0 +1,29 @@
+
\ No newline at end of file
diff --git a/assets/logo_dark.svg b/assets/logo_dark.svg
new file mode 100644
index 0000000000000..7c36a5c6f13be
--- /dev/null
+++ b/assets/logo_dark.svg
@@ -0,0 +1,70 @@
+
+
\ No newline at end of file
diff --git a/assets/logo_light.svg b/assets/logo_light.svg
new file mode 100644
index 0000000000000..bde042197fe89
--- /dev/null
+++ b/assets/logo_light.svg
@@ -0,0 +1,70 @@
+
+
\ No newline at end of file
diff --git a/screenshot.png b/assets/screenshot.png
similarity index 100%
rename from screenshot.png
rename to assets/screenshot.png
diff --git a/flake.nix b/flake.nix
index e113d94b99752..da151a752f280 100644
--- a/flake.nix
+++ b/flake.nix
@@ -41,8 +41,6 @@
".ignore"
".github"
".gitignore"
- "logo_dark.svg"
- "logo_light.svg"
"rust-toolchain.toml"
"rustfmt.toml"
"runtime"
@@ -142,7 +140,7 @@
postInstall = ''
mkdir -p $out/share/applications $out/share/icons/hicolor/scalable/apps $out/share/icons/hicolor/256x256/apps
cp contrib/Helix.desktop $out/share/applications
- cp logo.svg $out/share/icons/hicolor/scalable/apps/helix.svg
+ cp assets/logo.svg $out/share/icons/hicolor/scalable/apps/helix.svg
cp contrib/helix.png $out/share/icons/hicolor/256x256/apps
'';
});
diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml
index 4ff7fc0b1798c..f9c2b9df03ba6 100644
--- a/helix-term/Cargo.toml
+++ b/helix-term/Cargo.toml
@@ -81,6 +81,10 @@ crossterm = { version = "0.27", features = ["event-stream", "use-dev-tty"] }
[build-dependencies]
helix-loader = { path = "../helix-loader" }
+[target.'cfg(windows)'.build-dependencies]
+# winres to inject icon into Windows binary
+winres = "0.1.12"
+
[dev-dependencies]
smallvec = "1.11"
indoc = "2.0.4"
diff --git a/helix-term/build.rs b/helix-term/build.rs
index b47dae8ef6530..bbb2c938b3860 100644
--- a/helix-term/build.rs
+++ b/helix-term/build.rs
@@ -1,4 +1,5 @@
use helix_loader::grammar::{build_grammars, fetch_grammars};
+extern crate winres;
fn main() {
if std::env::var("HELIX_DISABLE_AUTO_GRAMMAR_BUILD").is_err() {
@@ -6,4 +7,9 @@ fn main() {
build_grammars(Some(std::env::var("TARGET").unwrap()))
.expect("Failed to compile tree-sitter grammars");
}
+ if cfg!(target_os = "windows") {
+ let mut res = winres::WindowsResource::new();
+ res.set_icon("../assets/logo.ico");
+ res.compile().unwrap();
+ }
}
diff --git a/logo.svg b/logo.svg
deleted file mode 100644
index 05dd73a8afb9f..0000000000000
--- a/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/logo_dark.svg b/logo_dark.svg
deleted file mode 100644
index f6e94f1b4c39f..0000000000000
--- a/logo_dark.svg
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
diff --git a/logo_light.svg b/logo_light.svg
deleted file mode 100644
index cdd5ddb8b0a62..0000000000000
--- a/logo_light.svg
+++ /dev/null
@@ -1,115 +0,0 @@
-
-