Allow size to be specified in ImageStyle

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2021-09-21 18:27:26 +02:00
co-authored by Nathan Sobo
parent f8990b707a
commit 1bd6cd0978
4 changed files with 31 additions and 19 deletions
+2 -2
View File
@@ -126,8 +126,8 @@ color = "$text.1.color"
[people_panel]
extends = "$panel"
host_username = { extends = "$text.0", padding.left = 5 }
worktree_host_avatar = { corner_radius = 10 }
worktree_guest_avatar = { corner_radius = 8 }
worktree_host_avatar = { corner_radius = 10, width = 20 }
worktree_guest_avatar = { corner_radius = 8, width = 16 }
[people_panel.worktree_name]
extends = "$text.0"
+6 -14
View File
@@ -69,13 +69,9 @@ impl PeoplePanel {
.with_child(
Flex::row()
.with_children(collaborator.user.avatar.clone().map(|avatar| {
ConstrainedBox::new(
Image::new(avatar)
.with_style(theme.worktree_host_avatar)
.boxed(),
)
.with_width(20.)
.boxed()
Image::new(avatar)
.with_style(theme.worktree_host_avatar)
.boxed()
}))
.with_child(
Container::new(
@@ -152,13 +148,9 @@ impl PeoplePanel {
)
.with_children(worktree.participants.iter().filter_map(|participant| {
participant.avatar.clone().map(|avatar| {
ConstrainedBox::new(
Image::new(avatar)
.with_style(theme.worktree_guest_avatar)
.boxed(),
)
.with_width(16.)
.boxed()
Image::new(avatar)
.with_style(theme.worktree_guest_avatar)
.boxed()
})
}))
.boxed()