This repository was archived by the owner on Jan 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathInformation.qml
More file actions
155 lines (128 loc) · 3.94 KB
/
Information.qml
File metadata and controls
155 lines (128 loc) · 3.94 KB
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
149
150
151
152
153
154
155
import QtQuick 2.0
import Ubuntu.Components 1.3
import QtQuick.Window 2.2
import QtSensors 5.4
Page {
id:_infoPage
signal back();
height: infoHeader.height + aboutCloumn.height + infoLinksList.height
header: PageHeader {
id:infoHeader
StyleHints {
backgroundColor:"transparent"
foregroundColor:"white"
}
title: i18n.tr("About")
leadingActionBar.actions: [
Action {
iconName: "down"
text: "Back"
onTriggered: _infoPage.back();
}
]
}
property bool portrait: (Screen.orientation == Qt.PortraitOrientation || Screen.orientation == Qt.InvertedPortraitOrientation)
transitions: [
Transition {
NumberAnimation { properties: "width,height,x,y"; duration: UbuntuAnimation.FastDuration}
}
]
states: [
State {
name: "landscape"
when: !infoPage.portrait
PropertyChanges {
target: aboutCloumn
width: parent.width/2
}
PropertyChanges {
target: _infoPage
height:infoHeader.height + aboutCloumn.height
}
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://github.com/ubports/camera-app" })
infoModel.append({ name: i18n.tr("Report issues"), url: "https://github.com/ubports/camera-app/issues/" })
infoModel.append({ name: i18n.tr("Help translate"), url: "https://translate.ubports.com/projects/ubports/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:"camera-app"
layer.enabled: true
layer.effect: UbuntuShapeOverlay {
relativeRadius: 0.75
}
}
Label {
width: parent.width
font.pixelSize: units.gu(5)
font.bold: true
color: UbuntuColors.silk
horizontalAlignment: Text.AlignHCenter
text: "Camera App"
}
Label {
width: parent.width
color: UbuntuColors.ash
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")
}
}
UbuntuListView {
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:"#800F0F0F"
ListItemLayout {
title.text : model.name
title.color: UbuntuColors.silk
Icon {
width:units.gu(2)
name:"go-to"
}
}
onClicked: Qt.openUrlExternally(model.url)
}
}
}