~verzegnassi-stefano/ubuntu-docviewer-app/reboot-lok-zoom-leak

« back to all changes in this revision

Viewing changes to src/app/qml/loView/LOViewDefaultHeader.qml

  • Committer: Tarmac
  • Author(s): Roman Shchekin, Stefano Verzegnassi
  • Date: 2015-10-11 19:51:03 UTC
  • mfrom: (172.4.9 reboot-qsg-impress-support)
  • Revision ID: tarmac-20151011195103-st3zu274xl8v8o7h
RenderEngine - impress support.

Approved by Ubuntu Phone Apps Jenkins Bot, Stefano Verzegnassi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import QtQuick 2.3
18
18
import Ubuntu.Components 1.1
19
 
import QtQuick.Layouts 1.1
20
19
import Ubuntu.Components.Popups 1.0
21
20
import DocumentViewer.LibreOffice 1.0 as LibreOffice
22
21
 
24
23
    id: rootItem
25
24
 
26
25
    property Page targetPage
27
 
    property alias activityRunning: activity.running
28
 
 
29
26
    head: targetPage.head
30
27
 
31
 
    contents: RowLayout {
32
 
        anchors.fill: parent
33
 
        spacing: units.gu(1)
34
 
 
35
 
        ActivityIndicator { id: activity }
36
 
 
37
 
        Column {
38
 
            id: layout
39
 
            Layout.fillWidth: true
40
 
 
41
 
            Label {
42
 
                width: parent.width
43
 
                //horizontalAlignment: Text.AlignHCenter
44
 
                elide: Text.ElideMiddle
45
 
 
46
 
                font.weight: Font.DemiBold
47
 
                text: targetPage.title
48
 
            }
49
 
            Label {
50
 
                width: parent.width
51
 
                //horizontalAlignment: Text.AlignHCenter
52
 
                elide: Text.ElideMiddle
53
 
 
54
 
                fontSize: "small"
55
 
                text: {
56
 
                    if (!loPageContentLoader.item)
57
 
                        return i18n.tr("Loading...")
58
 
 
59
 
                    switch(loPageContentLoader.item.loDocument.documentType) {
60
 
                    case 0:
61
 
                        return i18n.tr("LibreOffice text document")
62
 
                    case 1:
63
 
                        return i18n.tr("LibreOffice spread sheet")
64
 
                    case 2:
65
 
                        return i18n.tr("LibreOffice presentation")
66
 
                    case 3:
67
 
                        return i18n.tr("LibreOffice Draw document")
68
 
                    case 4:
69
 
                        return i18n.tr("Unknown LibreOffice document")
70
 
                    default:
71
 
                        return i18n.tr("Unknown type document")
72
 
                    }
 
28
    contents: Column {
 
29
        anchors {
 
30
            left: parent.left
 
31
            right: parent.right
 
32
            verticalCenter: parent.verticalCenter
 
33
        }
 
34
 
 
35
        Label {
 
36
            anchors { left: parent.left; right: parent.right }
 
37
            elide: Text.ElideMiddle
 
38
            font.weight: Font.DemiBold
 
39
            text: targetPage.title
 
40
        }
 
41
        Label {
 
42
            anchors { left: parent.left; right: parent.right }
 
43
            elide: Text.ElideMiddle
 
44
            fontSize: "small"
 
45
            text: {
 
46
                if (!loPageContentLoader.item)
 
47
                    return i18n.tr("Loading...")
 
48
 
 
49
                switch(loPageContentLoader.item.loDocument.documentType) {
 
50
                case 0:
 
51
                    return i18n.tr("LibreOffice text document")
 
52
                case 1:
 
53
                    return i18n.tr("LibreOffice spread sheet")
 
54
                case 2:
 
55
                    return i18n.tr("LibreOffice presentation")
 
56
                case 3:
 
57
                    return i18n.tr("LibreOffice Draw document")
 
58
                case 4:
 
59
                    return i18n.tr("Unknown LibreOffice document")
 
60
                default:
 
61
                    return i18n.tr("Unknown type document")
73
62
                }
74
63
            }
75
64
        }
76
65
    }
77
66
 
 
67
 
78
68
    backAction: Action {
79
69
        iconName: "back"
80
70
        text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
102
92
            iconName: "browser-tabs"
103
93
            text: i18n.tr("Go to position...")
104
94
            onTriggered: PopupUtils.open(Qt.resolvedUrl("LOViewGotoDialog.qml"), targetPage)
105
 
            visible: loDocument.documentType == LibreOffice.Document.TextDocument
 
95
            visible: loPageContentLoader.item.loDocument.documentType == LibreOffice.Document.TextDocument
106
96
        },
107
97
 
108
98
        Action {