fix(ui/modules/Common/Form/SearchBox): emit enter pressed before closed signal

This commit is contained in:
Ronan Abhamon 2017-06-14 10:22:40 +02:00
parent f7d8f6ba16
commit 07da8b532b
2 changed files with 15 additions and 15 deletions

View file

@ -69,8 +69,8 @@ Item {
Keys.onEscapePressed: searchBox.closeMenu()
Keys.onReturnPressed: {
searchBox.closeMenu()
searchBox.enterPressed()
searchBox.closeMenu()
}
onActiveFocusChanged: {

View file

@ -6,11 +6,11 @@ import Linphone.Styles 1.0
// =============================================================================
SearchBox {
id: searchBar
id: searchBox
// ---------------------------------------------------------------------------
readonly property alias isOpen: searchBar._isOpen
readonly property alias isOpen: searchBox._isOpen
// ---------------------------------------------------------------------------
@ -29,7 +29,7 @@ SearchBox {
onEnterPressed: {
var sipAddress = view.interpretableSipAddress
return sipAddress.length > 0 && searchBar.launchCall(sipAddress)
return sipAddress.length > 0 && searchBox.launchCall(sipAddress)
}
// ---------------------------------------------------------------------------
@ -40,37 +40,37 @@ SearchBox {
actions: [{
icon: 'video_call',
handler: function (entry) {
searchBar.closeMenu()
searchBar.launchVideoCall(entry.sipAddress)
searchBox.closeMenu()
searchBox.launchVideoCall(entry.sipAddress)
}
}, {
icon: 'call',
handler: function (entry) {
searchBar.closeMenu()
searchBar.launchCall(entry.sipAddress)
searchBox.closeMenu()
searchBox.launchCall(entry.sipAddress)
}
}, {
icon: 'chat',
handler: function (entry) {
searchBar.closeMenu()
searchBar.launchChat(entry.sipAddress)
searchBox.closeMenu()
searchBox.launchChat(entry.sipAddress)
}
}]
headerButtonDescription: qsTr('addContact')
headerButtonIcon: 'contact_add'
headerButtonAction: (function (sipAddress) {
searchBar.closeMenu()
searchBar.addContact(sipAddress)
searchBox.closeMenu()
searchBox.addContact(sipAddress)
})
genSipAddress: searchBar.filter
genSipAddress: searchBox.filter
model: SipAddressesProxyModel {}
onEntryClicked: {
searchBar.closeMenu()
searchBar.entryClicked(entry)
searchBox.closeMenu()
searchBox.entryClicked(entry)
}
}
}