This commit is contained in:
Nate Butler 2023-08-30 10:56:08 -04:00
parent 6e964acd92
commit 256949bee0

View File

@ -247,42 +247,37 @@ impl CollabTitlebarItem {
); );
if let Some(git_branch) = branch_prepended { if let Some(git_branch) = branch_prepended {
ret = ret.with_child( ret = ret.with_child(
Flex::row() Flex::row().with_child(
.with_child( Stack::new()
Stack::new() .with_child(
.with_child( MouseEventHandler::new::<ToggleVcsMenu, _>(0, cx, |mouse_state, cx| {
MouseEventHandler::new::<ToggleVcsMenu, _>( enum BranchPopoverTooltip {}
0, let style = git_style
cx, .in_state(self.branch_popover.is_some())
|mouse_state, cx| { .style_for(mouse_state);
enum BranchPopoverTooltip {} Label::new(git_branch, style.text.clone())
let style = git_style .contained()
.in_state(self.branch_popover.is_some()) .with_style(style.container.clone())
.style_for(mouse_state); .with_margin_right(item_spacing)
Label::new(git_branch, style.text.clone()) .aligned()
.contained() .left()
.with_style(style.container.clone()) .with_tooltip::<BranchPopoverTooltip>(
.with_margin_right(item_spacing) 0,
.aligned() "Recent branches",
.left() Some(Box::new(ToggleVcsMenu)),
.with_tooltip::<BranchPopoverTooltip>( theme.tooltip.clone(),
0, cx,
"Recent branches", )
Some(Box::new(ToggleVcsMenu)), .into_any_named("title-project-branch")
theme.tooltip.clone(), })
cx, .with_cursor_style(CursorStyle::PointingHand)
) .on_down(MouseButton::Left, move |_, this, cx| {
.into_any_named("title-project-branch") this.toggle_vcs_menu(&Default::default(), cx)
}, })
) .on_click(MouseButton::Left, move |_, _, _| {}),
.with_cursor_style(CursorStyle::PointingHand) )
.on_down(MouseButton::Left, move |_, this, cx| { .with_children(self.render_branches_popover_host(&theme.titlebar, cx)),
this.toggle_vcs_menu(&Default::default(), cx) ),
})
.on_click(MouseButton::Left, move |_, _, _| {}),
)
.with_children(self.render_branches_popover_host(&theme.titlebar, cx)),
),
) )
} }
ret.into_any() ret.into_any()