Commit 95ce08e7 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/modules/Linphone/SmartSearchBar): handle correctly mouse hover header

parent c5427180
......@@ -17,9 +17,11 @@ SearchBox {
signal launchCall (string sipAddress)
signal launchVideoCall (string sipAddress)
// ---------------------------------------------------------------------------
// Header.
// ---------------------------------------------------------------------------
header: Column {
header: MouseArea {
readonly property string interpretableSipAddress: SipAddressesModel.interpretUrl(searchBox.filter)
height: {
......@@ -28,123 +30,130 @@ SearchBox {
}
width: parent.width
spacing: 0
// Workaround to handle mouse.
// Without it, the mouse can be given to items list when it is hover header.
hoverEnabled: true
// -------------------------------------------------------------------------
// Default contact.
// -------------------------------------------------------------------------
Column {
anchors.fill: parent
Loader {
id: defaultContact
spacing: 0
height: searchBox.entryHeight
width: parent.width
// -----------------------------------------------------------------------
// Default contact.
// -----------------------------------------------------------------------
visible: interpretableSipAddress.length > 0
Loader {
id: defaultContact
sourceComponent: Rectangle {
anchors.fill: parent
color: SmartSearchBarStyle.entry.color.normal
height: searchBox.entryHeight
width: parent.width
RowLayout {
anchors {
fill: parent
rightMargin: SmartSearchBarStyle.entry.rightMargin
}
spacing: 0
visible: interpretableSipAddress.length > 0
Contact {
id: contact
sourceComponent: Rectangle {
anchors.fill: parent
color: SmartSearchBarStyle.entry.color.normal
Layout.fillHeight: true
Layout.fillWidth: true
entry: Object ({
sipAddress: interpretableSipAddress
})
}
RowLayout {
anchors {
fill: parent
rightMargin: SmartSearchBarStyle.entry.rightMargin
}
spacing: 0
ActionBar {
iconSize: SmartSearchBarStyle.entry.iconSize
Contact {
id: contact
ActionButton {
icon: 'video_call'
onClicked: {
searchBox.hideMenu()
searchBox.launchVideoCall(interpretableSipAddress)
}
Layout.fillHeight: true
Layout.fillWidth: true
entry: Object ({
sipAddress: interpretableSipAddress
})
}
ActionButton {
icon: 'call'
onClicked: {
searchBox.hideMenu()
searchBox.launchCall(interpretableSipAddress)
ActionBar {
iconSize: SmartSearchBarStyle.entry.iconSize
ActionButton {
icon: 'video_call'
onClicked: {
searchBox.hideMenu()
searchBox.launchVideoCall(interpretableSipAddress)
}
}
ActionButton {
icon: 'call'
onClicked: {
searchBox.hideMenu()
searchBox.launchCall(interpretableSipAddress)
}
}
}
ActionButton {
icon: 'chat'
onClicked: {
searchBox.hideMenu()
searchBox.launchChat(interpretableSipAddress)
ActionButton {
icon: 'chat'
onClicked: {
searchBox.hideMenu()
searchBox.launchChat(interpretableSipAddress)
}
}
}
}
}
}
}
// -------------------------------------------------------------------------
// Add contact button.
// -------------------------------------------------------------------------
// -----------------------------------------------------------------------
// Add contact button.
// -----------------------------------------------------------------------
MouseArea {
id: addContactButton
MouseArea {
id: addContactButton
height: SmartSearchBarStyle.header.addButtonHeight
width: parent.width
height: SmartSearchBarStyle.header.addButtonHeight
width: parent.width
onClicked: {
searchBox.hideMenu()
searchBox.addContact(interpretableSipAddress)
}
onClicked: {
searchBox.hideMenu()
searchBox.addContact(interpretableSipAddress)
}
Rectangle {
anchors.fill: parent
color: parent.pressed
? SmartSearchBarStyle.header.color.pressed
: SmartSearchBarStyle.header.color.normal
Text {
anchors {
left: parent.left
leftMargin: SmartSearchBarStyle.header.leftMargin
verticalCenter: parent.verticalCenter
}
font {
bold: true
pointSize: SmartSearchBarStyle.header.text.fontSize
Rectangle {
anchors.fill: parent
color: parent.pressed
? SmartSearchBarStyle.header.color.pressed
: SmartSearchBarStyle.header.color.normal
Text {
anchors {
left: parent.left
leftMargin: SmartSearchBarStyle.header.leftMargin
verticalCenter: parent.verticalCenter
}
font {
bold: true
pointSize: SmartSearchBarStyle.header.text.fontSize
}
color: addContactButton.pressed
? SmartSearchBarStyle.header.text.color.pressed
: SmartSearchBarStyle.header.text.color.normal
text: qsTr('addContact')
}
color: addContactButton.pressed
? SmartSearchBarStyle.header.text.color.pressed
: SmartSearchBarStyle.header.text.color.normal
text: qsTr('addContact')
}
Icon {
anchors {
right: parent.right
rightMargin: SmartSearchBarStyle.header.rightMargin
verticalCenter: parent.verticalCenter
Icon {
anchors {
right: parent.right
rightMargin: SmartSearchBarStyle.header.rightMargin
verticalCenter: parent.verticalCenter
}
icon: 'contact_add'
iconSize: SmartSearchBarStyle.header.iconSize
}
icon: 'contact_add'
iconSize: SmartSearchBarStyle.header.iconSize
}
}
}
}
// ---------------------------------------------------------------------------
// Entries.
// ---------------------------------------------------------------------------
......
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