Commit ab18f6c7 authored by Andrea Scarpino's avatar Andrea Scarpino

Disable gestures (fixes #7)

parent 4b68423b
......@@ -7,7 +7,6 @@ SOURCES += \
OTHER_FILES += \
qml/cover/CoverPage.qml \
translations/*.ts \
qml/pages/MainPage.qml \
qml/Papocchio.qml \
harbour-papocchio.desktop \
......
......@@ -31,22 +31,21 @@ Page {
Row {
id: menu
spacing: Theme.paddingSmall
spacing: Theme.paddingMedium
width: parent.width
// Workaround: we don't want the Slider animation to resize this!
height: Theme.itemSizeMedium
IconTextSwitch {
IconButton {
id: edit
checked: true
icon.source: "image://theme/icon-s-edit"
anchors.verticalCenter: parent.verticalCenter
width: 120
width: 50
// default value for the rubber
property real prevLineWidth: defaultRubberSize;
onCheckedChanged: {
onClicked: {
if (canvas.strokeStyle == defaultStrokeColor) {
icon.source = "image://theme/icon-camera-focus"
canvas.strokeStyle = defaultFillColor;
......@@ -62,6 +61,28 @@ Page {
}
}
IconButton {
id: save
icon.source: "image://theme/icon-m-image"
anchors.verticalCenter: parent.verticalCenter
width: 50
function pictureName() {
var dateTime = new Date();
return Qt.formatDateTime(dateTime, "yyyy-MM-dd-hh-mm-ss") + ".jpeg";
}
onClicked: {
remorseSave.execute(menu, qsTr("Saving the canvas..."), function() {
canvas.save(papocchioDir + pictureName());
}, 3000);
}
RemorseItem {
id: remorseSave
}
}
Slider {
id: size
minimumValue: 1
......@@ -69,8 +90,7 @@ Page {
stepSize: 1
value: defaultStrokeSize
valueText: value
width: parent.width - edit.width - save.width - clearBtn.width
width: parent.width - edit.width - save.width - clearBtn.width - quit.width - (Theme.paddingMedium * 4)
anchors.verticalCenter: parent.verticalCenter
// Don't waste space
......@@ -83,39 +103,36 @@ Page {
}
IconButton {
id: save
icon.source: "image://theme/icon-m-image"
id: clearBtn
icon.source: "image://theme/icon-m-clear"
anchors.verticalCenter: parent.verticalCenter
function pictureName() {
var dateTime = new Date();
return Qt.formatDateTime(dateTime, "yyyy-MM-dd-hh-mm-ss") + ".jpeg";
}
width: 50
onClicked: {
remorseSave.execute(menu, qsTr("Saving the canvas..."), function() {
canvas.save(papocchioDir + pictureName());
remorseClear.execute(menu, qsTr("Clearing the canvas..."), function() {
canvas.clear();
}, 3000);
}
RemorseItem {
id: remorseSave
id: remorseClear
}
}
IconButton {
id: clearBtn
icon.source: "image://theme/icon-m-clear"
id: quit
icon.source: "image://theme/icon-m-close"
anchors.verticalCenter: parent.verticalCenter
width: 50
onClicked: {
remorseClear.execute(menu, qsTr("Clearing the canvas..."), function() {
canvas.clear();
}, 3000);
remorseQuit.execute(menu, qsTr("Quitting..."), function() {
Qt.quit();
}, 1000);
}
RemorseItem {
id: remorseClear
id: remorseQuit
}
}
}
......
* Fri Jun 03 2016 Andrea Scarpino <me@andreascarpino.it> 1.3-1
- Disable gestures.
- Add Czech translation.
* Sat Sep 12 2015 Andrea Scarpino <me@andreascarpino.it> 1.2-1
- Add Italian translation.
- Set clearing remorse action timeout to 3s.
......
......@@ -13,7 +13,7 @@ Name: harbour-papocchio
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Paint using your finger
Version: 1.2
Version: 1.3
Release: 1
Group: Qt/Qt
License: GPLv3
......
Name: harbour-papocchio
Summary: Paint using your finger
Version: 1.2
Version: 1.3
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
......
......@@ -38,6 +38,12 @@ int main(int argc, char *argv[])
view->setPersistentOpenGLContext(true);
view->setPersistentSceneGraph(true);
// Disable swipe gestures in proper way
view->setFlags(view->flags()|Qt::WindowOverridesSystemGestures);
// Make Qt.quit() work from QML
QObject::connect(view->engine(), &QQmlEngine::quit, app.data(), &QCoreApplication::quit);
view->rootContext()->setContextProperty("papocchioDir", papocchioDir());
view->show();
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>CoverPage</name>
<message>
<location filename="../qml/cover/CoverPage.qml" line="25"/>
<source>Draw!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="76"/>
<source>Saving the canvas...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="112"/>
<source>Clearing the canvas...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Quitting...</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" ?><!DOCTYPE TS><TS language="cs" version="2.1">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="cs">
<context>
<name>CoverPage</name>
<message>
......@@ -10,14 +12,19 @@
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="96"/>
<location filename="../qml/pages/MainPage.qml" line="76"/>
<source>Saving the canvas...</source>
<translation>Ukládá se plátno...</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="112"/>
<source>Clearing the canvas...</source>
<translation>Vyprazdňuje se plátno...</translation>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Quitting...</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
\ No newline at end of file
</TS>
......@@ -12,7 +12,7 @@
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="96"/>
<location filename="../qml/pages/MainPage.qml" line="76"/>
<source>Saving the canvas...</source>
<translation type="unfinished"></translation>
</message>
......@@ -21,5 +21,10 @@
<source>Clearing the canvas...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Quitting...</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment