linphone-desktop/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml
Julien Wadel 08b62fbf3e - Add Multilines on tooltips
- Move Tooltip area to SmartSearchBar item but let parent to set tooltip text (used to not being in conflict with mouse areas from children)
- Revert QtQuick.Window version to 2.2 to be compatible with Qt 5.9
2020-05-18 11:05:13 +02:00

81 lines
2.2 KiB
QML

import QtQuick 2.7
import Common 1.0
import Linphone 1.0
import Linphone.Styles 1.0
// =============================================================================
SearchBox {
id: searchBox
// ---------------------------------------------------------------------------
readonly property alias isOpen: searchBox._isOpen
property alias header : view.headerItem
// ---------------------------------------------------------------------------
signal addContact (string sipAddress)
signal launchChat (string sipAddress)
signal launchCall (string sipAddress)
signal launchVideoCall (string sipAddress)
signal entryClicked (var entry)
// ---------------------------------------------------------------------------
entryHeight: SipAddressesViewStyle.entry.height
// ---------------------------------------------------------------------------
onEnterPressed: {
var sipAddress = view.interpretableSipAddress
return sipAddress.length > 0 && SettingsModel.outgoingCallsEnabled && searchBox.launchCall(sipAddress)
}
// ---------------------------------------------------------------------------
SipAddressesView {
id: view
actions: [{
icon: 'video_call',
handler: function (entry) {
searchBox.closeMenu()
searchBox.launchVideoCall(entry.sipAddress)
},
visible: SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled
}, {
icon: 'call',
handler: function (entry) {
searchBox.closeMenu()
searchBox.launchCall(entry.sipAddress)
},
visible: SettingsModel.outgoingCallsEnabled
}, {
icon: SettingsModel.chatEnabled ? 'chat' : 'history',
handler: function (entry) {
searchBox.closeMenu()
searchBox.launchChat(entry.sipAddress)
}
}]
headerButtonDescription: qsTr('addContact')
headerButtonIcon: 'contact_add'
headerButtonAction: SettingsModel.contactsEnabled && (function (sipAddress) {
searchBox.closeMenu()
searchBox.addContact(sipAddress)
})
genSipAddress: searchBox.filter
model: SipAddressesProxyModel {}
onEntryClicked: {
searchBox.closeMenu()
searchBox.entryClicked(entry)
}
}
}