KQuickImageEditor

SelectionBackground.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
6import QtQuick.Shapes
7import org.kde.kirigami as Kirigami
8
9Shape {
10 id: root
11 property bool enableAnimation: !(root.parent instanceof SelectionTool)
12 || !(parent.selectionArea.drag.active
13 || (parent.pressedHandle && parent.pressedHandle.drag.active))
14 Rectangle {
15 z: -1
16 anchors.fill: parent
17 anchors.margins: -1
18 color: "transparent"
19 border.color: Kirigami.Theme.highlightColor
20 border.width: 1
21 }
22 ShapePath {
23 id: shapePath
24 fillColor: "transparent"
25 strokeWidth: 1
26 strokeColor: "white"
27 strokeStyle: ShapePath.DashLine
28 // for some reason, +2 makes the spacing and dash lengths the same, no matter what the strokeWidth is.
29 dashPattern: [Kirigami.Units.smallSpacing / strokeWidth, Kirigami.Units.smallSpacing / strokeWidth + 2]
30 dashOffset: 0
31 startX: -strokeWidth/2; startY: startX
32 PathLine { x: root.width - shapePath.startX; y: shapePath.startY }
33 PathLine { x: root.width - shapePath.startX; y: root.height - shapePath.startY }
34 PathLine { x: shapePath.startX; y: root.height - shapePath.startY }
35 PathLine { x: shapePath.startX; y: shapePath.startY }
36 NumberAnimation on dashOffset {
37 running: root.enableAnimation
38 loops: Animation.Infinite
39 from: shapePath.dashOffset; to: shapePath.dashOffset + shapePath.dashPattern[0] + shapePath.dashPattern[1]
40 duration: 1000
41 }
42 }
43}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:55:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.