21
21
import "../utils.js" as Utils
23
// Shows the target when it has the focus or when you move the
24
// mouse for 500 msec to the edge of the target or there are no
25
// windows that intersect with the target
23
// Shows the target when it has the focus or when you trigger the pointer barrier
24
// or there are no windows that intersect with the target
26
25
// Hides the target when none of the above conditions are met
27
26
// and you have not had the mouse over it during more than 1000 msec
28
// To use this Behavior your target needs to provide two properties
27
// To use this Behavior your target needs to provide one properties
29
28
// - containsMouse: Defines if the mouse is inside the target
30
// - outerEdgeContainsMouse: Defines if the mouse is in the edge of the target
30
// - barrierTriggered: Defines when the pointer barrier has been triggered
35
property bool shownBecauseOfMousePosition: false
37
shown: target !== undefined && (target.activeFocus || shownBecauseOfMousePosition || !windows.intersects)
39
onForcedVisibleChanged:
42
if (!target.containsMouse && forcedVisibleChangeId != "dash") {
43
shownBecauseOfMousePosition = true
44
mouseLeaveTimer.restart()
52
onTriggered: shownBecauseOfMousePosition = true
58
onTriggered: shownBecauseOfMousePosition = false
62
target: (intellihide.target !== undefined) ? intellihide.target : null
63
onOuterEdgeContainsMouseChanged: edgeHitTimer.running = target.outerEdgeContainsMouse
64
ignoreUnknownSignals: true
68
target: (intellihide.target !== undefined) ? intellihide.target : null
69
onContainsMouseChanged: {
70
if ((shown || forcedVisible) && target.containsMouse) {
71
shownBecauseOfMousePosition = true
73
mouseLeaveTimer.running = !target.containsMouse
75
ignoreUnknownSignals: true
35
property bool intelliHideShown: autoHideShown || (target !== undefined && !windows.intersects)
37
shown: intelliHideShown
78
39
WindowsIntersectMonitor {
81
42
if (intellihide.target) {
82
43
if (Utils.isLeftToRight()) {
44
return Qt.rect(declarativeView.screen.geometry.x,
84
45
intellihide.target.y,
85
46
intellihide.target.width,
86
47
intellihide.target.height)
88
return Qt.rect(declarativeView.screen.availableGeometry.width - intellihide.target.width,
49
return Qt.rect(declarativeView.screen.geometry.x + declarativeView.screen.availableGeometry.width - intellihide.target.width,
89
50
intellihide.target.y,
90
51
intellihide.target.width,
91
52
intellihide.target.height)