Implement multiple clipboards (#425)

* Imeplement multiple Clipboards

* Cargo fmt

* Fix unit tests

* Fix console error caused by the Pen Tool (#432)

* Fix error in pen tool

* Cleanup

* Split make operation and remove preview

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix line centering (#431)

* cargo fmt

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
This commit is contained in:
TrueDoctor
2021-12-28 06:17:41 +01:00
committed by Keavon Chambers
parent e09a606285
commit 1eb83d92c4
5 changed files with 80 additions and 29 deletions

View File

@@ -4,6 +4,7 @@ use super::{
keyboard::{Key, KeyStates, NUMBER_OF_KEYS},
InputPreprocessor,
};
use crate::document::Clipboard::*;
use crate::message_prelude::*;
use crate::tool::ToolType;
@@ -133,7 +134,7 @@ impl Default for Mapping {
// it as an available action in the respective message handler file (such as the bottom of `document_message_handler.rs`)
let mappings = mapping![
// Higher priority than entries in sections below
entry! {action=DocumentsMessage::Paste, key_down=KeyV, modifiers=[KeyControl]},
entry! {action=DocumentsMessage::Paste(User), key_down=KeyV, modifiers=[KeyControl]},
entry! {action=MovementMessage::EnableSnapping, key_down=KeyShift},
entry! {action=MovementMessage::DisableSnapping, key_up=KeyShift},
// Transform layers
@@ -207,7 +208,7 @@ impl Default for Mapping {
// Editor Actions
entry! {action=FrontendMessage::OpenDocumentBrowse, key_down=KeyO, modifiers=[KeyControl]},
// Document Actions
entry! {action=DocumentsMessage::Paste, key_down=KeyV, modifiers=[KeyControl]},
entry! {action=DocumentsMessage::Paste(User), key_down=KeyV, modifiers=[KeyControl]},
entry! {action=DocumentMessage::Redo, key_down=KeyZ, modifiers=[KeyControl, KeyShift]},
entry! {action=DocumentMessage::Undo, key_down=KeyZ, modifiers=[KeyControl]},
entry! {action=DocumentMessage::DeselectAllLayers, key_down=KeyA, modifiers=[KeyControl, KeyAlt]},
@@ -252,7 +253,7 @@ impl Default for Mapping {
entry! {action=DocumentsMessage::CloseAllDocumentsWithConfirmation, key_down=KeyW, modifiers=[KeyControl, KeyAlt]},
entry! {action=DocumentsMessage::CloseActiveDocumentWithConfirmation, key_down=KeyW, modifiers=[KeyControl]},
entry! {action=DocumentMessage::DuplicateSelectedLayers, key_down=KeyD, modifiers=[KeyControl]},
entry! {action=DocumentsMessage::Copy, key_down=KeyC, modifiers=[KeyControl]},
entry! {action=DocumentsMessage::Copy(User), key_down=KeyC, modifiers=[KeyControl]},
entry! {action=DocumentMessage::GroupSelectedLayers, key_down=KeyG, modifiers=[KeyControl]},
// Nudging
entry! {action=DocumentMessage::NudgeSelectedLayers(-SHIFT_NUDGE_AMOUNT, -SHIFT_NUDGE_AMOUNT), key_down=KeyArrowUp, modifiers=[KeyShift, KeyArrowLeft]},