aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2024-04-24 12:07:54 +0200
committerHenning Gruendl <henning.gruendl@qt.io>2024-04-24 12:17:57 +0200
commit35a986c736752e1fd6304e1c119f76cff91e0e50 (patch)
treee92eda3558916d672057e841311c2fb4129a4726
parent529be3ccaecfb78e3fcebba3ac4f4a84276a0b23 (diff)
DesignEffects: Add DropShadow show behind property
* Add showBehind property to DropShadow * Add showBehind property to InnerShadow too in order to avoid issues * Add logic for showBehind in DropShadowPrivate * Change type of _isEffectItem from var to bool Task-number: QDS-12587 Change-Id: Ia914feb3ab64b346608cbb71c213aa4b1b5433c0 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/imports/designeffects/DesignDropShadow.qml1
-rw-r--r--src/imports/designeffects/DesignDropShadowPrivate.qml11
-rw-r--r--src/imports/designeffects/DesignEffect.qml2
-rw-r--r--src/imports/designeffects/DesignEffectPrivate.qml1
-rw-r--r--src/imports/designeffects/DesignInnerShadow.qml1
5 files changed, 12 insertions, 4 deletions
diff --git a/src/imports/designeffects/DesignDropShadow.qml b/src/imports/designeffects/DesignDropShadow.qml
index dbee640..b5907ba 100644
--- a/src/imports/designeffects/DesignDropShadow.qml
+++ b/src/imports/designeffects/DesignDropShadow.qml
@@ -36,6 +36,7 @@ QtObject {
property int offsetY: 4
property int spread: 0
property color color: "#3f000000" // black 25%
+ property bool showBehind: false
property bool visible: true
property string type: "DropShadow"
diff --git a/src/imports/designeffects/DesignDropShadowPrivate.qml b/src/imports/designeffects/DesignDropShadowPrivate.qml
index a47081f..43c786a 100644
--- a/src/imports/designeffects/DesignDropShadowPrivate.qml
+++ b/src/imports/designeffects/DesignDropShadowPrivate.qml
@@ -38,6 +38,8 @@ Item {
property color color: "black"
property real radius: 10
+ property bool showBehind: false
+
required property Item source
readonly property real sourceRotation: root.source.rotation
@@ -149,12 +151,15 @@ Item {
property bool useOffscreenColor: false
property color offscreenColor: "transparent"
- visible: false
+ visible: root.showBehind
+
+ x: root.showBehind ? root.__offset.x : 0
+ y: root.showBehind ? root.__offset.y : 0
width: root.bluredTextureSize.width
height: root.bluredTextureSize.height
- layer.enabled: true
+ layer.enabled: !root.showBehind
layer.sourceRect: Qt.rect(Math.min(0, -root.__offset.x),
Math.min(0, -root.__offset.y),
root.offsetTextureSize.width,
@@ -183,7 +188,7 @@ Item {
property var shadow: blurVertical
property var original: originalSource
- visible: true
+ visible: !root.showBehind
x: -Math.max(0, -root.__offset.x)
y: -Math.max(0, -root.__offset.y)
diff --git a/src/imports/designeffects/DesignEffect.qml b/src/imports/designeffects/DesignEffect.qml
index d20c613..f9166c2 100644
--- a/src/imports/designeffects/DesignEffect.qml
+++ b/src/imports/designeffects/DesignEffect.qml
@@ -50,7 +50,7 @@ Item {
property Item backgroundLayer: null
- property var _isEffectItem: true
+ property bool _isEffectItem: true
onParentChanged: {
if (root.__oldParent && root.__oldParent !== root.parent) {
diff --git a/src/imports/designeffects/DesignEffectPrivate.qml b/src/imports/designeffects/DesignEffectPrivate.qml
index ea50ee0..94977fc 100644
--- a/src/imports/designeffects/DesignEffectPrivate.qml
+++ b/src/imports/designeffects/DesignEffectPrivate.qml
@@ -155,6 +155,7 @@ Item {
spread: root.clamp(modelData.spread, -2048, 2048)
color: modelData.color
radius: root.clamp(modelData.blur, 0, 250)
+ showBehind: modelData.showBehind
visible: modelData.visible
onGeometryChanged: root.calculateBoundingBox()
diff --git a/src/imports/designeffects/DesignInnerShadow.qml b/src/imports/designeffects/DesignInnerShadow.qml
index a6c9616..10ecc34 100644
--- a/src/imports/designeffects/DesignInnerShadow.qml
+++ b/src/imports/designeffects/DesignInnerShadow.qml
@@ -36,6 +36,7 @@ QtObject {
property int offsetY: 4
property int spread: 0
property color color: "#3f000000" // black 25%
+ property bool showBehind: false // This is a dummy property mirroring DropShadow
property bool visible: true
property string type: "InnerShadow"