Compare commits
2 commits
master
...
work/ratij
Author | SHA1 | Date | |
---|---|---|---|
|
1419cebf7a | ||
|
e65c0d9baa |
1 changed files with 6 additions and 5 deletions
|
@ -12,6 +12,7 @@ import QtMultimedia
|
||||||
|
|
||||||
Kirigami.Page {
|
Kirigami.Page {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string filePath
|
property string filePath
|
||||||
property string mimeType
|
property string mimeType
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ Kirigami.Page {
|
||||||
text: i18nd("kdeconnect-sms", "Open with default")
|
text: i18nd("kdeconnect-sms", "Open with default")
|
||||||
icon.name: "window-new"
|
icon.name: "window-new"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
Qt.openUrlExternally(filePath);
|
Qt.openUrlExternally(Qt.url(`file://${root.filePath}`))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -30,7 +31,7 @@ Kirigami.Page {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: imageViewer
|
id: imageViewer
|
||||||
visible: mimeType.match("image")
|
visible: root.mimeType.match("image")
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
width: image.width
|
width: image.width
|
||||||
height: parent.height - y
|
height: parent.height - y
|
||||||
|
@ -39,7 +40,7 @@ Kirigami.Page {
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: image
|
id: image
|
||||||
source: parent.visible ? filePath : ""
|
source: parent.visible ? root.filePath : ""
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: sourceSize.width
|
width: sourceSize.width
|
||||||
|
@ -50,7 +51,7 @@ Kirigami.Page {
|
||||||
|
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: mediaPlayer
|
id: mediaPlayer
|
||||||
source: filePath
|
source: root.filePath
|
||||||
|
|
||||||
onPositionChanged: {
|
onPositionChanged: {
|
||||||
if (mediaPlayer.position > 1000 && mediaPlayer.duration - mediaPlayer.position < 1000) {
|
if (mediaPlayer.position > 1000 && mediaPlayer.duration - mediaPlayer.position < 1000) {
|
||||||
|
@ -80,7 +81,7 @@ Kirigami.Page {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: mediaControls
|
id: mediaControls
|
||||||
visible: mimeType.match("video")
|
visible: root.mimeType.match("video")
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 50
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
Loading…
Reference in a new issue