-
Notifications
You must be signed in to change notification settings - Fork 0
/
Material_Image.qml
56 lines (55 loc) · 1.77 KB
/
Material_Image.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import QtQuick 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Controls.Material.impl 2.15
import QtQuick.Controls 6.2
import Qt5Compat.GraphicalEffects
Image {
id: control
property double radius: 0
property bool elevated: false
property int elevation: 0
property bool roundLeftTop: true
property bool roundRightTop: true
property bool roundLeftBottom: true
property bool roundRightBottom: true
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
width: control.width
height: control.height
radius: control.radius
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
visible: !control.roundLeftTop
width: control.radius * 2
height: control.radius * 2
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
visible: !control.roundRightTop
width: control.radius * 2
height: control.radius * 2
}
Rectangle {
anchors.left: parent.left
anchors.bottom: parent.bottom
visible: !control.roundLeftBottom
width: control.radius * 2
height: control.radius * 2
}
Rectangle {
anchors.right: parent.right
anchors.bottom: parent.bottom
visible: !control.roundRightBottom
width: control.radius * 2
height: control.radius * 2
}
}
layer.enabled: control.elevated
layer.effect: ElevationEffect {
elevation: control.elevation
}
}
}