Skip to content
Snippets Groups Projects
Verified Commit 583fd9b5 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix double click on video message

parent 1bd59a39
No related branches found
No related tags found
No related merge requests found
Pipeline #920 failed
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "../"
import QtMultimedia 5.6 import QtMultimedia 5.6
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
...@@ -107,20 +108,40 @@ Rectangle { ...@@ -107,20 +108,40 @@ Rectangle {
width: parent.width width: parent.width
spacing: 15 spacing: 15
Rectangle { ImageButton {
id: button id: button
color: colors.window Layout.alignment: Qt.verticalCenter
radius: 22 //color: colors.window
height: 44 //radius: 22
width: 44 height: 32
width: 32
z: 3
image: ":/icons/icons/ui/arrow-pointing-down.png"
onClicked: {
switch (button.state) {
case "":
TimelineManager.timeline.cacheMedia(model.data.id);
break;
case "stopped":
media.play();
console.log("play");
button.state = "playing";
break;
case "playing":
media.pause();
console.log("pause");
button.state = "stopped";
break;
}
}
states: [ states: [
State { State {
name: "stopped" name: "stopped"
PropertyChanges { PropertyChanges {
target: img target: button
source: "image://colorimage/:/icons/icons/ui/play-sign.png?" + colors.text image: ":/icons/icons/ui/play-sign.png"
} }
}, },
...@@ -128,42 +149,13 @@ Rectangle { ...@@ -128,42 +149,13 @@ Rectangle {
name: "playing" name: "playing"
PropertyChanges { PropertyChanges {
target: img target: button
source: "image://colorimage/:/icons/icons/ui/pause-symbol.png?" + colors.text image: ":/icons/icons/ui/pause-symbol.png"
} }
} }
] ]
Image {
id: img
anchors.centerIn: parent
z: 3
source: "image://colorimage/:/icons/icons/ui/arrow-pointing-down.png?" + colors.text
fillMode: Image.Pad
}
TapHandler {
onSingleTapped: {
switch (button.state) {
case "":
TimelineManager.timeline.cacheMedia(model.data.id);
break;
case "stopped":
media.play();
console.log("play");
button.state = "playing";
break;
case "playing":
media.pause();
console.log("pause");
button.state = "stopped";
break;
}
}
}
CursorShape { CursorShape {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment