diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d83db2df7b2..1a452b33e757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -156,11 +156,16 @@ cmd+alt+t/r. - [Fixed a bug where selecting a nested breadcrumb would cause the order of breadcrumbs to change incorrectly.][6617] +- [Changed the shortcut to show the full-screen visualization for a node from + space space to shift+space.][6663] + so that it doesn't interfere with the shortcut for toggling the small + visualization. [6421]: https://github.com/enso-org/enso/pull/6421 [6530]: https://github.com/enso-org/enso/pull/6530 [6620]: https://github.com/enso-org/enso/pull/6620 [6617]: https://github.com/enso-org/enso/pull/6617 +[6663]: https://github.com/enso-org/enso/pull/6663 #### EnsoGL (rendering engine) diff --git a/app/gui/view/graph-editor/src/lib.rs b/app/gui/view/graph-editor/src/lib.rs index ec91a150ae0b..fd7c7b7e7d57 100644 --- a/app/gui/view/graph-editor/src/lib.rs +++ b/app/gui/view/graph-editor/src/lib.rs @@ -562,14 +562,13 @@ ensogl::define_endpoints_2! { /// other case, it will be disabled as soon as the `release_visualization_visibility` is /// emitted. press_visualization_visibility(), - /// Simulates a visualization open double press event. This event toggles the visualization - /// fullscreen mode. - double_press_visualization_visibility(), /// Simulates a visualization open release event. See `press_visualization_visibility` to /// learn more. release_visualization_visibility(), /// Cycle the visualization for the selected nodes. cycle_visualization_for_selected_node(), + /// Opens the visualization for the selected node in full-screen mode. + open_fullscreen_visualization(), /// The visualization currently displayed as fullscreen is close_fullscreen_visualization(), @@ -3535,20 +3534,20 @@ fn new_graph_editor(app: &Application) -> GraphEditor { // - Release key. If the time passed from key press was short, do nothing. // - If it was long, disable vis which were disabled (preview mode). - let viz_press_ev = inputs.press_visualization_visibility.clone_ref(); - let viz_d_press_ev = inputs.double_press_visualization_visibility.clone_ref(); - let viz_release_ev = inputs.release_visualization_visibility.clone_ref(); - viz_pressed <- bool(&viz_release_ev,&viz_press_ev); - viz_was_pressed <- viz_pressed.previous(); - viz_press <- viz_press_ev.gate_not(&viz_was_pressed); - viz_release <- viz_release_ev.gate(&viz_was_pressed); - viz_press_time <- viz_press . map(|_| { + let viz_press_ev = inputs.press_visualization_visibility.clone_ref(); + let viz_open_fs_ev = inputs.open_fullscreen_visualization.clone_ref(); + let viz_release_ev = inputs.release_visualization_visibility.clone_ref(); + viz_pressed <- bool(&viz_release_ev,&viz_press_ev); + viz_was_pressed <- viz_pressed.previous(); + viz_press <- viz_press_ev.gate_not(&viz_was_pressed); + viz_release <- viz_release_ev.gate(&viz_was_pressed); + viz_press_time <- viz_press.map(|_| { let time = web::window.performance_or_panic().now() as f32; let frame_counter = Rc::new(web::FrameCounter::start_counting()); (time, Some(frame_counter)) }); - viz_release_time <- viz_release . map(|_| web::window.performance_or_panic().now() as f32); - viz_preview_mode <- viz_release_time.map2(&viz_press_time,|t1,(t0,counter)| { + viz_release_time <- viz_release.map(|_| web::window.performance_or_panic().now() as f32); + viz_preview_mode <- viz_release_time.map2(&viz_press_time,|t1,(t0,counter)| { let diff = t1-t0; // We check the time between key down and key up. If the time is less than the threshold // then it was a key press and we do not want to enter preview mode. If it is longer then @@ -3566,8 +3565,8 @@ fn new_graph_editor(app: &Application) -> GraphEditor { long_enough && enough_frames }); viz_preview_mode_end <- viz_release.gate(&viz_preview_mode).gate_not(&out.is_fs_visualization_displayed); - viz_tgt_nodes <- viz_press.gate_not(&out.is_fs_visualization_displayed).map(f_!(model.nodes.all_selected())); - viz_tgt_nodes_off <- viz_tgt_nodes.map(f!([model](node_ids) { + viz_tgt_nodes <- viz_press.gate_not(&out.is_fs_visualization_displayed).map(f_!(model.nodes.all_selected())); + viz_tgt_nodes_off <- viz_tgt_nodes.map(f!([model](node_ids) { node_ids.iter().cloned().filter(|node_id| { model.nodes.get_cloned_ref(node_id) .map(|node| !node.visualization_enabled.value()) @@ -3576,12 +3575,12 @@ fn new_graph_editor(app: &Application) -> GraphEditor { })); viz_tgt_nodes_all_on <- viz_tgt_nodes_off.map(|t| t.is_empty()); - viz_enable_by_press <= viz_tgt_nodes.gate_not(&viz_tgt_nodes_all_on); - viz_enable <- any(viz_enable_by_press,inputs.enable_visualization); + viz_enable_by_press <= viz_tgt_nodes.gate_not(&viz_tgt_nodes_all_on); + viz_enable <- any(viz_enable_by_press,inputs.enable_visualization); viz_disable_by_press <= viz_tgt_nodes.gate(&viz_tgt_nodes_all_on); - viz_disable <- any(viz_disable_by_press,inputs.disable_visualization); - viz_preview_disable <= viz_tgt_nodes_off.sample(&viz_preview_mode_end); - viz_fullscreen_on <= viz_d_press_ev.map(f_!(model.nodes.last_selected())); + viz_disable <- any(viz_disable_by_press,inputs.disable_visualization); + viz_preview_disable <= viz_tgt_nodes_off.sample(&viz_preview_mode_end); + viz_fullscreen_on <= viz_open_fs_ev.map(f_!(model.nodes.last_selected())); eval viz_enable ((id) model.enable_visualization(id)); eval viz_disable ((id) model.disable_visualization(id)); diff --git a/app/gui/view/graph-editor/src/shortcuts.rs b/app/gui/view/graph-editor/src/shortcuts.rs index 42ffd759b226..ede904f4dd17 100644 --- a/app/gui/view/graph-editor/src/shortcuts.rs +++ b/app/gui/view/graph-editor/src/shortcuts.rs @@ -21,10 +21,16 @@ pub const SHORTCUTS: &[(ensogl::application::shortcut::ActionType, &str, &str, & (Press, "!read_only", "cmd g", "collapse_selected_nodes"), // === Visualization === (Press, "!node_editing", "space", "press_visualization_visibility"), - (DoublePress, "!node_editing", "space", "double_press_visualization_visibility"), + ( + Press, + "!node_editing & !is_fs_visualization_displayed", + "shift space", + "open_fullscreen_visualization", + ), (Release, "!node_editing", "space", "release_visualization_visibility"), (Press, "", "cmd i", "reload_visualization_registry"), - (Press, "is_fs_visualization_displayed", "space", "close_fullscreen_visualization"), + (Press, "is_fs_visualization_displayed", "shift space", "close_fullscreen_visualization"), + (Press, "is_fs_visualization_displayed", "escape", "close_fullscreen_visualization"), (Press, "", "cmd", "enable_quick_visualization_preview"), (Release, "", "cmd", "disable_quick_visualization_preview"), // === Selection ===