- 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
This commit is contained in:
Julien Wadel 2020-05-18 11:05:13 +02:00
parent 3031cc856a
commit 08b62fbf3e
6 changed files with 20 additions and 11 deletions

View file

@ -18,6 +18,7 @@ Item {
property alias entryHeight: menu.entryHeight
property alias maxMenuHeight: menu.maxMenuHeight
property alias placeholderText: searchField.placeholderText
property alias tooltipText : tooltip.text
default property alias _content: menu._content
@ -125,6 +126,10 @@ Item {
onClicked: mouse.accepted=false
onDoubleClicked: mouse.accepted=false
onPressAndHold: mouse.accepted=false
TooltipArea {
id:tooltip
visible: !isOpen && text !== ''
}
}
// ---------------------------------------------------------------------------

View file

@ -1,5 +1,5 @@
import QtQuick 2.7
import QtQuick.Window 2.12
import QtQuick.Window 2.2
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3

View file

@ -117,11 +117,13 @@ Core.ToolTip {
contentItem: Core.Text {
id: text
color: TooltipStyle.color
font.pointSize: TooltipStyle.pointSize
padding: TooltipStyle.padding + TooltipStyle.margins
text: tooltip.text
wrapMode: Core.Text.WordWrap
width:parent.width
elide:Core.Text.ElideRight
}
delay: TooltipStyle.delay

View file

@ -1,5 +1,6 @@
import QtQuick 2.7
import Common 1.0
import Common.Styles 1.0
// =============================================================================
@ -14,7 +15,8 @@ MouseArea {
property bool _visible: false
anchors.fill: parent
anchors.fill:parent
hoverEnabled: true
scrollGestureEnabled: true
@ -31,6 +33,7 @@ MouseArea {
delay: tooltipArea.delay
parent: tooltipParent
visible: _visible || force
width: tooltipParent.width
timeout: -1

View file

@ -1,3 +1,5 @@
import QtQuick 2.7
import Common 1.0
import Linphone 1.0
@ -11,6 +13,7 @@ SearchBox {
// ---------------------------------------------------------------------------
readonly property alias isOpen: searchBox._isOpen
property alias header : view.headerItem
// ---------------------------------------------------------------------------

View file

@ -148,6 +148,7 @@ ApplicationWindow {
maxMenuHeight: MainWindowStyle.searchBox.maxHeight
placeholderText: qsTr('mainSearchBarPlaceholder')
tooltipText: qsTr('smartSearchBarTooltip')
onAddContact: window.setView('ContactEdit', {
sipAddress: sipAddress
@ -175,11 +176,6 @@ ApplicationWindow {
})
onLaunchVideoCall: CallsListModel.launchVideoCall(sipAddress)
TooltipArea {
text: qsTr('smartSearchBarTooltip')
visible: !smartSearchBar.isOpen
}
}
ActionButton {
@ -189,9 +185,9 @@ ApplicationWindow {
onClicked: Logic.openConferenceManager()
TooltipArea {
text: qsTr('newConferenceButton')
}
TooltipArea {
text: qsTr('newConferenceButton')
}
}
ActionButton {