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 /src/imports | |
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 'src/imports')
-rw-r--r-- | src/imports/controls/ApplicationWindow.qml | 6 | ||||
-rw-r--r-- | src/imports/controls/material/ApplicationWindow.qml | 7 | ||||
-rw-r--r-- | src/imports/controls/universal/ApplicationWindow.qml | 6 | ||||
-rw-r--r-- | src/imports/templates/plugins.qmltypes | 4 |
4 files changed, 19 insertions, 4 deletions
diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml index cc30c601..98de8946 100644 --- a/src/imports/controls/ApplicationWindow.qml +++ b/src/imports/controls/ApplicationWindow.qml @@ -43,7 +43,11 @@ T.ApplicationWindow { color: "#ffffff" - overlay.background: Rectangle { + overlay.modal: Rectangle { color: "#7f28282a" } + + overlay.modeless: Rectangle { + color: "#1f28282a" + } } diff --git a/src/imports/controls/material/ApplicationWindow.qml b/src/imports/controls/material/ApplicationWindow.qml index a09cd89f..db27f25b 100644 --- a/src/imports/controls/material/ApplicationWindow.qml +++ b/src/imports/controls/material/ApplicationWindow.qml @@ -44,7 +44,12 @@ T.ApplicationWindow { color: Material.backgroundColor - overlay.background: Rectangle { + overlay.modal: Rectangle { + color: window.Material.backgroundDimColor + Behavior on opacity { NumberAnimation { duration: 150 } } + } + + overlay.modeless: Rectangle { color: window.Material.backgroundDimColor Behavior on opacity { NumberAnimation { duration: 150 } } } diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml index 664229a3..70bd403c 100644 --- a/src/imports/controls/universal/ApplicationWindow.qml +++ b/src/imports/controls/universal/ApplicationWindow.qml @@ -44,7 +44,11 @@ T.ApplicationWindow { color: Universal.background - overlay.background: Rectangle { + overlay.modal: Rectangle { + color: window.Universal.baseLowColor + } + + overlay.modeless: Rectangle { color: window.Universal.baseLowColor } diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes index af573750..b4155841 100644 --- a/src/imports/templates/plugins.qmltypes +++ b/src/imports/templates/plugins.qmltypes @@ -491,7 +491,8 @@ Module { name: "QQuickOverlay" defaultProperty: "data" prototype: "QQuickItem" - Property { name: "background"; type: "QQuickItem"; isPointer: true } + Property { name: "modal"; type: "QQuickItem"; isPointer: true } + Property { name: "modeless"; type: "QQuickItem"; isPointer: true } Signal { name: "pressed" } Signal { name: "released" } } @@ -591,6 +592,7 @@ Module { Property { name: "focus"; type: "bool" } Property { name: "activeFocus"; type: "bool"; isReadonly: true } Property { name: "modal"; type: "bool" } + Property { name: "dim"; type: "bool" } Property { name: "visible"; type: "bool" } Property { name: "opacity"; type: "double" } Property { name: "scale"; type: "double" } |