blob: 4e8bf6b286a9c6496b2b7ef53eb44ee0c0bee4d5 (
plain)
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
65
66
67
68
69
70
71
72
73
|
import QtQuick 2.15
import QtQuick.Controls 2.15
import "."
ComboBox {
id: valaszto
implicitHeight: 44
font.family: Stilus.font
font.pixelSize: 14
background: Rectangle {
color: Stilus.felulet
border.width: 1
border.color: valaszto.activeFocus || valaszto.hovered ? Stilus.zold : Stilus.keretErosebb
}
contentItem: Text {
leftPadding: 12
rightPadding: 32
text: valaszto.displayText
color: Stilus.szoveg
font: valaszto.font
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
indicator: Image {
x: valaszto.width - width - 12
y: (valaszto.height - height) / 2
width: 12
height: 12
source: "../arrow-down.svg"
sourceSize.width: 24
sourceSize.height: 24
}
delegate: ItemDelegate {
width: valaszto.width
height: 36
highlighted: valaszto.highlightedIndex === index
background: Rectangle {
color: highlighted ? Stilus.aktiv : Stilus.felulet
}
contentItem: Text {
leftPadding: 12
text: valaszto.textAt(index)
color: Stilus.szoveg
font: valaszto.font
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
}
popup: Popup {
y: valaszto.height
width: valaszto.width
implicitHeight: Math.min(contentItem.implicitHeight + 2, 320)
padding: 1
background: Rectangle {
color: Stilus.felulet
border.width: 1
border.color: Stilus.keretErosebb
}
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: valaszto.popup.visible ? valaszto.delegateModel : null
currentIndex: valaszto.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator {}
}
}
}
|