From 44efffb90682c5441451e8c11fee95a318917a4a Mon Sep 17 00:00:00 2001 From: Adam Obuchowicz Date: Wed, 15 Jun 2022 16:01:37 +0200 Subject: [PATCH] Fix navigator --- app/gui/view/src/project.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/gui/view/src/project.rs b/app/gui/view/src/project.rs index 9c6da1eb51d7..3c580bde1fa6 100644 --- a/app/gui/view/src/project.rs +++ b/app/gui/view/src/project.rs @@ -23,6 +23,7 @@ use ensogl::application; use ensogl::application::shortcut; use ensogl::application::Application; use ensogl::display; +use ensogl::display::navigation::navigator::Navigator; use ensogl::display::Scene; use ensogl::system::web; use ensogl::system::web::dom; @@ -156,6 +157,12 @@ impl SearcherVariant { } } + fn set_navigator(&self, navigator: Navigator) { + if let Self::ComponentBrowser(browser) = self { + browser.model().list.model().set_navigator(Some(navigator)) + } + } + fn frp(&self, project_view_network: &frp::Network) -> SearcherFrp { match self { SearcherVariant::ComponentBrowser(view) => { @@ -261,6 +268,7 @@ impl Model { let display_object = display::object::Instance::new(&logger); let searcher = SearcherVariant::new(app); let graph_editor = app.new_view::(); + searcher.set_navigator(graph_editor.model.navigator.clone_ref()); let code_editor = app.new_view::(); let fullscreen_vis = default(); let prompt_background = prompt_background::View::new(&logger);