Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix errors in theme2
Antonio Scandurrafac029b80867
diff --git a/crates/gpui2/src/elements/img.rs b/crates/gpui2/src/elements/img.rsindex e519a93e64d..f6aae2de66a 100644--- a/crates/gpui2/src/elements/img.rs+++ b/crates/gpui2/src/elements/img.rs@@ -23,6 +23,18 @@ impl From<SharedString> for ImageSource {}}+impl From<&'static str> for ImageSource {+ fn from(uri: &'static str) -> Self {+ Self::Uri(uri.into())+ }+}++impl From<String> for ImageSource {+ fn from(uri: String) -> Self {+ Self::Uri(uri.into())+ }+}+impl From<Arc<ImageData>> for ImageSource {fn from(value: Arc<ImageData>) -> Self {Self::Data(value)diff --git a/crates/theme2/src/styles/stories/players.rs b/crates/theme2/src/styles/stories/players.rsindex d189d3bfb07..237f2f10817 100644--- a/crates/theme2/src/styles/stories/players.rs+++ b/crates/theme2/src/styles/stories/players.rs@@ -55,9 +55,8 @@ impl Render for PlayerStory {.border_2().border_color(player.cursor).child(- img()+ img("https://avatars.githubusercontent.com/u/1714999?v=4").rounded_full()- .uri("https://avatars.githubusercontent.com/u/1714999?v=4").size_6().bg(gpui::red()),)@@ -67,51 +66,62 @@ impl Render for PlayerStory {.child(div().flex().gap_1().children(cx.theme().players().0.clone().iter_mut().map(|player| {div()- .my_1()- .rounded_xl()- .flex()- .items_center()- .h_8()- .py_0p5()- .px_1p5()- .bg(player.background)- .child(- div().relative().neg_mx_1().rounded_full().z_index(3)+ .my_1()+ .rounded_xl()+ .flex()+ .items_center()+ .h_8()+ .py_0p5()+ .px_1p5()+ .bg(player.background)+ .child(+ div()+ .relative()+ .neg_mx_1()+ .rounded_full()+ .z_index(3).border_2().border_color(player.background).size(px(28.)).child(- img()- .rounded_full()- .uri("https://avatars.githubusercontent.com/u/1714999?v=4")- .size(px(24.))- .bg(gpui::red()),- ),- ).child(- div().relative().neg_mx_1().rounded_full().z_index(2)- .border_2()- .border_color(player.background)- .size(px(28.))- .child(- img()+ img("https://avatars.githubusercontent.com/u/1714999?v=4")+ .rounded_full()+ .size(px(24.))+ .bg(gpui::red()),+ ),+ )+ .child(+ div()+ .relative()+ .neg_mx_1().rounded_full()- .uri("https://avatars.githubusercontent.com/u/1714999?v=4")- .size(px(24.))- .bg(gpui::red()),- ),- ).child(- div().relative().neg_mx_1().rounded_full().z_index(1)- .border_2()- .border_color(player.background)- .size(px(28.))+ .z_index(2)+ .border_2()+ .border_color(player.background)+ .size(px(28.))+ .child(+ img("https://avatars.githubusercontent.com/u/1714999?v=4")+ .rounded_full()+ .size(px(24.))+ .bg(gpui::red()),+ ),+ ).child(- img()- .rounded_full()- .uri("https://avatars.githubusercontent.com/u/1714999?v=4")- .size(px(24.))- .bg(gpui::red()),- ),- )+ div()+ .relative()+ .neg_mx_1()+ .rounded_full()+ .z_index(1)+ .border_2()+ .border_color(player.background)+ .size(px(28.))+ .child(+ img("https://avatars.githubusercontent.com/u/1714999?v=4")+ .rounded_full()+ .size(px(24.))+ .bg(gpui::red()),+ ),+ )}),)).child(Story::label("Player Selections"))