Merge pull request #225 from jgibbon/feature/general-click
extend #224 to LocationPreview and VideoPreview
This commit is contained in:
commit
c65ff27ebe
2 changed files with 21 additions and 29 deletions
|
@ -38,7 +38,11 @@ Item {
|
|||
Component.onCompleted: {
|
||||
updatePicture();
|
||||
}
|
||||
|
||||
function clicked(){
|
||||
if(!processLauncher.launchProgram('harbour-pure-maps', ["geo:"+locationData.latitude+","+locationData.longitude])) {
|
||||
imageNotification.show(qsTr("Install Pure Maps to inspect this location."));
|
||||
}
|
||||
}
|
||||
function updatePicture() {
|
||||
imagePreviewItem.pictureFileInformation = null;
|
||||
if (locationData) {
|
||||
|
@ -95,20 +99,6 @@ Item {
|
|||
source: markerImage
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if(!processLauncher.launchProgram('harbour-pure-maps', ["geo:"+locationData.latitude+","+locationData.longitude])) {
|
||||
imageNotification.show(qsTr("Install Pure Maps to inspect this location."));
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
|
||||
opacity: parent.pressed ? 1.0 : 0.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BackgroundImage {
|
||||
|
|
|
@ -38,6 +38,7 @@ Item {
|
|||
property bool onScreen: messageListItem ? messageListItem.page.status === PageStatus.Active : true;
|
||||
property string videoType : "video";
|
||||
property bool playRequested: false;
|
||||
signal clicked();
|
||||
|
||||
width: parent.width
|
||||
height: videoMessageComponent.isVideoNote ? width : Functions.getVideoHeight(width, videoData)
|
||||
|
@ -287,6 +288,21 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: videoMessageComponent
|
||||
onClicked: {
|
||||
if (messageVideo.playbackState === MediaPlayer.PlayingState) {
|
||||
enableScreensaver();
|
||||
messageVideo.pause();
|
||||
timeLeftItem.visible = true;
|
||||
} else {
|
||||
disableScreensaver();
|
||||
messageVideo.play();
|
||||
timeLeftTimer.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Video {
|
||||
id: messageVideo
|
||||
|
||||
|
@ -344,20 +360,6 @@ Item {
|
|||
width: parent.width
|
||||
height: parent.height
|
||||
source: videoUrl
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (messageVideo.playbackState === MediaPlayer.PlayingState) {
|
||||
enableScreensaver();
|
||||
messageVideo.pause();
|
||||
timeLeftItem.visible = true;
|
||||
} else {
|
||||
disableScreensaver();
|
||||
messageVideo.play();
|
||||
timeLeftTimer.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
onStopped: {
|
||||
enableScreensaver();
|
||||
messageVideo.visible = false;
|
||||
|
|
Loading…
Reference in a new issue