Warning, /frameworks/plasma-framework/tests/colorcontext.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 import QtQuick 2.1 0008 import QtQuick.Layouts 1.2 0009 import org.kde.plasma.core 2.0 as PlasmaCore 0010 import org.kde.plasma.components 2.0 as PlasmaComponents 0011 0012 ColumnLayout { 0013 width: 600 0014 height: 600 0015 PlasmaCore.ColorScope { 0016 id: scope1 0017 colorGroup: PlasmaCore.Theme.NormalColorGroup 0018 Layout.minimumWidth: rect1.width 0019 Layout.minimumHeight: rect1.height 0020 Rectangle { 0021 id: rect1 0022 width: PlasmaCore.Units.gridUnit * 30 0023 height: PlasmaCore.Units.gridUnit * 15 0024 color: PlasmaCore.ColorScope.backgroundColor 0025 0026 Column { 0027 id: widgetsParent 0028 anchors.centerIn: parent 0029 PlasmaCore.Svg { 0030 id: audioSvg 0031 imagePath: "icons/audio" 0032 colorGroup: PlasmaCore.ColorScope.colorGroup 0033 } 0034 PlasmaCore.SvgItem { 0035 width: 32 0036 height: 32 0037 elementId: "audio-volume-medium" 0038 svg: audioSvg 0039 } 0040 Row { 0041 PlasmaCore.IconItem { 0042 colorGroup: PlasmaCore.ColorScope.colorGroup 0043 source: "audio-volume-medium" 0044 } 0045 PlasmaComponents.Label { 0046 text: "Some text" 0047 } 0048 } 0049 Rectangle { 0050 width: parent.width 0051 height: PlasmaCore.Units.gridUnit * 3 0052 color: PlasmaCore.ColorScope.textColor 0053 } 0054 } 0055 } 0056 } 0057 PlasmaCore.ColorScope { 0058 id: scope2 0059 colorGroup: PlasmaCore.Theme.ComplementaryColorGroup 0060 Layout.minimumWidth: rect1.width 0061 Layout.minimumHeight: rect1.height 0062 Rectangle { 0063 id: rect2 0064 width: PlasmaCore.Units.gridUnit * 30 0065 height: PlasmaCore.Units.gridUnit * 15 0066 color: PlasmaCore.ColorScope.backgroundColor 0067 } 0068 } 0069 PlasmaComponents.Button { 0070 y: 300 0071 text: "switch" 0072 onClicked: widgetsParent.parent == rect2 ? widgetsParent.parent = rect1 : widgetsParent.parent = rect2 0073 } 0074 }