Add drop shadow and resize select border in CVElem

This commit is contained in:
2022-08-28 00:29:49 -04:00
parent 35cf23dc95
commit 3c6ca152dc
+13 -2
View File
@@ -1,5 +1,6 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtGraphicalEffects 1.12
Column { Column {
@@ -37,11 +38,12 @@ Column {
property int childHeight: 300 property int childHeight: 300
property int childWidth: 300 * 0.68 property int childWidth: 300 * 0.68
property int borderWidth: 7 property int borderWidth: 7
property int borderRadius: 7 property int borderRadius: 3
height: 300 + (borderWidth * 2) height: 300 + (borderWidth * 2)
width: (300 * 0.68) + (borderWidth * 2) width: (300 * 0.68) + (borderWidth * 2)
state: (elemSelected && (index == xIndex)) ? "selected" : "deselected" state: (elemSelected && (index == xIndex)) ? "selected" : "deselected"
Image { Image {
id: img
height: parent.childHeight height: parent.childHeight
width: parent.childWidth width: parent.childWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@@ -58,6 +60,15 @@ Column {
border.width: parent.borderWidth border.width: parent.borderWidth
radius: parent.borderRadius radius: parent.borderRadius
} }
DropShadow {
anchors.fill: img
horizontalOffset: 5
verticalOffset: 5
radius: 8.0
samples: 17
color: "#80000000"
source: img
}
states: [ states: [
State { State {
name: "deselected" name: "deselected"
@@ -78,7 +89,7 @@ Column {
Transition { Transition {
NumberAnimation { NumberAnimation {
properties: "border.width" properties: "border.width"
duration: 50 duration: 100
easing.type: Easing.Linear easing.type: Easing.Linear
} }
} }