mirror of
https://github.com/vinceliuice/MacSequoia-kde.git
synced 2024-11-22 13:50:13 +00:00
56 lines
1.4 KiB
QML
56 lines
1.4 KiB
QML
/*
|
|
SPDX-FileCopyrightText: 2016 Boudhayan Gupta <bgupta@kde.org>
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
*/
|
|
|
|
import QtQuick 2.15
|
|
|
|
FocusScope {
|
|
id: sceneBackground
|
|
|
|
property var sceneBackgroundType
|
|
property alias sceneBackgroundColor: sceneColorBackground.color
|
|
property alias sceneBackgroundImage: sceneImageBackground.source
|
|
|
|
Rectangle {
|
|
id: sceneColorBackground
|
|
anchors.fill: parent
|
|
}
|
|
|
|
Image {
|
|
id: sceneImageBackground
|
|
anchors.fill: parent
|
|
sourceSize.width: parent.width
|
|
sourceSize.height: parent.height
|
|
fillMode: Image.PreserveAspectCrop
|
|
smooth: true;
|
|
}
|
|
|
|
states: [
|
|
State {
|
|
name: "imageBackground"
|
|
when: sceneBackgroundType === "image"
|
|
PropertyChanges {
|
|
target: sceneColorBackground
|
|
visible: false
|
|
}
|
|
PropertyChanges {
|
|
target: sceneImageBackground
|
|
visible: true
|
|
}
|
|
},
|
|
State {
|
|
name: "colorBackground"
|
|
when: sceneBackgroundType !== "image"
|
|
PropertyChanges {
|
|
target: sceneColorBackground
|
|
visible: true
|
|
}
|
|
PropertyChanges {
|
|
target: sceneImageBackground
|
|
visible: false
|
|
}
|
|
}
|
|
]
|
|
}
|