forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComboBox.qml
64 lines (52 loc) · 1.49 KB
/
ComboBox.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
61
62
63
64
import "." as Skin
import QtQuick 2.12
import QtQuick.Controls 2.12
import "Theme"
ComboBox {
id: root
background: Skin.EmbeddedBackground {
}
delegate: ItemDelegate {
id: itemDlgt
required property int index
width: parent.width
highlighted: root.highlightedIndex === this.index
text: root.textAt(this.index)
contentItem: Text {
text: itemDlgt.text
color: Theme.deckTextColor
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
background: Rectangle {
radius: 5
border.width: itemDlgt.highlighted ? 1 : 0
border.color: Theme.deckLineColor
color: "transparent"
}
}
contentItem: Text {
leftPadding: 5
rightPadding: root.indicator.width + root.spacing
text: root.displayText
font: root.font
color: Theme.deckTextColor
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
popup: Popup {
y: root.height
width: root.width
implicitHeight: contentItem.implicitHeight
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: root.popup.visible ? root.delegateModel : null
currentIndex: root.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator {
}
}
background: Skin.EmbeddedBackground {
}
}
}