diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-09-02 17:28:05 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-09-02 17:28:16 +0200 |
commit | fba02cc8ae7fb71abb927a06a8e480f7909dc029 (patch) | |
tree | d32e2c1f0070ab49fc85cdc89b744f9925b4e614 /tests/auto/qquickmaterialstyle | |
parent | f6c3ecdb0646a4d83be5c07dd5369d0b0350260c (diff) | |
parent | 33904b63ce9971efc3763a0048a084ec3324dfc4 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Change-Id: I82da1e547c4ead1181ade19f77c62651c00998a3
Diffstat (limited to 'tests/auto/qquickmaterialstyle')
-rw-r--r-- | tests/auto/qquickmaterialstyle/data/tst_material.qml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qquickmaterialstyle/data/tst_material.qml b/tests/auto/qquickmaterialstyle/data/tst_material.qml index 8eb6933c..9411891f 100644 --- a/tests/auto/qquickmaterialstyle/data/tst_material.qml +++ b/tests/auto/qquickmaterialstyle/data/tst_material.qml @@ -74,6 +74,11 @@ TestCase { } Component { + id: applicationWindow + ApplicationWindow { } + } + + Component { id: styledWindow Window { Material.theme: Material.Dark @@ -600,4 +605,28 @@ TestCase { window.destroy() } + + function test_buttonBackground() { + var appWindow = applicationWindow.createObject(testCase) + verify(appWindow) + appWindow.visible = true + + var childButton = button.createObject(appWindow) + verify(childButton) + + var buttonBackgroundColor = childButton.background.color + appWindow.Material.background = "red" + // We wait the length of the color animation to be sure that it hasn't actually changed. + wait(400) + // We want childButton.Material.background to be equal to appWindow.Material.background, + // because we want the color to propagate to items that might actually use it... + // but Button doesn't use the background color unless explicitly set, + // so we compare the actual background rect color instead. + compare(childButton.background.color, buttonBackgroundColor) + + childButton.Material.background = "#0000ff" + tryCompare(childButton.background, "color", "#0000ff") + + appWindow.destroy() + } } |