mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-23 21:58:30 +00:00
feat(ui/modules/Linphone/SmartSearchBar): handle enter pressed
This commit is contained in:
parent
83dfe7835c
commit
491ceedda7
2 changed files with 15 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ Item {
|
||||||
|
|
||||||
signal menuClosed
|
signal menuClosed
|
||||||
signal menuOpened
|
signal menuOpened
|
||||||
|
signal enterPressed
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -72,6 +73,10 @@ Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
Keys.onEscapePressed: searchBox.hideMenu()
|
Keys.onEscapePressed: searchBox.hideMenu()
|
||||||
|
Keys.onReturnPressed: {
|
||||||
|
searchBox.hideMenu()
|
||||||
|
searchBox.enterPressed()
|
||||||
|
}
|
||||||
|
|
||||||
onActiveFocusChanged: activeFocus && searchBox.showMenu()
|
onActiveFocusChanged: activeFocus && searchBox.showMenu()
|
||||||
onTextChanged: _filter(text)
|
onTextChanged: _filter(text)
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,12 @@ SearchBox {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
readonly property string interpretableSipAddress: SipAddressesModel.interpretUrl(
|
||||||
|
searchBox.filter
|
||||||
|
)
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
signal addContact (string sipAddress)
|
signal addContact (string sipAddress)
|
||||||
signal launchChat (string sipAddress)
|
signal launchChat (string sipAddress)
|
||||||
signal launchCall (string sipAddress)
|
signal launchCall (string sipAddress)
|
||||||
|
|
@ -19,14 +25,15 @@ SearchBox {
|
||||||
|
|
||||||
signal entryClicked (var entry)
|
signal entryClicked (var entry)
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
onEnterPressed: interpretableSipAddress.length > 0 && searchBox.launchCall(interpretableSipAddress)
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Header.
|
// Header.
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
header: MouseArea {
|
header: MouseArea {
|
||||||
readonly property string interpretableSipAddress: SipAddressesModel.interpretUrl(
|
|
||||||
searchBox.filter
|
|
||||||
)
|
|
||||||
|
|
||||||
height: {
|
height: {
|
||||||
var height = SmartSearchBarStyle.header.addButtonHeight
|
var height = SmartSearchBarStyle.header.addButtonHeight
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue