Fix Text tool clearing text when hitting Escape by changing it to commit the edit instead (#2052)
* Text tool escape sends commit message * Improve hint text --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
79408fc0cc
commit
63d44f22e3
|
|
@ -151,7 +151,7 @@ pub fn input_mappings() -> Mapping {
|
|||
//
|
||||
// TextToolMessage
|
||||
entry!(KeyUp(MouseLeft); action_dispatch=TextToolMessage::Interact),
|
||||
entry!(KeyDown(Escape); action_dispatch=TextToolMessage::Abort),
|
||||
entry!(KeyDown(Escape); action_dispatch=TextToolMessage::CommitText),
|
||||
entry!(KeyDown(Enter); modifiers=[Accel], action_dispatch=TextToolMessage::CommitText),
|
||||
//
|
||||
// GradientToolMessage
|
||||
|
|
|
|||
|
|
@ -496,10 +496,10 @@ impl Fsm for TextToolFsmState {
|
|||
HintGroup(vec![HintInfo::mouse(MouseMotion::Lmb, "Place Text")]),
|
||||
HintGroup(vec![HintInfo::mouse(MouseMotion::Lmb, "Edit Text")]),
|
||||
]),
|
||||
TextToolFsmState::Editing => HintData(vec![
|
||||
HintGroup(vec![HintInfo::keys([Key::Escape], "Discard Changes")]),
|
||||
HintGroup(vec![HintInfo::keys([Key::Control, Key::Enter], "Commit Changes").add_mac_keys([Key::Command, Key::Enter])]),
|
||||
]),
|
||||
TextToolFsmState::Editing => HintData(vec![HintGroup(vec![
|
||||
HintInfo::keys([Key::Control, Key::Enter], "").add_mac_keys([Key::Command, Key::Enter]),
|
||||
HintInfo::keys([Key::Escape], "Commit Changes").prepend_slash(),
|
||||
])]),
|
||||
};
|
||||
|
||||
responses.add(FrontendMessage::UpdateInputHints { hint_data });
|
||||
|
|
|
|||
Loading…
Reference in New Issue