diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-28 00:09:25 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 3589e2e9521fff4865b77dc3fa6323d81bc11be1 (patch) | |
tree | 11b1c8c30b1b777cf48595970b31e780b9873492 /mobile-widgets | |
parent | 4a004f37eac32c2c84b5453d9d6b12a5bf06e8c2 (diff) | |
download | subsurface-3589e2e9521fff4865b77dc3fa6323d81bc11be1.tar.gz |
mapwidget.qml: add visual tracking of editMode from MapWidgetHelper
The MapWidgetHelper QML instance now has the slot onEditModeChanged()
which toggles the visiblity of a newly added message box that
notifies the user if editing mode is enabled.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 685bc0dc6..cfd309841 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -15,10 +15,12 @@ Item { MapWidgetHelper { id: mapHelper map: map + editMode: false onSelectedDivesChanged: { // 'list' contains a list of dive list indexes nSelectedDives = list.length } + onEditModeChanged: editMessage.isVisible = editMode === true ? 1 : 0 } Map { @@ -163,6 +165,37 @@ Item { } } + Rectangle { + id: editMessage + radius: padding + color: "#b08000" + border.color: "white" + x: (map.width - width) * 0.5; y: padding + width: editMessageText.width + padding * 2.0 + height: editMessageText.height + padding * 2.0 + visible: false + opacity: 0.0 + property int isVisible: -1 + property real padding: 10.0 + + onOpacityChanged: visible = opacity != 0.0 + states: [ + State { when: editMessage.isVisible === 1; PropertyChanges { target: editMessage; opacity: 1.0 }}, + State { when: editMessage.isVisible === 0; PropertyChanges { target: editMessage; opacity: 0.0 }} + ] + transitions: Transition { + NumberAnimation { properties: "opacity"; easing.type: Easing.InOutQuad } + } + Text { + id: editMessageText + y: editMessage.padding; x: editMessage.padding + verticalAlignment: Text.AlignVCenter + color: "white" + font.pointSize: 11.0 + text: qsTr("Drag the selected dive location") + } + } + Image { id: toggleImage x: 10; y: x |