mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-29 01:39:19 +00:00
feat(ui/modules/Linphone/SmartSearchBar): handle click on entries
This commit is contained in:
parent
208c28a982
commit
83dfe7835c
3 changed files with 28 additions and 7 deletions
|
|
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue