-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClockHand.qml
More file actions
37 lines (33 loc) · 1.02 KB
/
ClockHand.qml
File metadata and controls
37 lines (33 loc) · 1.02 KB
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
import QtQuick 2.15
Item {
id: clockHand
property alias color: text.color
property alias content: text.text
property alias fontSize: text.font.pixelSize
property alias angle: clockHand.rotation
Item {
id: clockHandItem
property bool flip: angle > 90 && angle < 270
width: handRow.contentWidth
height: text.contentHeight
anchors.centerIn: parent
anchors.verticalCenterOffset: clockHandItem.flip ? text.contentHeight : 0
anchors.horizontalCenterOffset: clockHandItem.flip ? text.contentWidth : 0
Row {
id: handRow
anchors.centerIn: parent
Text {
id: text
font.bold: true
transform: Scale {
xScale: clockHandItem.flip ? -1 : 1
yScale: clockHandItem.flip ? -1 : 1
}
}
Item {
width: text.contentWidth
height: text.contentHeight
}
}
}
}