Kirigami-addons

Hand.qml
1/*
2 * SPDX-FileCopyrightText: 2012 Viranch Mehta <viranch.mehta@gmail.com>
3 * SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
4 * SPDX-FileCopyrightText: 2013 David Edmundson <davidedmundson@kde.org>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8
9import QtQuick 2.0
10
11import org.kde.plasma.core 2.0 as PlasmaCore
12
13PlasmaCore.SvgItem {
14 id: secondHand
15
16 property alias rotation: rotation.angle
17 property double svgScale
18
19 width: Math.round(naturalSize.width * svgScale) + Math.round(naturalSize.width * svgScale) % 2
20 height: Math.round(naturalSize.height * svgScale) + width % 2
21 anchors {
22 top: clock.verticalCenter
23 topMargin: -width/2
24 horizontalCenter: clock.horizontalCenter
25 }
26
27 svg: clockSvg
28 smooth: !anim.running
29 transform: Rotation {
30 id: rotation
31 angle: 0
32 origin {
33 x: secondHand.width/2
34 y: secondHand.width/2
35 }
36 Behavior on angle {
37 RotationAnimation {
38 id: anim
39 duration: 200
40 direction: RotationAnimation.Clockwise
41 easing.type: Easing.OutElastic
42 easing.overshoot: 0.5
43 }
44 }
45 }
46}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:11 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.