plasma-framework/tests/components/ComponentBase.qml
David Edmundson a3acfbfce6 Add manual test for changing colorscope in components
Summary: For quickly other bugs in PC3

Test Plan:
Opened qmlscene on some files
It's only for unit tests anyway

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D25822
2019-12-09 20:59:57 +00:00

38 lines
959 B
QML

import QtQuick 2.0
import QtQuick.Layouts 1.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
PlasmaCore.ColorScope
{
id: root
width: 500
height: 300
property bool invertedColors: false
default property alias children: container.children
colorGroup: invertedColors ? PlasmaCore.Theme.ComplementaryColorGroup : PlasmaCore.Theme.NormalColorGroup
Rectangle {
anchors.fill: parent
color: PlasmaCore.ColorScope.backgroundColor
}
PlasmaComponents.Label {
id: label
text: root.invertedColors ? "Invert" : "Normal"
MouseArea {
anchors.fill: parent
onClicked: root.invertedColors = !root.invertedColors
}
}
Item {
id: container
anchors.top: label.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}