feat(ProfileShowcase): Add blur delegate state while dragging

- Added `FastBlur` component to `ShowcaseDelegate` and added property to change to blur state.
- Updated `ProfileShowcasePanel` to activate blur delegate state when dragging.

Closes #13594
This commit is contained in:
Noelia 2024-02-23 12:28:19 +01:00 committed by Noelia
parent 085bf762a5
commit 90f4e1477c
2 changed files with 34 additions and 15 deletions

View File

@ -1,6 +1,8 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.0
import QtQml 2.15
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
@ -17,6 +19,7 @@ StatusDraggableListItem {
property var showcaseObj
property int showcaseVisibility: Constants.ShowcaseVisibility.NoOne
property bool blurState: false
signal showcaseVisibilityRequested(int value)
@ -26,6 +29,9 @@ StatusDraggableListItem {
icon.color: Theme.palette.primaryColor1
}
layer.enabled: root.blurState
layer.effect: fastBlur
height: ProfileUtils.defaultDelegateHeight
topInset: 0
bottomInset: 0
@ -106,4 +112,13 @@ StatusDraggableListItem {
}
}
]
Component {
id: fastBlur
FastBlur {
radius: 32
transparentBorder: true
}
}
}

View File

@ -128,7 +128,7 @@ DoubleFlickableWithFolding {
property int visualIndexData: index
width: parent.width
sourceComponent: !dropAreaRow.visible ? root.showcaseDraggableDelegateComponent : emptyDelegate // TODO: Blur delegate issue ##13594
sourceComponent: root.showcaseDraggableDelegateComponent
}
// Delegate shadow background when dragging:
@ -138,6 +138,14 @@ DoubleFlickableWithFolding {
visible: showcaseDraggableDelegateLoader.item && showcaseDraggableDelegateLoader.item.dragActive
onVisibleChanged: d.isAnyShowcaseDragActive = visible
}
Binding {
when: dropAreaRow.visible
target: showcaseDraggableDelegateLoader.item
property: "blurState"
value: true
restoreMode: Binding.RestoreBindingOrValue
}
}
// Overlaid showcase listview content drop area:
@ -213,7 +221,7 @@ DoubleFlickableWithFolding {
property int visualIndexData: hiddenDelegateRoot.visualIndex
width: parent.width
sourceComponent: !hiddenDropAreaButton.visible ? root.hiddenDraggableDelegateComponent : emptyDelegate // TODO: Blur delegate issue ##13594
sourceComponent: root.hiddenDraggableDelegateComponent
}
// Delegate shadow background when dragging:
@ -222,7 +230,15 @@ DoubleFlickableWithFolding {
visible: hiddenDraggableDelegateLoader.item && hiddenDraggableDelegateLoader.item.dragActive
onVisibleChanged: d.isAnyHiddenDragActive = visible
}
}
Binding {
when: hiddenDropAreaButton.visible
target: hiddenDraggableDelegateLoader.item
property: "blurState"
value: true
restoreMode: Binding.RestoreBindingOrValue
}
}
// Overlaid hidden listview content drop area:
@ -384,16 +400,4 @@ DoubleFlickableWithFolding {
color: Theme.palette.baseColor5
radius: Style.current.radius
}
// TODO: Blur delegate issue ##13594
Component {
id: emptyDelegate
Item {
property bool dragActive: false
width: parent.width
height: ProfileUtils.defaultDelegateHeight
}
}
}