extend #224 to LocationPreview and VideoPreview

This commit is contained in:
John Gibbon 2020-12-04 20:22:21 +01:00
parent 01d3ff18cf
commit 1e877dec22
2 changed files with 21 additions and 29 deletions

View file

@ -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 {

View file

@ -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;