Disable gestures (fixes #7)

This commit is contained in:
Andrea Scarpino 2016-06-03 22:59:10 +02:00
parent 4b68423bdd
commit ab18f6c72b
9 changed files with 102 additions and 34 deletions

View file

@ -7,7 +7,6 @@ SOURCES += \
OTHER_FILES += \ OTHER_FILES += \
qml/cover/CoverPage.qml \ qml/cover/CoverPage.qml \
translations/*.ts \
qml/pages/MainPage.qml \ qml/pages/MainPage.qml \
qml/Papocchio.qml \ qml/Papocchio.qml \
harbour-papocchio.desktop \ harbour-papocchio.desktop \

View file

@ -31,22 +31,21 @@ Page {
Row { Row {
id: menu id: menu
spacing: Theme.paddingSmall spacing: Theme.paddingMedium
width: parent.width width: parent.width
// Workaround: we don't want the Slider animation to resize this! // Workaround: we don't want the Slider animation to resize this!
height: Theme.itemSizeMedium height: Theme.itemSizeMedium
IconTextSwitch { IconButton {
id: edit id: edit
checked: true
icon.source: "image://theme/icon-s-edit" icon.source: "image://theme/icon-s-edit"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 120 width: 50
// default value for the rubber // default value for the rubber
property real prevLineWidth: defaultRubberSize; property real prevLineWidth: defaultRubberSize;
onCheckedChanged: { onClicked: {
if (canvas.strokeStyle == defaultStrokeColor) { if (canvas.strokeStyle == defaultStrokeColor) {
icon.source = "image://theme/icon-camera-focus" icon.source = "image://theme/icon-camera-focus"
canvas.strokeStyle = defaultFillColor; canvas.strokeStyle = defaultFillColor;
@ -62,30 +61,11 @@ Page {
} }
} }
Slider {
id: size
minimumValue: 1
maximumValue: 30
stepSize: 1
value: defaultStrokeSize
valueText: value
width: parent.width - edit.width - save.width - clearBtn.width
anchors.verticalCenter: parent.verticalCenter
// Don't waste space
leftMargin: 0
rightMargin: 0
onValueChanged: {
valueText = canvas.lineWidth = value;
}
}
IconButton { IconButton {
id: save id: save
icon.source: "image://theme/icon-m-image" icon.source: "image://theme/icon-m-image"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 50
function pictureName() { function pictureName() {
var dateTime = new Date(); var dateTime = new Date();
@ -103,10 +83,30 @@ Page {
} }
} }
Slider {
id: size
minimumValue: 1
maximumValue: 30
stepSize: 1
value: defaultStrokeSize
valueText: value
width: parent.width - edit.width - save.width - clearBtn.width - quit.width - (Theme.paddingMedium * 4)
anchors.verticalCenter: parent.verticalCenter
// Don't waste space
leftMargin: 0
rightMargin: 0
onValueChanged: {
valueText = canvas.lineWidth = value;
}
}
IconButton { IconButton {
id: clearBtn id: clearBtn
icon.source: "image://theme/icon-m-clear" icon.source: "image://theme/icon-m-clear"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 50
onClicked: { onClicked: {
remorseClear.execute(menu, qsTr("Clearing the canvas..."), function() { remorseClear.execute(menu, qsTr("Clearing the canvas..."), function() {
@ -118,6 +118,23 @@ Page {
id: remorseClear id: remorseClear
} }
} }
IconButton {
id: quit
icon.source: "image://theme/icon-m-close"
anchors.verticalCenter: parent.verticalCenter
width: 50
onClicked: {
remorseQuit.execute(menu, qsTr("Quitting..."), function() {
Qt.quit();
}, 1000);
}
RemorseItem {
id: remorseQuit
}
}
} }
Rectangle { Rectangle {

View file

@ -1,3 +1,7 @@
* 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 * Sat Sep 12 2015 Andrea Scarpino <me@andreascarpino.it> 1.2-1
- Add Italian translation. - Add Italian translation.
- Set clearing remorse action timeout to 3s. - Set clearing remorse action timeout to 3s.

View file

@ -13,7 +13,7 @@ Name: harbour-papocchio
%{!?qtc_make:%define qtc_make make} %{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir} %{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Paint using your finger Summary: Paint using your finger
Version: 1.2 Version: 1.3
Release: 1 Release: 1
Group: Qt/Qt Group: Qt/Qt
License: GPLv3 License: GPLv3

View file

@ -1,6 +1,6 @@
Name: harbour-papocchio Name: harbour-papocchio
Summary: Paint using your finger Summary: Paint using your finger
Version: 1.2 Version: 1.3
Release: 1 Release: 1
# The contents of the Group field should be one of the groups listed here: # 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 # http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS

View file

@ -38,6 +38,12 @@ int main(int argc, char *argv[])
view->setPersistentOpenGLContext(true); view->setPersistentOpenGLContext(true);
view->setPersistentSceneGraph(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->rootContext()->setContextProperty("papocchioDir", papocchioDir());
view->show(); view->show();

View file

@ -0,0 +1,30 @@
<?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>

View file

@ -1,4 +1,6 @@
<?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> <context>
<name>CoverPage</name> <name>CoverPage</name>
<message> <message>
@ -10,14 +12,19 @@
<context> <context>
<name>MainPage</name> <name>MainPage</name>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="96"/> <location filename="../qml/pages/MainPage.qml" line="76"/>
<source>Saving the canvas...</source> <source>Saving the canvas...</source>
<translation>Ukládá se plátno...</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="112"/> <location filename="../qml/pages/MainPage.qml" line="112"/>
<source>Clearing the canvas...</source> <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> </message>
</context> </context>
</TS> </TS>

View file

@ -12,7 +12,7 @@
<context> <context>
<name>MainPage</name> <name>MainPage</name>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="96"/> <location filename="../qml/pages/MainPage.qml" line="76"/>
<source>Saving the canvas...</source> <source>Saving the canvas...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -21,5 +21,10 @@
<source>Clearing the canvas...</source> <source>Clearing the canvas...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="../qml/pages/MainPage.qml" line="129"/>
<source>Quitting...</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>