summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <notmart@gmail.com>2015-09-23 14:14:49 (GMT)
committerMarco Martin <notmart@gmail.com>2015-09-23 14:14:49 (GMT)
commit709121c37cea63479e752362e5b09abff1b8fb66 (patch)
tree26ab406662c1367470de67ec812a22aeb6d4ba9c
parentbb5c4291e28123f48519261327176e93642b06f5 (diff)
better pinch behavior
-rw-r--r--mobile/app/package/contents/ui/Browser.qml23
-rw-r--r--mobile/app/package/contents/ui/FullScreenDelegate.qml7
-rw-r--r--mobile/components/documentitem.cpp2
3 files changed, 21 insertions, 11 deletions
diff --git a/mobile/app/package/contents/ui/Browser.qml b/mobile/app/package/contents/ui/Browser.qml
index 5ebf84b..1ea470f 100644
--- a/mobile/app/package/contents/ui/Browser.qml
+++ b/mobile/app/package/contents/ui/Browser.qml
@@ -95,11 +95,7 @@ MobileComponents.SplitDrawer {
delegate.pageSwitchEnabled = false
if (Math.abs(mouse.screenX - startMouseScreenX) < 20 &&
Math.abs(mouse.screenY - startMouseScreenY) < 20) {
- if (browserFrame.state == "Closed") {
- browserFrame.state = "Hidden"
- } else {
- browserFrame.state = "Closed"
- }
+
} else if (oldDelegate.visible && delegate.delta != 0 &&
(Math.abs(mouse.screenX - startMouseScreenX) > width/5) &&
@@ -128,18 +124,27 @@ MobileComponents.SplitDrawer {
properties: "x"
to: pageArea.incrementing ? -pageArea.oldDelegate.width : pageArea.oldDelegate.width
easing.type: Easing.InQuad
- duration: 250
+ duration: units.longDuration
}
ScriptAction {
script: {
pageArea.oldDelegate.z = 0
pageArea.delegate.z = 10
- pageArea.oldDelegate.x = 0
- pageArea.delegate.x = 0
}
}
+ NumberAnimation {
+ target: pageArea.oldDelegate
+ properties: "x"
+ to: 0
+ easing.type: Easing.InQuad
+ duration: units.longDuration
+ }
ScriptAction {
- script: delegate1.delta = delegate2.delta = 0
+ script: {
+ pageArea.oldDelegate.x = 0
+ pageArea.delegate.x = 0
+ delegate1.delta = delegate2.delta = 0
+ }
}
}
}
diff --git a/mobile/app/package/contents/ui/FullScreenDelegate.qml b/mobile/app/package/contents/ui/FullScreenDelegate.qml
index c4ecfae..2ca1a10 100644
--- a/mobile/app/package/contents/ui/FullScreenDelegate.qml
+++ b/mobile/app/package/contents/ui/FullScreenDelegate.qml
@@ -69,6 +69,9 @@ MouseEventListener {
mainPage.height *= zoom
}
+ pageArea.oldDelegate.pageItem.width = mainPage.width;
+ pageArea.oldDelegate.pageItem.height = mainPage.height;
+
return true
}
@@ -152,6 +155,8 @@ MouseEventListener {
height: parent.height
contentWidth: imageMargin.width
contentHeight: imageMargin.height
+ boundsBehavior: Flickable.DragAndOvershootBounds
+ flickableDirection: Flickable.HorizontalAndVerticalFlick
onContentXChanged: {
if (atXBeginning && contentX < 0) {
@@ -165,7 +170,7 @@ MouseEventListener {
PinchArea {
id: imageMargin
- width: Math.max(mainFlickable.width + (pageSwitchEnabled ? 1: 0), mainPage.width)
+ width: Math.max(mainFlickable.width+1, mainPage.width)
height: Math.max(mainFlickable.height, mainPage.height)
property real startWidth
diff --git a/mobile/components/documentitem.cpp b/mobile/components/documentitem.cpp
index 3282d15..c574290 100644
--- a/mobile/components/documentitem.cpp
+++ b/mobile/components/documentitem.cpp
@@ -63,7 +63,7 @@ void DocumentItem::setPath(const QString &path)
m_tocModel->clear();
m_tocModel->fill(m_document->documentSynopsis());
m_tocModel->setCurrentViewport(m_document->viewport());
-qWarning()<<"LLL"<<m_tocModel->count();
+
m_matchingPages.clear();
for (uint i = 0; i < m_document->pages(); ++i) {
m_matchingPages << (int)i;