Newer
Older
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.0
ComboBox {
///@detalis normalColorText Text color in normal state.
property string normalColorText: "#070023"
///@detalis hilightColorText Text color in selected state.
property string hilightColorText: "#FFFFFF"
///@detalis normalColorTopText Text color in the main line in normal state.
property string normalColorTopText: normalColorText
///@detalis hilightColorTopText Text color in the main line in active state.
property string hilightColorTopText: normalColorText
///@detalis normalColor Item color in normal state.
property string normalColor: "#FFFFFF"
///@detalis hilightColor Item color in selected state.
property string hilightColor: "#330F54"
///@detalis normalTopColor Top string color in normal state.
property string normalTopColor: normalColor
///@detalis hilightTopColor Top string color in selected state.
property string hilightTopColor: normalColor
///@detalis fontSizeComboBox Font size for the entire widget.
property int fontSizeComboBox: 16 * pt
///@detalis widthPopupComboBoxNormal Width of the combo box in the normal state.
property int widthPopupComboBoxNormal: parent.width
///@detalis widthPopupComboBoxActive Width of the ComboBox in the active state.
property int widthPopupComboBoxActive: widthPopupComboBoxNormal
///@detalis heightComboBoxNormal Height of the ComboBox in the normal state.
property int heightComboBoxNormal: parent.height
///@detalis heightComboBoxActive Height of the ComboBox in the active state.
property int heightComboBoxActive: heightComboBoxNormal
///@detalis sidePaddingNormal: Sets the indent from the edge of the right and left edges of the parent in the normal state.
property int sidePaddingNormal: 16 * pt
///@detalis sidePaddingActive Sets the indent from the edge of the right and left edges of the parent in the active state.
property int sidePaddingActive: sidePaddingNormal
///@detalis topIndentNormal Sets the indent from the edge of the upper of the parent in the normal state.
property int topIndentNormal: 12 * pt
///@detalis topIndentActive Sets the indent from the edge of the upper of the parent in the active state.
property int topIndentActive: topIndentNormal
///@detalis bottomIndentNormal Sets the indent from the edge of the lower of the parent in the normal state.
property int bottomIndentNormal: 14 * pt
///@detalis bottomIndentActive Sets the indent from the edge of the lower of the parent in the active state.
property int bottomIndentActive: bottomIndentNormal
///@detalis paddingTopItemDelegate Indent above from item delegate.
property int paddingTopItemDelegate: 8 * pt
///@detalis paddingBottomItemDelegate Indent below from item delegate.
property int paddingBottomItemDelegate: paddingTopItemDelegate
///@detalis heightListElement List item height.
property int heightListElement: 32 * pt
///@detalis intervalListElement Spacing between items in a list.
property int intervalListElement: 10 * pt
///@detalis bottomIntervalListElement Spacing from bottom to bottom.
property int bottomIntervalListElement: intervalListElement
///@detalis topEffect Using an effect for the top element.
property bool topEffect: true
///@detalis indicatorImageNormal Indicator picture address for normal state.
property string indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down_dark_blue.png"
///@detalis indicatorImageActive Indicator picture address for active state.
property string indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up_dark_blue.png"
///@detalis indicatorWidth Indicator width.
property int indicatorWidth: 24 * pt
///@detalis indicatorHeight Indicator height.
property int indicatorHeight: indicatorWidth
/// colorTopNormalDropShadow Color of the shadow effect of the combo box when minimized.
property string colorTopNormalDropShadow: "#00000000"
///@detalis colorDropShadow Unboxed shadow color in expanded state.
property string colorDropShadow: "#40ABABAB"
///@detalis countComboBox this variable indicates the number of lines in the list for
///the delegate in the file DapComboBox.qml.
property int countComboBox: customComboBox.count
id: customComboBox
width: popup.visible ? widthPopupComboBoxActive : widthPopupComboBoxNormal
height: popup.visible ? heightComboBoxActive : heightComboBoxNormal
anchors.verticalCenter: parent.verticalCenter
//Icon icon near the text (arrow)
indicator: Image {
source: parent.popup.visible ? indicatorImageActive : indicatorImageNormal
width: indicatorWidth
height: indicatorHeight
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: popup.visible ? sidePaddingActive : sidePaddingNormal
}
//Defining the background for the main line
background: Rectangle {
anchors.fill: parent
color: parent.popup.visible ? hilightTopColor : normalTopColor
radius: 2 * pt
height: parent.height
}
//Main line text settings
contentItem: Text {
anchors.fill: parent
anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal
text: parent.displayText
font.family: fontRobotoRegular.name
font.pixelSize: fontSizeComboBox
color: popup.visible ? hilightColorTopText : normalColorTopText
verticalAlignment: Text.AlignVCenter
}
//Customize drop-down list with shadow effect
popup: Popup {
y: parent.height - 1
width: parent.width + 1
padding: 1
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: customComboBox.popup.visible ? customComboBox.delegateModel : null
ScrollIndicator.vertical: ScrollIndicator {}
}
background: Rectangle {
width: customComboBox.background.width
color: parent.color
Rectangle {
id: contentCorner
anchors.fill: parent
}
DropShadow {
anchors.fill: parent
source: contentCorner
verticalOffset: 9 * pt
samples: 13 * pt
color: colorDropShadow
}
}
}
//Shadow effect for the top element.
DropShadow {
anchors.fill: if (topEffect)
parent
source: if (topEffect)
background
verticalOffset: if (topEffect)
9 * pt
samples: if (topEffect)
13 * pt
color: if (topEffect)
customComboBox.popup.visible ? colorDropShadow : colorTopNormalDropShadow
}
}