File: Information.qml

package info (click to toggle)
lomiri-camera-app 4.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,092 kB
  • sloc: cpp: 1,671; javascript: 27; makefile: 16; sh: 12
file content (148 lines) | stat: -rw-r--r-- 4,139 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import QtQuick 2.12
import Lomiri.Components 1.3
import QtQuick.Window 2.2
import QtSensors 5.4

Page {
    id:_infoPage

    signal back();

    height: parent.height ;//infoHeader.height + aboutCloumn.height + infoLinksList.height

    header: PageHeader {
        id:infoHeader
        StyleHints {
            backgroundColor:"transparent"
            foregroundColor: theme.palette.normal.backgroundText
        }

        title: i18n.tr("About")

        leadingActionBar.actions: [
               Action {
                   iconName: "back"
                   text: i18n.tr("Back")
                   onTriggered: _infoPage.back();
               }
           ]
    }

    property bool portrait: (Screen.orientation == Qt.PortraitOrientation || Screen.orientation == Qt.InvertedPortraitOrientation)

    transitions: [
        Transition {
            NumberAnimation { properties: "width,height,x,y"; duration: LomiriAnimation.FastDuration}
        }
    ]

    states: [
        State {
            name: "landscape"
            when: !infoPage.portrait

            PropertyChanges {
                target: aboutCloumn
                width: parent.width/2
            }

            AnchorChanges {
                target: aboutCloumn
                anchors {
                    top:infoHeader.bottom
                    left: parent.left
                    right: undefined
                    bottom:parent.bottom
                }
            }

            AnchorChanges {
                target: infoLinksList
                anchors {
                    top:infoHeader.bottom
                    left: aboutCloumn.right
                    right: parent.right
                    bottom:parent.bottom
                }
            }
        }
    ]

    ListModel {
        id: infoModel
    }

    Component.onCompleted: {
        infoModel.append({ name: i18n.tr("Get the source"), url: "https://gitlab.com/ubports/development/apps/lomiri-camera-app" })
        infoModel.append({ name: i18n.tr("Report issues"), url: "https://gitlab.com/ubports/development/apps/lomiri-camera-app/issues" })
        infoModel.append({ name: i18n.tr("Help translate"), url: "https://translate.ubports.com/projects/ubports/lomiri-camera-app/" })
    }

    Column {
        id: aboutCloumn
        anchors.top: infoHeader.bottom
        anchors.topMargin: units.gu(2)
        spacing:units.dp(2)
        width:parent.width
        height:units.gu(33)

        Icon {
            anchors.horizontalCenter: parent.horizontalCenter
            height: Math.min(parent.width/2, parent.height/2)
            width:height
            name:"lomiri-camera-app"
            layer.enabled: true
            layer.effect: LomiriShapeOverlay {
                relativeRadius: 0.75
            }
        }

        Label {
            width: parent.width
            font.pixelSize: units.gu(5)
            font.bold: true
            color: theme.palette.normal.backgroundText
            horizontalAlignment: Text.AlignHCenter
            text: i18n.tr("Camera")
        }
        Label {
            width: parent.width
            color: theme.palette.normal.backgroundSecondaryText
            horizontalAlignment: Text.AlignHCenter
            //TODO find a way to retirve the version from the manifest file
            text: "";//i18n.tr("Version %1").arg("3.0.1.747")
        }

    }

    LomiriListView {
        id:infoLinksList
        height:units.gu(35)
        anchors {
            top: aboutCloumn.bottom
            bottom: parent.bottom
            left: parent.left
            right: parent.right
        }

        currentIndex: -1
        interactive: false

         model :infoModel
         delegate: ListItem {
             highlightColor:theme.palette.highlighted.backgroundText
             ListItemLayout {
                title.text : model.name
                title.color: theme.palette.normal.backgroundText
                Icon {
                   width:units.gu(2)
                   name:"go-next"
               }
            }

            onClicked: Qt.openUrlExternally(model.url)

         }
    }

}