Commit ffedd50e authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Common/InvertedMouseArea): remove the limit instances of `InvertedMouseArea`

parent 6460fc83
......@@ -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
......
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