~verzegnassi-stefano/ubuntu-docviewer-app/rw-permissions

« back to all changes in this revision

Viewing changes to src/app/qml/PdfViewGotoDialog.qml

  • Committer: Tarmac
  • Author(s): Stefano Verzegnassi
  • Date: 2015-01-30 16:44:24 UTC
  • mfrom: (55.1.4 ubuntu-docviewer-app)
  • Revision ID: tarmac-20150130164424-um7n6rqoionk50sn
Fix code style and use UITK features. Fixes: https://bugs.launchpad.net/bugs/1416068.

Approved by Filippo Scognamiglio, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import Ubuntu.Components.Popups 1.0
20
20
 
21
21
Dialog {
22
 
    id: goToPageDialogue
 
22
    id: goToPageDialog
23
23
    objectName:"PdfViewGotoDialog"
24
24
 
25
 
    property ListView view
26
 
 
27
25
    title: i18n.tr("Go to page")
28
26
    text: i18n.tr("Choose a page between 1 and %1").arg(pdfView.count)
29
27
 
35
33
 
36
34
        hasClearButton: true
37
35
        inputMethodHints: Qt.ImhFormattedNumbersOnly
38
 
        validator: IntValidator{ bottom: 1; top: view.count }
 
36
        validator: IntValidator{ bottom: 1; top: pdfView.count }
39
37
 
40
38
        Keys.onReturnPressed: goToPage()
41
39
        Component.onCompleted: forceActiveFocus()
52
50
 
53
51
    Button {
54
52
        text: i18n.tr("Cancel")
55
 
        onClicked: PopupUtils.close(goToPageDialogue)
 
53
        onClicked: PopupUtils.close(goToPageDialog)
56
54
    }
57
55
 
58
56
    function goToPage() {
59
 
        view.positionViewAtIndex((goToPageTextField.text - 1), ListView.Beginning)
60
 
        PopupUtils.close(goToPageDialogue)
 
57
        pdfView.positionViewAtIndex((goToPageTextField.text - 1), ListView.Beginning)
 
58
        PopupUtils.close(goToPageDialog)
61
59
    }
62
60
}