linphone-desktop/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml
Julien Wadel 44b7c112b3 Multi fixes:
- Contact update propagated through timelines and more robust display name showing by using cpp.
- ContactEdit : don't use the conference URI when adding the contact to friend on secure chat room
- Conference View : Resize record, add record file notification.
- Group Chat : timed invitation (30s) where it will hide if no response. It will be shown if the participant accept later.
- Hide/Show empty chats : set defaults to avoid differences from SDK value.
- Calls actions : Dynamic width on transfer menu to show all text, set texts to uppercase.
- Timeline : Add a tooltip (right-clic) to show the last time update.
- File Messages : add search shortcut on avatar like messages, remove conflicts between right-clic menu and thumbnails increase (on hovering mouse).
- Call : hold view with a correct symbol (#10073 instead of 2 differents symbols for 2 vertical bars)
- Languages : remove '-----' artifacts in language files
2021-10-20 17:12:11 +02:00

82 lines
1.6 KiB
QML

import QtQuick 2.7
import Common 1.0
import Common.Styles 1.0
// =============================================================================
MouseArea {
id: tooltipArea
property alias text: tooltip.text
property int delay: TooltipStyle.delay
property bool force: false
property var tooltipParent: parent
property int maxWidth : tooltipParent.width
property bool _visible: false
property int hoveringCursor : Qt.PointingHandCursor
property bool isClickable : false
function show(){
if(isClickable){
if(tooltip.delay>0) {
tooltip.oldDelay = tooltip.delay
tooltip.delay = 0
}
tooltip.show(text, -1);
}
}
anchors.fill:parent
hoverEnabled: true
scrollGestureEnabled: true
onContainsMouseChanged: _visible = containsMouse
cursorShape: containsMouse ? hoveringCursor : Qt.ArrowCursor
onPressed: {
mouse.accepted = isClickable
}
onWheel: {
_visible = false
wheel.accepted = false
}
onClicked:{
show()
mouse.accepted = false
}
Tooltip {
id: tooltip
property int oldDelay : 0
delay: tooltipArea.delay
parent: tooltipParent
visible: _visible || force
width: Math.min(tooltip.implicitWidth, Math.max(tooltipArea.maxWidth, TooltipStyle.minWidth))
//tooltipParent.width>TooltipStyle.minWidth?tooltipParent.width:TooltipStyle.minWidth
timeout: -1
// Workaround to always display tooltip.
onVisibleChanged: {
if (!visible && force) {
tooltip.visible = true
}
}
MouseArea{
anchors.fill:parent
visible: tooltipArea.isClickable
onClicked : {
tooltip.hide()
tooltip.delay = tooltip.oldDelay
mouse.accepted = false
}
}
}
}