Remove the ability to retrieve the view's parent
This commit is contained in:
@@ -107,11 +107,12 @@ impl View for TerminalButton {
|
||||
|
||||
impl TerminalButton {
|
||||
pub fn new(workspace: ViewHandle<Workspace>, cx: &mut ViewContext<Self>) -> Self {
|
||||
let button_view_id = cx.view_id();
|
||||
cx.observe(&workspace, |_, _, cx| cx.notify()).detach();
|
||||
Self {
|
||||
workspace: workspace.downgrade(),
|
||||
popup_menu: cx.add_view(|cx| {
|
||||
let mut menu = ContextMenu::new(cx);
|
||||
let mut menu = ContextMenu::new(button_view_id, cx);
|
||||
menu.set_position_mode(OverlayPositionMode::Local);
|
||||
menu
|
||||
}),
|
||||
|
||||
@@ -124,6 +124,7 @@ impl TerminalView {
|
||||
workspace_id: WorkspaceId,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) -> Self {
|
||||
let view_id = cx.view_id();
|
||||
cx.observe(&terminal, |_, _, cx| cx.notify()).detach();
|
||||
cx.subscribe(&terminal, |this, _, event, cx| match event {
|
||||
Event::Wakeup => {
|
||||
@@ -162,7 +163,7 @@ impl TerminalView {
|
||||
terminal,
|
||||
has_new_content: true,
|
||||
has_bell: false,
|
||||
context_menu: cx.add_view(ContextMenu::new),
|
||||
context_menu: cx.add_view(|cx| ContextMenu::new(view_id, cx)),
|
||||
blink_state: true,
|
||||
blinking_on: false,
|
||||
blinking_paused: false,
|
||||
|
||||
Reference in New Issue
Block a user