Changeset View
Changeset View
Standalone View
Standalone View
tests/components/ComponentBase.qml
- This file was added.
1 | import QtQuick 2.0 | ||||
---|---|---|---|---|---|
2 | import QtQuick.Layouts 1.2 | ||||
3 | | ||||
4 | import org.kde.plasma.core 2.0 as PlasmaCore | ||||
5 | import org.kde.plasma.components 3.0 as PlasmaComponents | ||||
6 | | ||||
7 | PlasmaCore.ColorScope | ||||
8 | { | ||||
9 | id: root | ||||
10 | width: 500 | ||||
11 | height: 300 | ||||
12 | property bool invertedColors: false | ||||
13 | default property alias children: container.children | ||||
14 | colorGroup: invertedColors ? PlasmaCore.Theme.ComplementaryColorGroup : PlasmaCore.Theme.NormalColorGroup | ||||
15 | | ||||
16 | Rectangle { | ||||
17 | anchors.fill: parent | ||||
18 | color: PlasmaCore.ColorScope.backgroundColor | ||||
19 | } | ||||
20 | | ||||
21 | PlasmaComponents.Label { | ||||
22 | id: label | ||||
23 | text: root.invertedColors ? "Invert" : "Normal" | ||||
24 | MouseArea { | ||||
25 | anchors.fill: parent | ||||
26 | onClicked: root.invertedColors = !root.invertedColors | ||||
27 | } | ||||
28 | } | ||||
29 | | ||||
30 | Item { | ||||
31 | id: container | ||||
32 | anchors.top: label.bottom | ||||
33 | anchors.left: parent.left | ||||
34 | anchors.right: parent.right | ||||
35 | anchors.bottom: parent.bottom | ||||
36 | } | ||||
37 | } |