Commit 835bb58c authored by Martin Straka's avatar Martin Straka

Fixed search combobox size

parent 88993980
......@@ -82,16 +82,29 @@ Component {
ComboBox {
id: searchOptionComboBox
currentIndex: 0
textRole: "key"
width: parent.width
height: inputItemHeight
textRole: "label"
font.pointSize: searchButton.font.pointSize
delegate: ItemDelegate {
width: searchOptionComboBox.width
height: inputItemHeight
contentItem: Text {
text: label
color: datovkaPalette.text
font: searchButton.font
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
highlighted: searchOptionComboBox.highlightedIndex == index
}
model: ListModel {
id: searchOptionComboBoxModel
// Don't change position of list elements and keys.
/* Cannot have an expression here becacuse QML complains that it cannot use script for property value. */
ListElement { key: qsTr("All messages"); value: -1 }
ListElement { key: qsTr("Received messages"); value: MessageType.TYPE_RECEIVED }
ListElement { key: qsTr("Sent messages"); value: MessageType.TYPE_SENT }
ListElement { label: qsTr("All messages"); value: -1 }
ListElement { label: qsTr("Received messages"); value: MessageType.TYPE_RECEIVED }
ListElement { label: qsTr("Sent messages"); value: MessageType.TYPE_SENT }
}
onCurrentIndexChanged: {
if (searchOptionComboBoxModel.get(currentIndex).value == -1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment