linphone-desktop/tests/ui/modules/Linphone/Form/TransparentComboBox.qml
2016-09-28 11:30:52 +02:00

31 lines
823 B
QML

import QtQuick 2.7
import QtQuick.Controls 2.0
import Linphone.Styles 1.0
// ===================================================================
// Discrete ComboBox that can be integrated in text.
// ===================================================================
ComboBox {
id: comboBox
background: Rectangle {
color: 'transparent' // No Style constant, see component name.
}
delegate: ItemDelegate {
id: item
background: Rectangle {
color: item.down
? TransparentComboBoxStyle.item.color.pressed
: (comboBox.currentIndex === index
? TransparentComboBoxStyle.item.color.selected
: TransparentComboBoxStyle.item.color.normal
)
}
font.bold: comboBox.currentIndex === index
text: key || modelData
width: comboBox.width
}
}