Add background to user avatar
This commit is contained in:
parent
433c5d30f5
commit
83c1bb07bb
3 changed files with 21 additions and 15 deletions
|
@ -495,18 +495,22 @@ impl CollabTitlebarItem {
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) -> AnyElement<Self> {
|
) -> AnyElement<Self> {
|
||||||
let titlebar = &theme.workspace.titlebar;
|
let titlebar = &theme.workspace.titlebar;
|
||||||
let avatar_style = &theme.workspace.titlebar.leader_avatar;
|
let avatar_style = &theme.workspace.titlebar.follower_avatar;
|
||||||
|
let active = self.user_menu.read(cx).visible();
|
||||||
Stack::new()
|
Stack::new()
|
||||||
.with_child(
|
.with_child(
|
||||||
MouseEventHandler::<ToggleUserMenu, Self>::new(0, cx, |state, _| {
|
MouseEventHandler::<ToggleUserMenu, Self>::new(0, cx, |state, _| {
|
||||||
let style = titlebar.call_control.style_for(state, false);
|
let style = titlebar.call_control.style_for(state, active);
|
||||||
|
|
||||||
if let Some(avatar_img) = avatar {
|
let img = if let Some(avatar_img) = avatar {
|
||||||
Self::render_face(avatar_img, *avatar_style, Color::transparent_black())
|
Self::render_face(avatar_img, *avatar_style, Color::transparent_black())
|
||||||
} else {
|
} else {
|
||||||
Svg::new("icons/ellipsis_14.svg")
|
Svg::new("icons/ellipsis_14.svg")
|
||||||
.with_color(style.color)
|
.with_color(style.color)
|
||||||
.constrained()
|
.into_any()
|
||||||
|
};
|
||||||
|
|
||||||
|
img.constrained()
|
||||||
.with_width(style.icon_width)
|
.with_width(style.icon_width)
|
||||||
.aligned()
|
.aligned()
|
||||||
.constrained()
|
.constrained()
|
||||||
|
@ -515,7 +519,6 @@ impl CollabTitlebarItem {
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(style.container)
|
.with_style(style.container)
|
||||||
.into_any()
|
.into_any()
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.with_cursor_style(CursorStyle::PointingHand)
|
.with_cursor_style(CursorStyle::PointingHand)
|
||||||
.on_click(MouseButton::Left, move |_, this, cx| {
|
.on_click(MouseButton::Left, move |_, this, cx| {
|
||||||
|
|
|
@ -20,7 +20,6 @@ use feedback::{
|
||||||
};
|
};
|
||||||
use futures::{channel::mpsc, StreamExt};
|
use futures::{channel::mpsc, StreamExt};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions,
|
|
||||||
anyhow::{self, Result},
|
anyhow::{self, Result},
|
||||||
geometry::vector::vec2f,
|
geometry::vector::vec2f,
|
||||||
impl_actions,
|
impl_actions,
|
||||||
|
@ -715,8 +714,8 @@ mod tests {
|
||||||
use editor::{scroll::autoscroll::Autoscroll, DisplayPoint, Editor};
|
use editor::{scroll::autoscroll::Autoscroll, DisplayPoint, Editor};
|
||||||
use fs::{FakeFs, Fs};
|
use fs::{FakeFs, Fs};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
elements::Empty, executor::Deterministic, Action, AnyElement, AppContext, AssetSource,
|
actions, elements::Empty, executor::Deterministic, Action, AnyElement, AppContext,
|
||||||
Element, Entity, TestAppContext, View, ViewHandle,
|
AssetSource, Element, Entity, TestAppContext, View, ViewHandle,
|
||||||
};
|
};
|
||||||
use language::LanguageRegistry;
|
use language::LanguageRegistry;
|
||||||
use node_runtime::NodeRuntime;
|
use node_runtime::NodeRuntime;
|
||||||
|
|
|
@ -270,6 +270,10 @@ export default function workspace(colorScheme: ColorScheme) {
|
||||||
background: background(layer, "variant", "hovered"),
|
background: background(layer, "variant", "hovered"),
|
||||||
color: foreground(layer, "variant", "hovered"),
|
color: foreground(layer, "variant", "hovered"),
|
||||||
},
|
},
|
||||||
|
active: {
|
||||||
|
background: background(layer, "variant", "active"),
|
||||||
|
color: foreground(layer, "variant", "active"),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
toggleContactsButton: {
|
toggleContactsButton: {
|
||||||
margin: { left: itemSpacing },
|
margin: { left: itemSpacing },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue