Rebase main and fix error
This commit is contained in:
parent
8301ee43d6
commit
5302c256a4
1 changed files with 2 additions and 1 deletions
|
@ -111,11 +111,12 @@ impl View for BranchesButton {
|
||||||
|
|
||||||
impl BranchesButton {
|
impl BranchesButton {
|
||||||
pub fn new(workspace: ViewHandle<Workspace>, cx: &mut ViewContext<Self>) -> Self {
|
pub fn new(workspace: ViewHandle<Workspace>, cx: &mut ViewContext<Self>) -> Self {
|
||||||
|
let parent_id = cx.view_id();
|
||||||
cx.observe(&workspace, |_, _, cx| cx.notify()).detach();
|
cx.observe(&workspace, |_, _, cx| cx.notify()).detach();
|
||||||
Self {
|
Self {
|
||||||
workspace: workspace.downgrade(),
|
workspace: workspace.downgrade(),
|
||||||
popup_menu: cx.add_view(|cx| {
|
popup_menu: cx.add_view(|cx| {
|
||||||
let mut menu = ContextMenu::new(cx);
|
let mut menu = ContextMenu::new(parent_id, cx);
|
||||||
menu.set_position_mode(OverlayPositionMode::Local);
|
menu.set_position_mode(OverlayPositionMode::Local);
|
||||||
menu
|
menu
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue