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
This commit is contained in:
David Edmundson 2019-12-09 16:33:23 +00:00
parent 7e52c869de
commit a3acfbfce6
19 changed files with 86 additions and 128 deletions

View File

@ -0,0 +1,37 @@
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
}
}

View File

@ -1,11 +1,7 @@
import QtQuick 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
Rectangle {
width: 600
height: 300
color: "white"
ComponentBase {
Column {
anchors.fill: parent
anchors.margins: 20
@ -33,5 +29,4 @@ Rectangle {
}
}
}

View File

@ -1,11 +1,7 @@
import QtQuick 2.0
import org.kde.plasma.components 3.0 as PlasmaComponents
Rectangle {
width: 600
height: 300
color: "white"
ComponentBase {
Column {
anchors.fill: parent
anchors.margins: 20

View File

@ -4,12 +4,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2
Rectangle
{
width: 500
height: 500
color: "white"
ComponentBase {
Grid {
anchors.fill: parent
anchors.margins: 20

View File

@ -3,19 +3,14 @@ import QtQuick 2.0
import org.kde.plasma.components 3.0 as PlasmaComponents
import QtQuick.Layouts 1.2
Rectangle
{
width: 500
height: 500
color: "white"
ComponentBase {
Grid {
anchors.fill: parent
anchors.margins: 20
spacing: 20
columns: 2
Label {
PlasmaComponents.Label {
text: "icon + text"
}
@ -24,7 +19,7 @@ Rectangle
text: "test"
}
Label {
PlasmaComponents.Label {
text: "icon alone, should look small and square"
}
@ -32,7 +27,7 @@ Rectangle
icon.name: "list-remove"
}
Label {
PlasmaComponents.Label {
text: "text alone, should be about 12 chars wide"
}
@ -41,7 +36,7 @@ Rectangle
}
Label {
PlasmaComponents.Label {
text: "long text, should expand to fit"
}
@ -50,7 +45,7 @@ Rectangle
text: "This is a really really really really long button"
}
Label {
PlasmaComponents.Label {
text: "long text but constrained, should be 150px and elided"
}
@ -61,7 +56,7 @@ Rectangle
}
Label {
PlasmaComponents.Label {
text: "button (with or without icon) and textfield should have the same height"
}
@ -77,7 +72,7 @@ Rectangle
}
}
Label {
PlasmaComponents.Label {
text: "minimum width property. Should be two letters wide"
}

View File

@ -4,12 +4,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2
Rectangle
{
width: 500
height: 500
color: "white"
ComponentBase {
Grid {
anchors.fill: parent
anchors.margins: 20

View File

@ -3,26 +3,21 @@ import QtQuick 2.0
import org.kde.plasma.components 3.0 as PlasmaComponents
import QtQuick.Layouts 1.2
Rectangle
{
width: 500
height: 500
color: "white"
ComponentBase {
Grid {
anchors.fill: parent
anchors.margins: 20
spacing: 4
columns: 2
Label {
PlasmaComponents.Label {
text: "text"
}
PlasmaComponents.CheckBox {
text: "Some awesome checkbox"
}
Label {
PlasmaComponents.Label {
text: "focus"
}
PlasmaComponents.CheckBox {
@ -30,7 +25,7 @@ Rectangle
focus: true
}
Label {
PlasmaComponents.Label {
text: "checked"
}
PlasmaComponents.CheckBox {
@ -38,7 +33,7 @@ Rectangle
checkState: Qt.Checked
}
Label {
PlasmaComponents.Label {
text: "tri-state"
}
PlasmaComponents.CheckBox {
@ -46,7 +41,7 @@ Rectangle
checkState: Qt.PartiallyChecked
}
Label {
PlasmaComponents.Label {
text: "disabled"
}
PlasmaComponents.CheckBox {
@ -54,7 +49,7 @@ Rectangle
enabled: false
}
Label {
PlasmaComponents.Label {
text: "disabled and checked"
}
PlasmaComponents.CheckBox {

View File

@ -3,23 +3,17 @@ import QtQuick 2.0
import org.kde.plasma.components 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Rectangle {
id: root
color: "white"
width: 800
height: 300
ListModel {
id: demoModel
ListElement { text: "Banana"; color: "Yellow" }
ListElement { text: "Apple"; color: "Green" }
ListElement { text: "Coconut"; color: "Brown" }
}
ComponentBase {
Flow {
anchors.fill: parent
anchors.margins: 20
spacing: 20
ListModel {
id: demoModel
ListElement { text: "Banana"; color: "Yellow" }
ListElement { text: "Apple"; color: "Green" }
ListElement { text: "Coconut"; color: "Brown" }
}
ComboBox {
model:demoModel

View File

@ -1,10 +1,7 @@
import QtQuick 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
Rectangle {
width: 600
height: 250
color: "white"
ComponentBase {
Flow {
anchors.fill: parent

View File

@ -2,15 +2,10 @@ import QtQuick 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
Rectangle {
ComponentBase {
id: root
property int orientation: orientationCombo.model[orientationCombo.currentIndex].value
color: "white"
width: 900
height: 600
Flow {
anchors.fill: parent
anchors.margins: 20

View File

@ -2,13 +2,9 @@ import QtQuick 2.0
import org.kde.plasma.components 3.0 as PlasmaComponents
Rectangle {
ComponentBase {
id: root
color: "white"
width: 900
height: 600
Flow {
anchors.fill: parent
anchors.margins: 20

View File

@ -4,26 +4,21 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.2
Rectangle
{
width: 500
height: 500
color: "white"
ComponentBase {
Grid {
anchors.fill: parent
anchors.margins: 20
spacing: 4
columns: 2
Label {
PlasmaComponents.Label {
text: "text"
}
PlasmaComponents.RadioButton {
text: "Some awesome radiobutton"
}
Label {
PlasmaComponents.Label {
text: "focus"
}
PlasmaComponents.RadioButton {
@ -31,7 +26,7 @@ Rectangle
focus: true
}
Label {
PlasmaComponents.Label {
text: "checked"
}
PlasmaComponents.RadioButton {
@ -39,7 +34,7 @@ Rectangle
checked: true
}
Label {
PlasmaComponents.Label {
text: "disabled"
}
PlasmaComponents.RadioButton {
@ -47,7 +42,7 @@ Rectangle
enabled: false
}
Label {
PlasmaComponents.Label {
text: "disabled and checked"
}
PlasmaComponents.RadioButton {

View File

@ -3,26 +3,21 @@ import QtQuick 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Layouts 1.2
Rectangle
{
width: 500
height: 500
color: "white"
ComponentBase {
Grid {
anchors.fill: parent
anchors.margins: 20
spacing: 4
columns: 2
Label {
PlasmaComponents.Label {
text: "text"
}
PlasmaComponents.RadioButton {
text: "Some awesome radiobutton"
}
Label {
PlasmaComponents.Label {
text: "focus"
}
PlasmaComponents.RadioButton {
@ -30,7 +25,7 @@ Rectangle
focus: true
}
Label {
PlasmaComponents.Label {
text: "checked"
}
PlasmaComponents.RadioButton {
@ -38,7 +33,7 @@ Rectangle
checked: true
}
Label {
PlasmaComponents.Label {
text: "disabled"
}
PlasmaComponents.RadioButton {
@ -46,7 +41,7 @@ Rectangle
enabled: false
}
Label {
PlasmaComponents.Label {
text: "disabled and checked"
}
PlasmaComponents.RadioButton {

View File

@ -4,11 +4,8 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 1.3
Rectangle {
ComponentBase {
id: root
color: "white"
width: 800
height: 300
property string longText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at volutpat nibh, non elementum nulla. Nunc sem magna, semper sit amet sollicitudin et, vestibulum sed metus. Fusce tempor dolor purus, non posuere urna sodales in. Aenean eu erat ipsum. Fusce egestas pulvinar nisi. Mauris vel enim tincidunt, elementum diam sed, tincidunt nulla. Maecenas tempus vitae ligula et convallis. Nullam justo velit, dignissim a nisl at, blandit posuere leo. Maecenas ac scelerisque odio, eget placerat ipsum. Ut iaculis, tortor et ullamcorper fringilla, mauris neque dapibus arcu, eget suscipit libero libero ut nunc. Sed maximus enim a ligula facilisis, non efficitur dolor blandit. Curabitur venenatis mattis erat ac gravida."

View File

@ -2,11 +2,8 @@ import QtQuick 2.0
import org.kde.plasma.components 3.0 as PlasmaComponents
Rectangle {
ComponentBase {
id: root
color: "white"
width: 800
height: 300
property string longText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at volutpat nibh, non elementum nulla. Nunc sem magna, semper sit amet sollicitudin et, vestibulum sed metus. Fusce tempor dolor purus, non posuere urna sodales in. Aenean eu erat ipsum. Fusce egestas pulvinar nisi. Mauris vel enim tincidunt, elementum diam sed, tincidunt nulla. Maecenas tempus vitae ligula et convallis. Nullam justo velit, dignissim a nisl at, blandit posuere leo. Maecenas ac scelerisque odio, eget placerat ipsum. Ut iaculis, tortor et ullamcorper fringilla, mauris neque dapibus arcu, eget suscipit libero libero ut nunc. Sed maximus enim a ligula facilisis, non efficitur dolor blandit. Curabitur venenatis mattis erat ac gravida."

View File

@ -4,12 +4,8 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 1.3
Rectangle {
ComponentBase {
id: root
color: "white"
width: 800
height: 300
property string longText: "This is a longer sentence"
Flow {

View File

@ -2,12 +2,8 @@ import QtQuick 2.0
import org.kde.plasma.components 3.0 as PlasmaComponents
Rectangle {
ComponentBase {
id: root
color: "white"
width: 800
height: 300
property string longText: "This is a longer sentence"
Flow {

View File

@ -2,12 +2,7 @@ import QtQuick 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
Rectangle
{
width: 500
height: 300
color: "white"
ComponentBase {
Flow {
anchors.fill: parent
anchors.margins: 20

View File

@ -1,13 +1,10 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents
Rectangle
{
width: 500
height: 300
color: "white"
ComponentBase {
Flow {
anchors.fill: parent
anchors.margins: 20