From bee6c591546d8a86220fa92a9a56e6bd8724b4cf Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 22 Jun 2023 16:28:05 +0200 Subject: [PATCH] Add caret next to user avatar --- crates/collab_ui/src/collab_titlebar_item.rs | 27 ++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 740af0254d..1d7884fcb7 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -510,19 +510,26 @@ impl CollabTitlebarItem { MouseEventHandler::::new(0, cx, |state, _| { let style = titlebar.call_control.style_for(state); - let img = if let Some(avatar_img) = avatar { - Self::render_face(avatar_img, *avatar_style, Color::transparent_black()) - } else { - Svg::new("icons/ellipsis_14.svg") - .with_color(style.color) - .into_any() - }; + let mut dropdown = Flex::row().align_children_center(); - img.constrained() - .with_width(style.icon_width) + if let Some(avatar_img) = avatar { + dropdown = dropdown.with_child(Self::render_face( + avatar_img, + *avatar_style, + Color::transparent_black(), + )); + }; + dropdown + .with_child( + Svg::new("icons/caret_down_8.svg") + .with_color(style.color) + .constrained() + .with_width(style.icon_width) + .contained() + .into_any(), + ) .aligned() .constrained() - .with_width(style.button_width) .with_height(style.button_width) .contained() .with_style(style.container)