mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-30 02:09:18 +00:00
feat(ui/modules/Common/InvertedMouseArea): remove the limit instances of InvertedMouseArea
This commit is contained in:
parent
6460fc8303
commit
ffedd50e53
2 changed files with 7 additions and 16 deletions
|
|
@ -21,16 +21,6 @@ Item {
|
|||
|
||||
function _createMouseArea () {
|
||||
var parent = Utils.getTopParent(item, true)
|
||||
var mouseArea = Utils.find(parent.children, function (element) {
|
||||
return Utils.qmlTypeof(element, 'QQuickMouseArea')
|
||||
})
|
||||
|
||||
Utils.assert(
|
||||
_mouseArea === mouseArea,
|
||||
'It already exists a different `MouseArea` at window root. (' +
|
||||
'`local mouse area`=' + _mouseArea + ', `root mouse area`=' +
|
||||
mouseArea + ')'
|
||||
)
|
||||
|
||||
if (_mouseArea == null) {
|
||||
_mouseArea = builder.createObject()
|
||||
|
|
|
|||
|
|
@ -18,13 +18,14 @@ Item {
|
|||
// -----------------------------------------------------------------
|
||||
|
||||
function _handleHoveredLink (hoveredLink) {
|
||||
var root = Utils.getTopParent(container)
|
||||
var children = root.children
|
||||
|
||||
// Can be the `invertedMouseArea` of other message.
|
||||
var mouseArea = Utils.find(children, function (element) {
|
||||
return Utils.qmlTypeof(element, 'QQuickMouseArea')
|
||||
})
|
||||
// Or another mouse area. Dangerous?
|
||||
var mouseArea = Utils.find(
|
||||
Utils.getTopParent(container).children,
|
||||
function (element) {
|
||||
return Utils.qmlTypeof(element, 'QQuickMouseArea')
|
||||
}
|
||||
)
|
||||
|
||||
if (mouseArea != null) {
|
||||
mouseArea.cursorShape = hoveredLink
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue