Checkpoint: Reproduction with Avatar story

This commit is contained in:
Marshall Bowers
2023-11-02 12:34:40 -04:00
parent 5ee2b01102
commit 66e4d75e6f
7 changed files with 91 additions and 42 deletions
+16 -4
View File
@@ -58,11 +58,23 @@ mod stories {
.child(Avatar::new(
"https://avatars.githubusercontent.com/u/1714999?v=4",
))
.child(Avatar::new(
"https://avatars.githubusercontent.com/u/326587?v=4",
))
// .child(Avatar::new(
// "https://avatars.githubusercontent.com/u/482957?v=4",
// ))
// .child(Avatar::new(
// "https://avatars.githubusercontent.com/u/1714999?v=4",
// ))
// .child(Avatar::new(
// "https://avatars.githubusercontent.com/u/1486634?v=4",
// ))
.child(Story::label(cx, "Rounded rectangle"))
.child(
Avatar::new("https://avatars.githubusercontent.com/u/1714999?v=4")
.shape(Shape::RoundedRectangle),
)
// .child(
// Avatar::new("https://avatars.githubusercontent.com/u/1714999?v=4")
// .shape(Shape::RoundedRectangle),
// )
}
}
}
+2 -2
View File
@@ -139,11 +139,11 @@ impl Player {
}
pub fn cursor_color<V: 'static>(&self, cx: &mut ViewContext<V>) -> Hsla {
cx.theme().styles.player.0[self.index].cursor
cx.theme().styles.player.0[self.index % cx.theme().styles.player.0.len()].cursor
}
pub fn selection_color<V: 'static>(&self, cx: &mut ViewContext<V>) -> Hsla {
cx.theme().styles.player.0[self.index].selection
cx.theme().styles.player.0[self.index % cx.theme().styles.player.0.len()].selection
}
pub fn avatar_src(&self) -> &str {