Commit 83dfe783 authored by Ronan's avatar Ronan
Browse files

feat(ui/modules/Linphone/SmartSearchBar): handle click on entries

parent 208c28a9
......@@ -52,11 +52,7 @@ Item {
}
function _filter (text) {
Utils.assert(
model.setFilter != null,
'`model.setFilter` must be defined.'
)
Utils.assert(model.setFilter != null, '`model.setFilter` must be defined.')
model.setFilter(text)
}
......
......@@ -17,12 +17,16 @@ SearchBox {
signal launchCall (string sipAddress)
signal launchVideoCall (string sipAddress)
signal entryClicked (var entry)
// ---------------------------------------------------------------------------
// Header.
// ---------------------------------------------------------------------------
header: MouseArea {
readonly property string interpretableSipAddress: SipAddressesModel.interpretUrl(searchBox.filter)
readonly property string interpretableSipAddress: SipAddressesModel.interpretUrl(
searchBox.filter
)
height: {
var height = SmartSearchBarStyle.header.addButtonHeight
......@@ -31,7 +35,7 @@ SearchBox {
width: parent.width
// Workaround to handle mouse.
// Without it, the mouse can be given to items list when it is hover header.
// Without it, the mouse can be given to items list when mouse is hover header.
hoverEnabled: true
Column {
......@@ -195,6 +199,20 @@ SearchBox {
Layout.fillHeight: true
Layout.fillWidth: true
entry: $entry
MouseArea {
anchors.fill: parent
cursorShape: containsMouse
? Qt.PointingHandCursor
: Qt.ArrowCursor
hoverEnabled: true
onClicked: {
searchBox.hideMenu()
searchBox.entryClicked($entry)
}
}
}
// -------------------------------------------------------------------
......
......@@ -167,6 +167,13 @@ ApplicationWindow {
})
}
onLaunchVideoCall: CallsWindow.show()
onEntryClicked: {
window.ensureCollapsed()
window.setView(entry.contact ? 'ContactEdit' : 'Conversation', {
sipAddress: entry.sipAddress
})
}
}
}
}
......
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