-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWellBar.qml
60 lines (42 loc) · 1.19 KB
/
WellBar.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
57
58
59
60
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
Rectangle {
id: root
property alias fontFamily: labelFontMetrics.font.family
property real fontSizeMm: 4
property alias title: wellTitle.text
// TODO: icon
signal doubleClicked
TextMetrics {
id: labelFontMetrics
property real dpMM: Screen.pixelDensity
font.family: "Arial"
font.pixelSize: root.fontSizeMm * dpMM
text: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}
// plus 10%
height: labelFontMetrics.height * 1.10
Text {
id: wellTitle
font: labelFontMetrics.font
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
Image {
id: wellIcon
height: 0.8 * labelFontMetrics.height
width: height
anchors.verticalCenter: wellTitle.verticalCenter
anchors.right: wellTitle.left
anchors.rightMargin: 0.25 * width
source: "qrc:///scenegraph/graph/shaders/lateral_mask.png"
}
MouseArea {
anchors.fill: parent
onDoubleClicked: {
root.doubleClicked()
}
}
}