Debian Codegraph @

qml/components/Information.qml

raw
1 import QtQuick 2.12
2 import Lomiri.Components 1.3
3 import QtQuick.Window 2.2
4 import QtSensors 5.4
5
6 Page {
7 id:_infoPage
8
9 signal back();
10
11 height: parent.height ;//infoHeader.height + aboutCloumn.height + infoLinksList.height
12
13 header: PageHeader {
14 id:infoHeader
15 StyleHints {
16 backgroundColor:"transparent"
17 foregroundColor: theme.palette.normal.backgroundText
18 }
19
20 title: i18n.tr("About")
21
22 leadingActionBar.actions: [
23 Action {
24 iconName: "back"
25 text: i18n.tr("Back")
26 onTriggered: _infoPage.back();
27 }
28 ]
29 }
30
31 property bool portrait: (Screen.orientation == Qt.PortraitOrientation || Screen.orientation == Qt.InvertedPortraitOrientation)
32
33 transitions: [
34 Transition {
35 NumberAnimation { properties: "width,height,x,y"; duration: LomiriAnimation.FastDuration}
36 }
37 ]
38
39 states: [
40 State {
41 name: "landscape"
42 when: !infoPage.portrait
43
44 PropertyChanges {
45 target: aboutCloumn
46 width: parent.width/2
47 }
48
49 AnchorChanges {
50 target: aboutCloumn
51 anchors {
52 top:infoHeader.bottom
53 left: parent.left
54 right: undefined
55 bottom:parent.bottom
56 }
57 }
58
59 AnchorChanges {
60 target: infoLinksList
61 anchors {
62 top:infoHeader.bottom
63 left: aboutCloumn.right
64 right: parent.right
65 bottom:parent.bottom
66 }
67 }
68 }
69 ]
70
71 ListModel {
72 id: infoModel
73 }
74
75 Component.onCompleted: {
76 infoModel.append({ name: i18n.tr("Get the source"), url: "https://gitlab.com/ubports/development/apps/lomiri-camera-app" })
77 infoModel.append({ name: i18n.tr("Report issues"), url: "https://gitlab.com/ubports/development/apps/lomiri-camera-app/issues" })
78 infoModel.append({ name: i18n.tr("Help translate"), url: "https://translate.ubports.com/projects/ubports/lomiri-camera-app/" })
79 }
80
81 Column {
82 id: aboutCloumn
83 anchors.top: infoHeader.bottom
84 anchors.topMargin: units.gu(2)
85 spacing:units.dp(2)
86 width:parent.width
87 height:units.gu(33)
88
89 Icon {
90 anchors.horizontalCenter: parent.horizontalCenter
91 height: Math.min(parent.width/2, parent.height/2)
92 width:height
93 source:"../../assets/lomiri-camera-app.svg"
94 layer.enabled: true
95 layer.effect: LomiriShapeOverlay {
96 relativeRadius: 0.75
97 }
98 }
99
100 Label {
101 width: parent.width
102 font.pixelSize: units.gu(5)
103 font.bold: true
104 color: theme.palette.normal.backgroundText
105 horizontalAlignment: Text.AlignHCenter
106 text: i18n.tr("Camera")
107 }
108 Label {
109 width: parent.width
110 color: theme.palette.normal.backgroundSecondaryText
111 horizontalAlignment: Text.AlignHCenter
112 text: i18n.tr("Version %1").arg(Qt.application.version)
113 }
114
115 }
116
117 LomiriListView {
118 id:infoLinksList
119 height:units.gu(35)
120 anchors {
121 top: aboutCloumn.bottom
122 bottom: parent.bottom
123 left: parent.left
124 right: parent.right
125 }
126
127 currentIndex: -1
128 interactive: false
129
130 model :infoModel
131 delegate: ListItem {
132 highlightColor:theme.palette.highlighted.backgroundText
133 ListItemLayout {
134 title.text : model.name
135 title.color: theme.palette.normal.backgroundText
136 Icon {
137 width:units.gu(2)
138 name:"go-next"
139 }
140 }
141
142 onClicked: Qt.openUrlExternally(model.url)
143
144 }
145 }
146
147 }