diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2024-05-08 12:24:30 +0300 |
---|---|---|
committer | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2024-05-13 12:10:40 +0300 |
commit | d3ef41c92c6be6b07fba798eada138cce2f9e9b5 (patch) | |
tree | c07650fb858179b4e4648f0b238842b2ffd73ef0 | |
parent | 5098c62d8018a03f3ccb800f12c921caac538e78 (diff) |
Add more theme properties to tst_qmltheme
Change-Id: I6d763ae6e7da417903d6109cf9688e19e987ca44
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Dilek Akcay <dilek.akcay@qt.io>
Reviewed-by: Sakaria Pouke <sakaria.pouke@qt.io>
-rw-r--r-- | tests/manual/qmltheme/qml/qmltheme/BackgroundModifiers.qml | 299 | ||||
-rw-r--r-- | tests/manual/qmltheme/qml/qmltheme/main.qml | 7 |
2 files changed, 203 insertions, 103 deletions
diff --git a/tests/manual/qmltheme/qml/qmltheme/BackgroundModifiers.qml b/tests/manual/qmltheme/qml/qmltheme/BackgroundModifiers.qml index bc348ed..6bda1b4 100644 --- a/tests/manual/qmltheme/qml/qmltheme/BackgroundModifiers.qml +++ b/tests/manual/qmltheme/qml/qmltheme/BackgroundModifiers.qml @@ -29,48 +29,153 @@ ColumnLayout { } } - Label { - text: "Grid color" - color: "gray" + Row { + Label { + text: "Label text color" + color: "gray" + } + + Button { + height: 25 + width: 25 + + Rectangle { + anchors.fill: parent + anchors.margins: 5 + color: customTheme.labelTextColor + } + + onClicked: textCol.open() + } + } + ColorDialog { + id: textCol + selectedColor: customTheme.labelTextColor + onAccepted: customTheme.labelTextColor = selectedColor + } + + Row { + Label { + text: "Axis label text color" + color: "gray" + } + Button { + height: 25 + width: 25 + + Rectangle { + anchors.fill: parent + anchors.margins: 5 + color: customTheme.axisXLabelColor + } + + onClicked: axisLabelTextCol.open() + } + } + ColorDialog { + id: axisLabelTextCol + selectedColor: customTheme.axisXLabelColor + onAccepted: { + customTheme.axisXLabelColor = selectedColor + customTheme.axisYLabelColor = selectedColor + customTheme.axisZLabelColor = selectedColor + } } - Button { - Layout.preferredHeight: 25 - Layout.preferredWidth: 25 + Row { + Label { + text: "Background color" + color: "gray" + } + + Button { + height: 25 + width: 25 + + Rectangle { + anchors.fill: parent + anchors.margins: 5 + color: customTheme.backgroundColor + } + + onClicked: backgroundCol.open() + } + } + ColorDialog { + id: backgroundCol + selectedColor: customTheme.backgroundColor + onAccepted: customTheme.backgroundColor = selectedColor + } - Rectangle { - anchors.fill: parent - anchors.margins: 5 - color: customTheme.gridMainColor + Row { + Label { + text: "Plot area color" + color: "gray" } - onClicked: gridlineCol.open() + Button { + height: 25 + width: 25 + + Rectangle { + anchors.fill: parent + anchors.margins: 5 + color: customTheme.plotAreaBackgroundColor + } + + onClicked: plotareaCol.open() + } } + ColorDialog { + id: plotareaCol + selectedColor: customTheme.plotAreaBackgroundColor + onAccepted: customTheme.plotAreaBackgroundColor = selectedColor + } + + Row { + Label { + text: "Grid color" + color: "gray" + } + + Button { + height: 25 + width: 25 + + Rectangle { + anchors.fill: parent + anchors.margins: 5 + color: customTheme.gridMainColor + } + onClicked: gridlineCol.open() + } + } ColorDialog { id: gridlineCol selectedColor: customTheme.gridMainColor onAccepted: customTheme.gridMainColor = selectedColor } - Label { - text: "Subgrid color" - color: "gray" - } + Row { + Label { + text: "Subgrid color" + color: "gray" + } - Button { - Layout.preferredHeight: 25 - Layout.preferredWidth: 25 + Button { + height: 25 + width: 25 - Rectangle { - anchors.fill: parent - anchors.margins: 5 - color: customTheme.gridSubColor - } + Rectangle { + anchors.fill: parent + anchors.margins: 5 + color: customTheme.gridSubColor + } - onClicked: subgridlineCol.open() + onClicked: subgridlineCol.open() + } } - ColorDialog { id: subgridlineCol selectedColor: customTheme.gridSubColor @@ -95,100 +200,92 @@ ColumnLayout { } } - Label { - text: "Background" - color: "gray" - } - CheckBox { - checked: customTheme.backgroundEnabled - onCheckedChanged: { - customTheme.backgroundEnabled = checked + Row { + Label { + text: "Background" + color: "gray" } - } - - Label { - text: "Grid" - color: "gray" - } - CheckBox { - checked: customTheme.gridEnabled - onCheckedChanged: { - customTheme.gridEnabled = checked + CheckBox { + checked: customTheme.backgroundEnabled + onCheckedChanged: { + customTheme.backgroundEnabled = checked + } } } - Label { - text: "Geometry/Shader Grid" - color: "gray" - } - CheckBox { - id: testgridChange - checked: false - } - - Label { - text: "Labels" - color: "gray" - } - CheckBox { - checked: customTheme.labelsEnabled - onCheckedChanged: { - customTheme.labelsEnabled = checked + Row { + Label { + text: "Plot area" + color: "gray" } - } - - Label { - text: "Label Background" - color: "gray" - } - CheckBox { - checked: customTheme.labelBackgroundEnabled - onCheckedChanged: { - customTheme.labelBackgroundEnabled = checked + CheckBox { + checked: customTheme.plotAreaBackgroundEnabled + onCheckedChanged: { + customTheme.plotAreaBackgroundEnabled = checked + } } } - ColorDialog { - id: labelTextCol - selectedColor: customTheme.labelTextColor - onAccepted: customTheme.labelTextColor = selectedColor + Row { + Label { + text: "Grid" + color: "gray" + } + CheckBox { + checked: customTheme.gridEnabled + onCheckedChanged: { + customTheme.gridEnabled = checked + } + } } - Label { - text: "Label Border" - color: "gray" - } - CheckBox { - checked: customTheme.labelBorderEnabled - onCheckedChanged: { - customTheme.labelBorderEnabled = checked + Row { + Label { + text: "Geometry/Shader Grid" + color: "gray" + } + CheckBox { + id: testgridChange + checked: false } } - Label { - text: "Axis label text color" - color: "gray" + Row { + Label { + text: "Labels" + color: "gray" + } + CheckBox { + checked: customTheme.labelsEnabled + onCheckedChanged: { + customTheme.labelsEnabled = checked + } + } } - Button { - Layout.preferredHeight: 25 - Layout.preferredWidth: 25 - Rectangle { - anchors.fill: parent - anchors.margins: 5 - color: customTheme.axisXLabelColor + Row { + Label { + text: "Label Background" + color: "gray" + } + CheckBox { + checked: customTheme.labelBackgroundEnabled + onCheckedChanged: { + customTheme.labelBackgroundEnabled = checked + } } - - onClicked: axisLabelTextCol.open() } - ColorDialog { - id: axisLabelTextCol - selectedColor: customTheme.axisXLabelColor - onAccepted: { - customTheme.axisXLabelColor = selectedColor - customTheme.axisYLabelColor = selectedColor - customTheme.axisZLabelColor = selectedColor + Row { + Label { + text: "Label Border" + color: "gray" + } + CheckBox { + checked: customTheme.labelBorderEnabled + onCheckedChanged: { + customTheme.labelBorderEnabled = checked + } } } } diff --git a/tests/manual/qmltheme/qml/qmltheme/main.qml b/tests/manual/qmltheme/qml/qmltheme/main.qml index 7238326..1a04f68 100644 --- a/tests/manual/qmltheme/qml/qmltheme/main.qml +++ b/tests/manual/qmltheme/qml/qmltheme/main.qml @@ -51,10 +51,13 @@ Item { plotAreaBackgroundColor: "gray" baseColors: [surfaceColor] baseGradients: [customGradient] + labelFont: Qt.font({ + family: "Courier New", + bold: true, + // pointSize: 100 + }) gridMainColor: "lightGray" - multiHighlightColor: "orange" singleHighlightColor: "yellow" - multiHighlightGradient: multiGradient singleHighlightGradient: singleGradient } |