Allow to stop the clearing action

Closes #1
This commit is contained in:
Andrea Scarpino 2014-11-16 10:24:24 +01:00
parent 69187f4bc0
commit 3522f8f8b9
2 changed files with 14 additions and 1 deletions

View file

@ -54,6 +54,7 @@ Page {
canvas.strokeStyle = defaultStrokeColor; canvas.strokeStyle = defaultStrokeColor;
} }
// Remember the stroke/rubber size
var currentLineWidth = size.value; var currentLineWidth = size.value;
size.value = prevLineWidth; size.value = prevLineWidth;
prevLineWidth = currentLineWidth; prevLineWidth = currentLineWidth;
@ -81,7 +82,11 @@ Page {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
canvas.clear(); clear.execute(menu, qsTr("Clearing the canvas..."), function() { canvas.clear() });
}
RemorseItem {
id: clear
} }
} }
} }

View file

@ -9,4 +9,12 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="84"/>
<source>Clearing the canvas...</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS> </TS>