-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPickerRow.qml
More file actions
57 lines (54 loc) · 1.4 KB
/
Copy pathPickerRow.qml
File metadata and controls
57 lines (54 loc) · 1.4 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import QtQuick
import qs.Commons
Rectangle {
id: root
property string label: ""
property string iconSource: ""
property string glyph: ""
signal chosen()
implicitHeight: Style.space(42)
radius: 7
color: pointer.containsMouse ? Color.bar.background : "transparent"
border.width: pointer.containsMouse ? 1 : 0
border.color: Color.accent
Image {
id: appIcon
visible: root.iconSource !== ""
x: Style.space(9)
anchors.verticalCenter: parent.verticalCenter
width: Style.space(26)
height: width
source: root.iconSource
fillMode: Image.PreserveAspectFit
asynchronous: true
}
Text {
visible: !appIcon.visible || appIcon.status === Image.Error
x: Style.space(9)
anchors.verticalCenter: parent.verticalCenter
width: Style.space(26)
text: root.glyph
color: Color.accent
font.family: Style.font.family
font.pixelSize: Style.font.iconLarge
horizontalAlignment: Text.AlignHCenter
}
Text {
x: Style.space(44)
anchors.verticalCenter: parent.verticalCenter
width: parent.width - x - Style.space(10)
text: root.label
textFormat: Text.PlainText
elide: Text.ElideRight
color: Color.popups.text
font.family: Style.font.family
font.pixelSize: Style.font.body
}
MouseArea {
id: pointer
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.chosen()
}
}