aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-01 21:42:55 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-06 07:59:17 +0000
commit7e109cdd105d3d152d4a5c9dba16926e78602a04 (patch)
tree15573d8b0161f7e3b25a38891acc4a5ad4e2a616 /tests
parentc4a7bcfa0bd92fdbfca362cd84487433507561c5 (diff)
Material: fix popups to respect Material.background
Task-number: QTBUG-55687 Change-Id: I217ad905cc06228a6a1608c0721dc20a31db6d9b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qquickmaterialstyle/data/tst_material.qml40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/qquickmaterialstyle/data/tst_material.qml b/tests/auto/qquickmaterialstyle/data/tst_material.qml
index 1cd1d16d..727de2e4 100644
--- a/tests/auto/qquickmaterialstyle/data/tst_material.qml
+++ b/tests/auto/qquickmaterialstyle/data/tst_material.qml
@@ -629,4 +629,44 @@ TestCase {
appWindow.destroy()
}
+
+ Component {
+ id: popups
+ ApplicationWindow {
+ id: window
+ property Drawer drawer: Drawer { parent: window.contentItem }
+ property Menu menu: Menu { parent: window.contentItem; visible: true }
+ property Popup popup: Popup { parent: window.contentItem; visible: true }
+ property ToolTip tooltip: ToolTip { parent: window.contentItem; visible: true }
+ }
+ }
+
+ function test_popupBackground_data() {
+ return [
+ { tag: "drawer", inherit: true },
+ { tag: "menu", inherit: true },
+ { tag: "popup", inherit: true },
+ { tag: "tooltip", inherit: false }
+ ]
+ }
+
+ function test_popupBackground(data) {
+ var window = popups.createObject(testCase)
+ verify(window)
+
+ var control = window[data.tag]
+ verify(control)
+
+ window.Material.background = "#ff0000"
+ compare(window.color, "#ff0000")
+ if (data.inherit)
+ compare(control.background.color, "#ff0000")
+ else
+ verify(control.background !== "#ff0000")
+
+ control.Material.background = "#0000ff"
+ compare(control.background.color, "#0000ff")
+
+ window.destroy()
+ }
}