9
9
title: Utils.getNameOfFile(file.path);
13
text: i18n.tr("Details")
15
onTriggered: pageStack.push(Qt.resolvedUrl("DetailsPage.qml"))
11
// Disable header auto-hide
14
// TODO: Restore zooming
19
leftMargin: units.gu(2)
20
rightMargin: units.gu(2)
26
boundsBehavior: Flickable.StopAtBounds
30
highlightFollowsCurrentItem: false
31
keyNavigationWraps: false
33
// TODO: Not a good way to have spacing
49
activity.running = false;
51
pdfView.currentIndex = 0
53
var title = getDocumentInfo("Title")
55
titleLabel.text = title
62
/* On resizing window, pages size changes but contentY is still the same.
63
For that reason, it shows the wrong page (which is settled at the same contentY).
64
We need to force flickable to show the current page. */
65
//pdfView.positionViewAtIndex(currentIndex, ListView.Contain)
69
// FIXME: On wheeling up, ListView automatically center currentItem to the view.
70
// This causes some strange "jump" of ~200px in contentY
71
var i = pdfView.indexAt(pdfView.width * 0.5, contentY + (pdfView.height * 0.5))
74
// returned index could be -1 when the delegate spacing is shown at the center of the view (e.g. while scrolling pages)
75
i = pdfView.indexAt(pdfView.width * 0.5, contentY + (pdfView.height * 0.5) + units.gu(4))
79
currentPageLabel.text = i18n.tr("Page %1 of %2").arg(i + 1).arg(pdfView.count)
81
if (!pdfView.flickingVertically) {
82
pdfView.currentIndex = i
90
anchors.centerIn: parent
103
anchors.centerIn: parent
107
text: Utils.getNameOfFile(file.path)
108
font.weight: Font.DemiBold
109
anchors.horizontalCenter: parent.horizontalCenter
113
text: i18n.tr("Page %1 of %2").arg(pdfView.currentIndex + 1).arg(pdfView.count)
115
anchors.horizontalCenter: parent.horizontalCenter
126
// onTriggered: pageMain.state = "search"
127
//Disable it until we provide search in Poppler plugin.
132
iconName: "browser-tabs"
133
text: "Go to page..."
138
text: i18n.tr("Details")
140
onTriggered: pageStack.push(Qt.resolvedUrl("DetailsPage.qml"))
160
id: leaveSearchAction
163
onTriggered: pageMain.state = "default"
23
contentHeight: columnPages.height + 10
24
contentWidth: parent.width
28
anchors.fill: columnPages
30
pinch.target: flickable
32
property real lastWidth
33
/*property real lastHeight
34
property double p1toC_X
35
property double p1toC_Y
36
property double contentInitX
37
property double contentInitY*/
40
lastWidth = flickable.width
42
/*contentInitX = flickImg.contentX
43
contentInitY = flickImg.contentY*/
51
newWidth = lastWidth*pinch.scale;
53
/*if (newWidth < image.startWidth)
54
newWidth = image.startWidth;
55
else if (newWidth > image.sourceSize.width)
56
newWidth = image.sourceSize.width;*/
58
flickable.contentWidth = newWidth;
60
/*flickImg.contentX = contentInitX-(lastWidth-newWidth)/2
61
flickImg.contentY = contentInitY-(lastHeight-image.height)/2*/
67
columnPages.shouldReloadImg = true;
68
console.log("FINISHED");
81
property bool shouldReloadImg : false
83
width: parent.width - 10
89
if (!pinchy.pinch.active)
97
Component.onCompleted: {
100
for(i=1; i <= popplerProp.numPages; i++)
102
var component = Qt.createComponent("PdfPage.qml");
104
if (component.status === Component.Error)
106
console.debug("Error creating component");
110
var page = component.createObject(columnPages);
112
page.source = "image://poppler/page/"+i;