Position contacts and user menus

Using the new approach for consistency
This commit is contained in:
Petros Amoiridis 2023-03-14 09:25:08 +02:00
parent 3464961aa4
commit 86ed5b8b83
No known key found for this signature in database
2 changed files with 17 additions and 31 deletions

View File

@ -322,20 +322,7 @@ impl CollabTitlebarItem {
]
};
user_menu.show(
vec2f(
theme
.workspace
.titlebar
.user_menu_button
.default
.button_width,
theme.workspace.titlebar.height,
),
AnchorCorner::TopRight,
items,
cx,
);
user_menu.show(Default::default(), AnchorCorner::TopRight, items, cx);
});
}
@ -402,7 +389,6 @@ impl CollabTitlebarItem {
theme.tooltip.clone(),
cx,
)
.aligned()
.boxed(),
)
.with_children(badge)
@ -547,10 +533,15 @@ impl CollabTitlebarItem {
)
.contained()
.with_margin_left(theme.workspace.titlebar.item_spacing)
.aligned()
.boxed(),
)
.with_child(ChildView::new(&self.user_menu, cx).boxed())
.with_child(
ChildView::new(&self.user_menu, cx)
.aligned()
.bottom()
.right()
.boxed(),
)
.boxed()
}
@ -572,22 +563,18 @@ impl CollabTitlebarItem {
fn render_contacts_popover_host<'a>(
&'a self,
theme: &'a theme::Titlebar,
_theme: &'a theme::Titlebar,
cx: &'a RenderContext<Self>,
) -> Option<ElementBox> {
self.contacts_popover.as_ref().map(|popover| {
Overlay::new(
ChildView::new(popover, cx)
.contained()
.with_margin_top(theme.height)
.with_margin_left(theme.toggle_contacts_button.default.button_width)
.with_margin_right(-theme.toggle_contacts_button.default.button_width)
.boxed(),
)
.with_fit_mode(OverlayFitMode::SwitchAnchor)
.with_anchor_corner(AnchorCorner::BottomLeft)
.with_z_index(999)
.boxed()
Overlay::new(ChildView::new(popover, cx).boxed())
.with_fit_mode(OverlayFitMode::SwitchAnchor)
.with_anchor_corner(AnchorCorner::TopRight)
.with_z_index(999)
.aligned()
.bottom()
.right()
.boxed()
})
}

View File

@ -8,7 +8,6 @@ export default function contactsPopover(colorScheme: ColorScheme) {
background: background(layer),
cornerRadius: 6,
padding: { top: 6, bottom: 6 },
margin: { top: -6 },
shadow: colorScheme.popoverShadow,
border: border(layer),
width: 300,