diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-04-25 08:41:40 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-04-27 12:44:44 +0000 |
commit | 3d6d026602cf9a6ccc35655347c2ed6267bbc49f (patch) | |
tree | bbf7b3e017d50b5c6e3cbb425c279b9d2f6da4b5 /tests/auto/controls/data/tst_popup.qml | |
parent | 3851ae607c6bb1b77bde99172ebd8a1ff6929c39 (diff) |
Popup: separate modal and modeless background dimming
iOS generally has white popups on white background, so it must dim the
overlay background also for modeless popups to make them stand out. Make
it possible to have modal and modeless background dimming separately,
because both might be visible at the same time (eg. in Gallery settings).
Change-Id: Id990675c8d06ceb8f8a26e6505d4bd020069f297
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_popup.qml')
-rw-r--r-- | tests/auto/controls/data/tst_popup.qml | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index b63bc826..b28a31e8 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -869,17 +869,24 @@ TestCase { Component { id: overlayTest ApplicationWindow { - property alias popup1: popup1 - property alias popup2: popup2 + property alias modalPopup: modalPopup + property alias modelessPopup: modelessPopup + property alias plainPopup: plainPopup visible: true Popup { - id: popup1 + id: modalPopup modal: true exit: Transition { PauseAnimation { duration: 200 } } } Popup { - id: popup2 - modal: true + id: modelessPopup + dim: true + exit: Transition { PauseAnimation { duration: 200 } } + } + Popup { + id: plainPopup + enter: Transition { PauseAnimation { duration: 200 } } + exit: Transition { PauseAnimation { duration: 200 } } } } } @@ -890,18 +897,32 @@ TestCase { window.requestActivate() tryCompare(window, "active", true) - compare(window.overlay.background.opacity, 0.0) - - window.popup1.open() - compare(window.popup1.visible, true) - compare(window.popup2.visible, false) - tryCompare(window.overlay.background, "opacity", 1.0) - - window.popup1.close() - window.popup2.open() - compare(window.popup2.visible, true) - tryCompare(window.popup1, "visible", false) - compare(window.overlay.background.opacity, 1.0) + compare(window.overlay.modal.opacity, 0.0) + compare(window.overlay.modeless.opacity, 0.0) + + window.modalPopup.open() + compare(window.modalPopup.visible, true) + tryCompare(window.overlay.modal, "opacity", 1.0) + + window.modelessPopup.open() + compare(window.modelessPopup.visible, true) + tryCompare(window.overlay.modeless, "opacity", 1.0) + + window.modelessPopup.close() + tryCompare(window.modelessPopup, "visible", false) + tryCompare(window.overlay.modeless, "opacity", 0.0) + + compare(window.modalPopup.visible, true) + compare(window.overlay.modal.opacity, 1.0) + + window.modalPopup.close() + tryCompare(window.modalPopup, "visible", false) + tryCompare(window.overlay.modal, "opacity", 0.0) + + window.plainPopup.open() + tryCompare(window.plainPopup, "visible", true) + compare(window.overlay.modal.opacity, 0.0) + compare(window.overlay.modeless.opacity, 0.0) window.destroy() } |