forked from rh-lab-q/confla-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaceDetailPage.qml
More file actions
133 lines (111 loc) · 4 KB
/
PlaceDetailPage.qml
File metadata and controls
133 lines (111 loc) · 4 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
import QtQuick 2.0
import "Theme.js" as Theme
Page {
property alias name: title_label.text
property string description;
property alias image: placesDelegate.source;
property double lat
property double lon
signal showOnMap();
Flickable {
anchors.fill: parent;
contentHeight: pageHeader.height + title_label.height + description_label.height + Theme.paddingSmall + 2 * Theme.paddingMedium;
// PullDownMenu {
// MenuItem {
// //% "Show on map"
// text: qsTrId("place-detail-menu-show-on-map");
// onClicked: {
// showOnMap();
// }
// }
// MenuItem {
// //% "Navigate to"
// text: qsTrId("place-detail-menu-navigate-to");
// onClicked: {
// Qt.openUrlExternally("geo:"+lat+","+lon)
// }
// }
// }
PageHeader {
id: pageHeader
anchors.top: parent.top;
anchors.right: parent.right;
anchors.left: parent.left;
//% "Place"
title: qsTrId("place-detail-header-place")
}
Image {
id: placesDelegate
anchors.left: parent.left;
anchors.verticalCenter: title_label.verticalCenter;
anchors.margins: Theme.paddingSmall;
smooth: true
width: 0.5 * dpix;
height: 0.5 * dpiy;
fillMode: Image.PreserveAspectFit
}
Image {
anchors.top: parent.top;
anchors.left: parent.left;
anchors.margins: Theme.paddingMedium
anchors.centerIn: placesDelegate;
source: "./images/marker-icon.png"
visible:( placesDelegate.status !== Image.Ready)
width: placesDelegate.width;
height: placesDelegate.height;
fillMode: Image.PreserveAspectFit
}
Text {
id: title_label
anchors.margins: Theme.paddingSmall;
anchors.top: pageHeader.bottom;
anchors.left: placesDelegate.right;
anchors.right: parent.right
wrapMode: Text.Wrap;
color: Theme.primary_color
verticalAlignment: Text.AlignVCenter;
font.pointSize: Theme.primary_pointSize;
}
Text {
id: description_label;
anchors.margins: Theme.paddingMedium;
anchors.left: parent.left
anchors.right: parent.right
anchors.top: title_label.bottom
color: Theme.secondary_color
wrapMode: Text.Wrap;
font.pointSize: Theme.primary_pointSize;
textFormat: Text.RichText;
text: "<style type='text/css'>a:link{color:"+Theme.section_header_color+"; } a:visited{color:"+Theme.section_header_color+"}</style> "+ description
onLinkActivated: {
Qt.openUrlExternally(link);
}
}
LineButton {
id: showOnMapButton
anchors.topMargin: Theme.paddingLarge
anchors.top: description_label.bottom
anchors.left: parent.left
anchors.right: parent.right
//% "Show on Map"
text: qsTrId("show-on-map")
image: "./images/ic_map_white_48dp.png"
onClicked: {
showOnMap();
}
}
LineButton {
id: navigateToButton
anchors.topMargin: Theme.paddingLarge
anchors.top: showOnMapButton.bottom
anchors.left: parent.left
anchors.right: parent.right
image: "./images/ic_directions_white_48dp.png"
//% "Navigate to"
text: qsTrId("navigate-to")
onClicked: {
Qt.openUrlExternally("geo:"+lat+","+lon)
}
}
}
}