Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: use a separate image in the image example and remove unnecessary examples (#8181)

Xinzhao Xu36586b77ec7d
diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml
index 715ce36be70..dcb309eb064 100644
--- a/crates/gpui/Cargo.toml
+++ b/crates/gpui/Cargo.toml
@@ -122,8 +122,4 @@ path = "examples/hello_world.rs"
[[example]]
name = "image"
-path = "examples/image.rs"
-
-[[example]]
-name = "ownership_post"
-path = "examples/ownership_post.rs"
+path = "examples/image/image.rs"
diff --git a/crates/gpui/examples/image/app-icon.png b/crates/gpui/examples/image/app-icon.png
new file mode 100644
index 00000000000..08b6d8afa0d
Binary files /dev/null and b/crates/gpui/examples/image/app-icon.png differ
diff --git a/crates/gpui/examples/image.rs b/crates/gpui/examples/image/image.rs
similarity index 91%
rename from crates/gpui/examples/image.rs
rename to crates/gpui/examples/image/image.rs
index 48cc39df580..d6002888c9e 100644
--- a/crates/gpui/examples/image.rs
+++ b/crates/gpui/examples/image/image.rs
@@ -64,9 +64,8 @@ fn main() {
App::new().run(|cx: &mut AppContext| {
cx.open_window(WindowOptions::default(), |cx| {
cx.new_view(|_cx| ImageShowcase {
- local_resource: Arc::new(
- PathBuf::from_str("crates/zed/resources/app-icon.png").unwrap(),
- ),
+ // Relative path to your root project path
+ local_resource: Arc::new(PathBuf::from_str("examples/image/app-icon.png").unwrap()),
remote_resource: "https://picsum.photos/512/512".into(),
})
});