Add 'View > Zoom to Selected' action (#1047)

* implements pan/zoom to the selected layer(s) on Period

Relates to #989

* adds layer menu support: Layer -> Center View on Selection

* relocate Center View on Selection to View -> Zoom to selected

* use the proper menu title
This commit is contained in:
Adam Jahn
2023-02-20 20:00:07 -05:00
committed by Keavon Chambers
parent 37775eb9e9
commit 4797aed05b
5 changed files with 29 additions and 4 deletions
@@ -222,6 +222,12 @@ impl PropertyHolder for MenuBarMessageHandler {
MenuBarEntry::new_root(
"View".into(),
MenuBarEntryChildren(vec![vec![
MenuBarEntry {
label: "Zoom to Selected".into(),
shortcut: action_keys!(NavigationMessageDiscriminant::FitViewportToSelection),
action: MenuBarEntry::create_action(|_| NavigationMessage::FitViewportToSelection.into()),
..MenuBarEntry::default()
},
MenuBarEntry {
label: "Zoom to Fit".into(),
shortcut: action_keys!(DocumentMessageDiscriminant::ZoomCanvasToFitAll),