mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 08:08:11 +08:00
Rework navigation tool hints and navigation shortcuts (#1419)
* Added Pan,Tilt,Zoom to View menu + Tilt shortcut changes * formating * fixed menus, added action for when dispatch happens from menu * set key mappings to spec * fix labels for navigation tool * fix some spacing * add action that locks spacebar for navigation when using it as a modifier so the node overlay does not toggle * escape from the node-graph-overlay, set toggle to ctrl+space, fix demo art * move all transform state into an enum * rename confusing flag * fix demo art and tests --------- Co-authored-by: Ezbaze <rybitwamateusz3@gmail.com>
This commit is contained in:
co-authored by
Ezbaze
parent
ad9ccaa800
commit
b29acbd784
@@ -117,7 +117,7 @@ impl Fsm for NavigateToolFsmState {
|
||||
|
||||
match navigate {
|
||||
ClickZoom { zoom_in } => {
|
||||
responses.add_front(NavigationMessage::TransformCanvasEnd);
|
||||
responses.add_front(NavigationMessage::TransformCanvasEnd { abort_transform: false });
|
||||
|
||||
// Mouse has not moved from pointerdown to pointerup
|
||||
if tool_data.drag_start == input.mouse.position {
|
||||
@@ -146,7 +146,7 @@ impl Fsm for NavigateToolFsmState {
|
||||
}
|
||||
RotateCanvasBegin => {
|
||||
tool_data.drag_start = input.mouse.position;
|
||||
responses.add_front(NavigationMessage::RotateCanvasBegin);
|
||||
responses.add_front(NavigationMessage::RotateCanvasBegin { was_dispatched_from_menu: false });
|
||||
NavigateToolFsmState::Tilting
|
||||
}
|
||||
ZoomCanvasBegin => {
|
||||
@@ -155,11 +155,11 @@ impl Fsm for NavigateToolFsmState {
|
||||
NavigateToolFsmState::Zooming
|
||||
}
|
||||
TransformCanvasEnd => {
|
||||
responses.add_front(NavigationMessage::TransformCanvasEnd);
|
||||
responses.add_front(NavigationMessage::TransformCanvasEnd { abort_transform: false });
|
||||
NavigateToolFsmState::Ready
|
||||
}
|
||||
Abort => {
|
||||
responses.add_front(NavigationMessage::TransformCanvasEnd);
|
||||
responses.add_front(NavigationMessage::TransformCanvasEnd { abort_transform: false });
|
||||
NavigateToolFsmState::Ready
|
||||
}
|
||||
}
|
||||
@@ -173,8 +173,12 @@ impl Fsm for NavigateToolFsmState {
|
||||
NavigateToolFsmState::Ready => HintData(vec![
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::Lmb, "Zoom In"), HintInfo::keys([Key::Shift], "Zoom Out").prepend_plus()]),
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::LmbDrag, "Zoom"), HintInfo::keys([Key::Control], "Snap Increments").prepend_plus()]),
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::MmbDrag, "Pan")]),
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::RmbDrag, "Tilt"), HintInfo::keys([Key::Control], "Snap 15°").prepend_plus()]),
|
||||
HintGroup(vec![
|
||||
HintInfo::mouse(MouseMotion::LmbDrag, " "),
|
||||
HintInfo::keys([Key::Space], "Or").prepend_plus(),
|
||||
HintInfo::mouse(MouseMotion::MmbDrag, "Pan"),
|
||||
]),
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::LmbDrag, ""), HintInfo::keys([Key::Alt], "Tilt").prepend_plus()]),
|
||||
]),
|
||||
NavigateToolFsmState::Tilting => HintData(vec![HintGroup(vec![HintInfo::keys([Key::Control], "Snap 15°")])]),
|
||||
NavigateToolFsmState::Zooming => HintData(vec![HintGroup(vec![HintInfo::keys([Key::Control], "Snap Increments")])]),
|
||||
|
||||
Reference in New Issue
Block a user