~mutse-young/ubuntu-docviewer-app/trunk

« back to all changes in this revision

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

  • Committer: Olivier Tilloy
  • Date: 2013-04-08 09:23:50 UTC
  • mto: (1.2.1 ubuntu-phone-commons)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: olivier.tilloy@canonical.com-20130408092350-vu2pjxt64ahgm2m6
Set split mode for bzr builddeb plugin
(see http://jameswestby.net/bzr/builddeb/user_manual/split.html).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.3
2
 
import Ubuntu.Components 1.1
3
 
import Ubuntu.Components.Popups 1.0
4
 
 
5
 
Dialog {
6
 
    id: goToPageDialogue
7
 
 
8
 
    property ListView view
9
 
 
10
 
    title: i18n.tr("Go to page")
11
 
    text: i18n.tr("Choose a page between 1 and %1").arg(pdfView.count)
12
 
 
13
 
    TextField {
14
 
        id: goToPageTextField
15
 
 
16
 
        width: parent.width
17
 
 
18
 
        hasClearButton: true
19
 
        inputMethodHints: Qt.ImhFormattedNumbersOnly
20
 
        validator: IntValidator{ bottom: 1; top: view.count }
21
 
 
22
 
        Keys.onReturnPressed: goToPage()
23
 
        Component.onCompleted: forceActiveFocus()
24
 
    }
25
 
 
26
 
    Button {
27
 
        text: i18n.tr("GO!")
28
 
        color: UbuntuColors.orange
29
 
 
30
 
        enabled: goToPageTextField.acceptableInput
31
 
        onClicked: goToPage()
32
 
    }
33
 
 
34
 
    Button {
35
 
        text: i18n.tr("Cancel")
36
 
        onClicked: PopupUtils.close(goToPageDialogue)
37
 
    }
38
 
 
39
 
    function goToPage() {
40
 
        view.positionViewAtIndex((goToPageTextField.text - 1), ListView.Beginning)
41
 
        PopupUtils.close(goToPageDialogue)
42
 
    }
43
 
}