KQuickImageEditor

RectangleCutout.qml
1/* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
2 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
3 */
4
5import QtQuick 2.15
6
7Item {
8 id: root
9 property color color: Qt.rgba(0,0,0,0.5)
10 property real insideX: 0
11 property real insideY: 0
12 property real insideWidth: width
13 property real insideHeight: height
14 // NOTE: Using 4 Rectangles is visibly smoother than using an OpacityMask effect
15 Rectangle {
16 id: topTintRect
17 LayoutMirroring.enabled: false
18 anchors.left: parent.left
19 anchors.right: parent.right
20 anchors.top: parent.top
21 height: root.insideY
22 color: root.color
23 }
24
25 Rectangle {
26 id: leftTintRect
27 LayoutMirroring.enabled: false
28 anchors.left: parent.left
29 anchors.top: topTintRect.bottom
30 anchors.bottom: bottomTintRect.top
31 width: root.insideX
32 color: root.color
33 }
34
35 Rectangle {
36 id: rightTintRect
37 LayoutMirroring.enabled: false
38 anchors.right: parent.right
39 anchors.top: topTintRect.bottom
40 anchors.bottom: bottomTintRect.top
41 width: root.width - root.insideX - root.insideWidth
42 color: root.color
43 }
44
45 Rectangle {
46 id: bottomTintRect
47 LayoutMirroring.enabled: false
48 anchors.left: parent.left
49 anchors.right: parent.right
50 anchors.bottom: parent.bottom
51 height: root.height - root.insideY - root.insideHeight
52 color: root.color
53 }
54}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:07:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.