diff --git a/src/QuickEditor/EditorRoot.qml b/src/QuickEditor/EditorRoot.qml --- a/src/QuickEditor/EditorRoot.qml +++ b/src/QuickEditor/EditorRoot.qml @@ -38,6 +38,7 @@ property int magZoom: 5; property int magPixels: 16; property int magOffset: 32; + property int largeMove: 20; SystemPalette { id: systemPalette; @@ -80,9 +81,44 @@ Keys.onPressed: { if (event.modifiers & Qt.ShiftModifier) { toggleMagnifier = true; - cropDisplayCanvas.requestPaint(); } - } + + // arrow keys to move selection rectangle + if (event.key == Qt.Key_Left) { + selection.x--; + } + + if (event.key == Qt.Key_Right) { + selection.x++; + } + + if (event.key == Qt.Key_Up) { + selection.y--; + } + + if (event.key == Qt.Key_Down) { + selection.y++; + } + + // CTRL + arrow = larger move + if ((event.key == Qt.Key_Left) && (event.modifiers & Qt.ControlModifier)) { + selection.x = selection.x - largeMove; + + } if ((event.key == Qt.Key_Right) && (event.modifiers & Qt.ControlModifier)) { + selection.x = selection.x + largeMove; + } + + if ((event.key == Qt.Key_Up) && (event.modifiers & Qt.ControlModifier)) { + selection.y = selection.y - largeMove; + } + + if ((event.key == Qt.Key_Down) && (event.modifiers & Qt.ControlModifier)) { + selection.y = selection.y + largeMove; + } + + cropDisplayCanvas.requestPaint(); + + } // end of Keys.onPressed Keys.onReleased: { if (toggleMagnifier && !(event.modifiers & Qt.ShiftModifier)) { @@ -304,6 +340,18 @@ } Label { text: i18n("Hold to toggle magnifier"); } + Label { + text: i18n("Arrow Keys:"); + Layout.alignment: Qt.AlignRight; + } + Label { text: i18n("Hove Selection"); } + + Label { + text: i18n("CTRL + Arrow Keys:"); + Layout.alignment: Qt.AlignRight; + } + Label { text: i18n("Larger Selection Move"); } + Label { text: i18n("Right-click:"); Layout.alignment: Qt.AlignRight; @@ -315,6 +363,8 @@ Layout.alignment: Qt.AlignRight; } Label { text: i18n("Cancel"); } + + } } } @@ -369,7 +419,6 @@ } } - } MouseArea { anchors.fill: imageBackground;