Commit 83dfe783 authored by Ronan Abhamon's avatar Ronan Abhamon

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

parent 208c28a9
...@@ -52,11 +52,7 @@ Item { ...@@ -52,11 +52,7 @@ Item {
} }
function _filter (text) { function _filter (text) {
Utils.assert( Utils.assert(model.setFilter != null, '`model.setFilter` must be defined.')
model.setFilter != null,
'`model.setFilter` must be defined.'
)
model.setFilter(text) model.setFilter(text)
} }
......
...@@ -17,12 +17,16 @@ SearchBox { ...@@ -17,12 +17,16 @@ SearchBox {
signal launchCall (string sipAddress) signal launchCall (string sipAddress)
signal launchVideoCall (string sipAddress) signal launchVideoCall (string sipAddress)
signal entryClicked (var entry)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Header. // Header.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
header: MouseArea { header: MouseArea {
readonly property string interpretableSipAddress: SipAddressesModel.interpretUrl(searchBox.filter) readonly property string interpretableSipAddress: SipAddressesModel.interpretUrl(
searchBox.filter
)
height: { height: {
var height = SmartSearchBarStyle.header.addButtonHeight var height = SmartSearchBarStyle.header.addButtonHeight
...@@ -31,7 +35,7 @@ SearchBox { ...@@ -31,7 +35,7 @@ SearchBox {
width: parent.width width: parent.width
// Workaround to handle mouse. // 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 hoverEnabled: true
Column { Column {
...@@ -195,6 +199,20 @@ SearchBox { ...@@ -195,6 +199,20 @@ SearchBox {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
entry: $entry 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 { ...@@ -167,6 +167,13 @@ ApplicationWindow {
}) })
} }
onLaunchVideoCall: CallsWindow.show() 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