mirror of
https://github.com/Keyitdev/sddm-astronaut-theme.git
synced 2026-09-24 02:22:09 +00:00
Update: Added the ability to set videos as wallpapers.
This commit is contained in:
@@ -7,6 +7,7 @@ import QtQuick 2.15
|
|||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
|
import QtMultimedia
|
||||||
|
|
||||||
import "Components"
|
import "Components"
|
||||||
|
|
||||||
@@ -179,9 +180,25 @@ Pane {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
id: backgroundImage
|
id: backgroundImage
|
||||||
|
|
||||||
|
MediaPlayer {
|
||||||
|
id: player
|
||||||
|
|
||||||
|
videoOutput: videoOutput
|
||||||
|
autoPlay: true
|
||||||
|
loops: -1
|
||||||
|
}
|
||||||
|
|
||||||
|
VideoOutput {
|
||||||
|
id: videoOutput
|
||||||
|
|
||||||
|
fillMode: config.CropBackground == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: config.HaveFormBackground == "true" && config.FormPosition != "center" && config.PartialBlur != "true" ? parent.width - formBackground.width : parent.width
|
width: config.HaveFormBackground == "true" && config.FormPosition != "center" && config.PartialBlur != "true" ? parent.width - formBackground.width : parent.width
|
||||||
anchors.left: leftleft || leftcenter ? formBackground.right : undefined
|
anchors.left: leftleft || leftcenter ? formBackground.right : undefined
|
||||||
@@ -198,12 +215,25 @@ Pane {
|
|||||||
Image.AlignBottom : Image.AlignVCenter
|
Image.AlignBottom : Image.AlignVCenter
|
||||||
|
|
||||||
speed: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed
|
speed: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed
|
||||||
source: config.background || config.Background
|
source: config.BackgroundPlaceholder
|
||||||
|
paused: config.PauseBackground == "true" ? 1 : 0
|
||||||
fillMode: config.CropBackground == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
|
fillMode: config.CropBackground == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
cache: true
|
cache: true
|
||||||
clip: true
|
clip: true
|
||||||
mipmap: true
|
mipmap: true
|
||||||
|
|
||||||
|
Component.onCompleted:{
|
||||||
|
var fileType = config.Background.substring(config.Background.lastIndexOf(".") + 1)
|
||||||
|
|
||||||
|
if (fileType === "mp4" || fileType === "mov" || fileType === "avi" || fileType === "webm") {
|
||||||
|
player.source = Qt.resolvedUrl(config.Background)
|
||||||
|
player.play();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
backgroundImage.source = config.background || config.Background
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|||||||
Reference in New Issue
Block a user