You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.4 KiB
56 lines
1.4 KiB
/* |
|
SPDX-FileCopyrightText: 2016 Boudhayan Gupta <bgupta@kde.org> |
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later |
|
*/ |
|
|
|
import QtQuick 2.2 |
|
|
|
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 |
|
} |
|
} |
|
] |
|
}
|
|
|