on xenial help sign in
enable revealing the launcher by hitting the left edge using the mouse
72a43b8Michael Zanetti
qml/Launcher/Launcher.qml+32−2
@@ -88,10 +88,10 @@ Item {
88 Timer {
88 Timer {
89 id: dismissTimer
89 id: dismissTimer
90 objectName: "dismissTimer"
90 objectName: "dismissTimer"
91− interval: 5000
91+ interval: 500
92 onTriggered: {
92 onTriggered: {
93 if (root.autohideEnabled) {
93 if (root.autohideEnabled) {
94− if (!panel.preventHiding) {
94+ if (!panel.preventHiding && !hoverArea.containsMouse) {
95 root.state = ""
95 root.state = ""
96 } else {
96 } else {
97 dismissTimer.restart()
97 dismissTimer.restart()
@@ -240,6 +240,27 @@ Item {
240 }
240 }
241 }
241 }
242
242
243+ // TODO: This should be replaced by some mechanism that reveals the launcher
244+ // after a certain resistance has been overcome, like unity8 does. However,
245+ // as we don't get relative mouse coordinates yet, this will do for now.
246+ MouseArea {
247+ id: hoverArea
248+ anchors { fill: panel; rightMargin: -1 }
249+ hoverEnabled: true
250+ onContainsMouseChanged: {
251+ if (containsMouse) {
252+ root.switchToNextState("visibleTemporary")
253+ }
254+ }
255+
256+ // We need to eat touch events here in order to make sure that
257+ // we don't trigger both, the dragArea and the hoverArea
258+ MultiPointTouchArea {
259+ anchors.fill: parent
260+ mouseEnabled: false
261+ }
262+ }
263+
243 EdgeDragArea {
264 EdgeDragArea {
244 id: dragArea
265 id: dragArea
245 objectName: "launcherDragArea"
266 objectName: "launcherDragArea"
@@ -295,6 +316,15 @@ Item {
295 x: 0
316 x: 0
296 }
317 }
297 },
318 },
319+ State {
320+ name: "visibleTemporary"
321+ extend: "visible"
322+ when: howerArea.containsMouse
323+ PropertyChanges {
324+ target: root
325+ autohideEnabled: true
326+ }
327+ },
298 State {
328 State {
299 name: "teasing"
329 name: "teasing"
300 when: teaseTimer.running && teaseTimer.mode == "teasing"
330 when: teaseTimer.running && teaseTimer.mode == "teasing"