Changeset View
Changeset View
Standalone View
Standalone View
src/apps/marble-maps/PlacemarkDialog.qml
Context not available. | |||||
24 | property alias showOsmTags: tagsView.visible | 24 | property alias showOsmTags: tagsView.visible | ||
---|---|---|---|---|---|
25 | property bool showAccessibility: false | 25 | property bool showAccessibility: false | ||
26 | 26 | | |||
27 | height: placemark === null ? 0 : Screen.pixelDensity * 4 + | 27 | height: placemark === null ? 0 : Screen.pixelDensity * 4 +infoLayout.height | ||
28 | (infoLayout.height > bookmarkButton.height ? infoLayout.height : bookmarkButton.height) | | |||
29 | 28 | | |||
30 | onPlacemarkChanged: { | | |||
31 | if (placemark) { | | |||
32 | bookmarkButton.bookmark = bookmarks.isBookmark(placemark.longitude, placemark.latitude) | | |||
33 | } | | |||
34 | } | | |||
35 | 29 | | |||
36 | SystemPalette { | 30 | SystemPalette { | ||
37 | id: palette | 31 | id: palette | ||
Context not available. | |||||
55 | anchors { | 49 | anchors { | ||
56 | top: parent.top | 50 | top: parent.top | ||
57 | left: parent.left | 51 | left: parent.left | ||
58 | right: bookmarkButton.left | 52 | right: parent.right | ||
59 | margins: Screen.pixelDensity * 2 | 53 | margins: Screen.pixelDensity * 2 | ||
60 | } | 54 | } | ||
61 | 55 | | |||
Context not available. | |||||
167 | } | 161 | } | ||
168 | } | 162 | } | ||
169 | 163 | | |||
170 | Image { | | |||
171 | id: bookmarkButton | | |||
172 | anchors.right: parent.right | | |||
173 | anchors.top: parent.top | | |||
174 | anchors.margins: Screen.pixelDensity * 2 | | |||
175 | visible: root.height > 0 | | |||
176 | | ||||
177 | property bool bookmark: false | | |||
178 | | ||||
179 | width: Screen.pixelDensity * 6 | | |||
180 | height: width | | |||
181 | sourceSize.height: height | | |||
182 | sourceSize.width: width | | |||
183 | source: bookmark ? "qrc:/material/star.svg" : "qrc:/material/star_border.svg" | | |||
184 | | ||||
185 | MouseArea { | | |||
186 | id: touchArea | | |||
187 | anchors.fill: parent | | |||
188 | onClicked: { | | |||
189 | if (bookmarkButton.bookmark) { | | |||
190 | bookmarks.removeBookmark(root.placemark.longitude, root.placemark.latitude) | | |||
191 | } else { | | |||
192 | bookmarks.addBookmark(root.placemark, "Default") | | |||
193 | } | | |||
194 | bookmarkButton.bookmark = !bookmarkButton.bookmark | | |||
195 | } | | |||
196 | } | | |||
197 | } | | |||
198 | 164 | | |||
199 | Dialog { | 165 | Dialog { | ||
200 | id: routesDialog | 166 | id: routesDialog | ||
Context not available. |