mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-15 14:51:14 -08:00
example 'meshtastic': fix manual position selection (map)
This commit is contained in:
parent
de786767ae
commit
4dab5efd7c
7 changed files with 33 additions and 20 deletions
|
|
@ -19,7 +19,7 @@ Item {
|
|||
zoomLevel: 14
|
||||
|
||||
property bool manualLocation: false
|
||||
property var myMarker
|
||||
property var myMarker: null
|
||||
|
||||
Ext.MapButton {
|
||||
id: hand
|
||||
|
|
@ -56,7 +56,7 @@ Item {
|
|||
SequentialAnimation {
|
||||
id: markerAnimation
|
||||
loops: Animation.Infinite
|
||||
running: manualLocation && !!myMarker
|
||||
running: manualLocation && (myMarker !== null)
|
||||
|
||||
OpacityAnimator { target: myMarker; from: 1.0; to: 0.2; duration: 500; easing.type: Easing.InOutSine }
|
||||
OpacityAnimator { target: myMarker; from: 0.2; to: 1.0; duration: 500; easing.type: Easing.InOutSine }
|
||||
|
|
@ -64,12 +64,15 @@ Item {
|
|||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
manualLocation = false
|
||||
var coord = map.toCoordinate(Qt.point(mouse.x, mouse.y))
|
||||
myMarker.coordinate = coord
|
||||
myMarker.opacity = 1
|
||||
Lisp.call("loc:position-selected", coord.latitude, coord.longitude)
|
||||
|
||||
onClicked: (mouse) => {
|
||||
if (manualLocation) {
|
||||
manualLocation = false
|
||||
var coord = map.toCoordinate(Qt.point(mouse.x, mouse.y))
|
||||
myMarker.coordinate = coord
|
||||
myMarker.opacity = 1
|
||||
Lisp.call("loc:position-selected", coord.latitude, coord.longitude)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,4 +12,5 @@ RoundButton {
|
|||
height: width
|
||||
radius: width / 2
|
||||
palette.button: "#555"
|
||||
focusPolicy: Qt.NoFocus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,10 @@ ScrollView {
|
|||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: Lisp.call("app:emoji-clicked",
|
||||
grid.itemAtIndex(grid.indexAt(mouse.x, mouse.y + grid.contentY)).text)
|
||||
onClicked: (mouse) => {
|
||||
Lisp.call("app:emoji-clicked",
|
||||
grid.itemAtIndex(grid.indexAt(mouse.x, mouse.y + grid.contentY)).text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@
|
|||
|
||||
(defun remove-marker () ; see QML
|
||||
(setf *my-position* nil)
|
||||
(remf *positions* (lora:my-num))
|
||||
(app:change-setting :selected-position nil)
|
||||
(values))
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Item {
|
|||
zoomLevel: 14
|
||||
|
||||
property bool manualLocation: false
|
||||
property var myMarker
|
||||
property var myMarker: null
|
||||
|
||||
Ext.MapButton {
|
||||
id: hand
|
||||
|
|
@ -55,7 +55,7 @@ Item {
|
|||
SequentialAnimation {
|
||||
id: markerAnimation
|
||||
loops: Animation.Infinite
|
||||
running: manualLocation && !!myMarker
|
||||
running: manualLocation && (myMarker !== null)
|
||||
|
||||
OpacityAnimator { target: myMarker; from: 1.0; to: 0.2; duration: 500; easing.type: Easing.InOutSine }
|
||||
OpacityAnimator { target: myMarker; from: 0.2; to: 1.0; duration: 500; easing.type: Easing.InOutSine }
|
||||
|
|
@ -63,12 +63,15 @@ Item {
|
|||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
manualLocation = false
|
||||
var coord = map.toCoordinate(Qt.point(mouse.x, mouse.y))
|
||||
myMarker.coordinate = coord
|
||||
myMarker.opacity = 1
|
||||
Lisp.call("loc:position-selected", coord.latitude, coord.longitude)
|
||||
|
||||
onClicked: (mouse) => {
|
||||
if (manualLocation) {
|
||||
manualLocation = false
|
||||
var coord = map.toCoordinate(Qt.point(mouse.x, mouse.y))
|
||||
myMarker.coordinate = coord
|
||||
myMarker.opacity = 1
|
||||
Lisp.call("loc:position-selected", coord.latitude, coord.longitude)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,4 +11,5 @@ RoundButton {
|
|||
height: width
|
||||
radius: width / 2
|
||||
palette.button: "#555"
|
||||
focusPolicy: Qt.NoFocus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,10 @@ ScrollView {
|
|||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: Lisp.call("app:emoji-clicked",
|
||||
grid.itemAtIndex(grid.indexAt(mouse.x, mouse.y + grid.contentY)).text)
|
||||
onClicked: (mouse) => {
|
||||
Lisp.call("app:emoji-clicked",
|
||||
grid.itemAtIndex(grid.indexAt(mouse.x, mouse.y + grid.contentY)).text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue