From 18a2e9ae84efb65a1dc25cca09e60e7e5f5fe393 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Fri, 3 Jun 2016 22:59:10 +0200 Subject: [PATCH] Disable gestures (fixes #7) --- Papocchio.pro | 1 - qml/pages/MainPage.qml | 67 +++++++++++++++++----------- rpm/harbour-papocchio.changes | 4 ++ rpm/harbour-papocchio.spec | 2 +- rpm/harbour-papocchio.yaml | 2 +- src/main.cpp | 6 +++ translations/harbour-lyrics-it.ts | 30 +++++++++++++ translations/harbour-papocchio-cs.ts | 17 ++++--- translations/harbour-papocchio.ts | 7 ++- 9 files changed, 102 insertions(+), 34 deletions(-) create mode 100644 translations/harbour-lyrics-it.ts diff --git a/Papocchio.pro b/Papocchio.pro index 60b9e97..93460ec 100644 --- a/Papocchio.pro +++ b/Papocchio.pro @@ -7,7 +7,6 @@ SOURCES += \ OTHER_FILES += \ qml/cover/CoverPage.qml \ - translations/*.ts \ qml/pages/MainPage.qml \ qml/Papocchio.qml \ harbour-papocchio.desktop \ diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 73f25d6..f930115 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -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 { diff --git a/rpm/harbour-papocchio.changes b/rpm/harbour-papocchio.changes index 52deca4..a60ebe9 100644 --- a/rpm/harbour-papocchio.changes +++ b/rpm/harbour-papocchio.changes @@ -1,3 +1,7 @@ +* Fri Jun 03 2016 Andrea Scarpino 1.3-1 +- Disable gestures. +- Add Czech translation. + * Sat Sep 12 2015 Andrea Scarpino 1.2-1 - Add Italian translation. - Set clearing remorse action timeout to 3s. diff --git a/rpm/harbour-papocchio.spec b/rpm/harbour-papocchio.spec index c8cbd3d..e56f66d 100644 --- a/rpm/harbour-papocchio.spec +++ b/rpm/harbour-papocchio.spec @@ -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 diff --git a/rpm/harbour-papocchio.yaml b/rpm/harbour-papocchio.yaml index 2904b97..e217902 100644 --- a/rpm/harbour-papocchio.yaml +++ b/rpm/harbour-papocchio.yaml @@ -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 diff --git a/src/main.cpp b/src/main.cpp index 17e9c3c..4808116 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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(); diff --git a/translations/harbour-lyrics-it.ts b/translations/harbour-lyrics-it.ts new file mode 100644 index 0000000..a742209 --- /dev/null +++ b/translations/harbour-lyrics-it.ts @@ -0,0 +1,30 @@ + + + + + CoverPage + + + Draw! + + + + + MainPage + + + Saving the canvas... + + + + + Clearing the canvas... + + + + + Quitting... + + + + diff --git a/translations/harbour-papocchio-cs.ts b/translations/harbour-papocchio-cs.ts index 409c33b..442d9a9 100644 --- a/translations/harbour-papocchio-cs.ts +++ b/translations/harbour-papocchio-cs.ts @@ -1,4 +1,6 @@ - + + + CoverPage @@ -10,14 +12,19 @@ MainPage - + Saving the canvas... - Ukládá se plátno... + Clearing the canvas... - Vyprazdňuje se plátno... + + + + + Quitting... + - \ No newline at end of file + diff --git a/translations/harbour-papocchio.ts b/translations/harbour-papocchio.ts index 54d2c92..a742209 100644 --- a/translations/harbour-papocchio.ts +++ b/translations/harbour-papocchio.ts @@ -12,7 +12,7 @@ MainPage - + Saving the canvas... @@ -21,5 +21,10 @@ Clearing the canvas... + + + Quitting... + +