Disable gestures (fixes #7)

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

View file

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

View file

@ -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,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 {
id: save
icon.source: "image://theme/icon-m-image"
anchors.verticalCenter: parent.verticalCenter
width: 50
function pictureName() {
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 {
id: clearBtn
icon.source: "image://theme/icon-m-clear"
anchors.verticalCenter: parent.verticalCenter
width: 50
onClicked: {
remorseClear.execute(menu, qsTr("Clearing the canvas..."), function() {
@ -118,6 +118,23 @@ Page {
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 {

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
- Add Italian translation.
- Set clearing remorse action timeout to 3s.

View file

@ -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

View file

@ -1,6 +1,6 @@
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

View file

@ -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();

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>
<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>
</TS>

View file

@ -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>