on xenial help sign in
enable revealing the launcher by hitting the left edge using the mouse
commit72a43b8e4412a290e3adbfeaef7903de00e2122a authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 6 Feb 2015, 14:54 (12 years ago) parent958eebf
1 file changed+32−2
qml/Launcher/Launcher.qml+32−2
qml/Launcher/Launcher.qml+32−2
@@ -88,10 +88,10 @@ Item {
8888 Timer {
8989 id: dismissTimer
9090 objectName: "dismissTimer"
91− interval: 5000
91+ interval: 500
9292 onTriggered: {
9393 if (root.autohideEnabled) {
94− if (!panel.preventHiding) {
94+ if (!panel.preventHiding && !hoverArea.containsMouse) {
9595 root.state = ""
9696 } else {
9797 dismissTimer.restart()
@@ -240,6 +240,27 @@ Item {
240240 }
241241 }
242242
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+
243264 EdgeDragArea {
244265 id: dragArea
245266 objectName: "launcherDragArea"
@@ -295,6 +316,15 @@ Item {
295316 x: 0
296317 }
297318 },
319+ State {
320+ name: "visibleTemporary"
321+ extend: "visible"
322+ when: howerArea.containsMouse
323+ PropertyChanges {
324+ target: root
325+ autohideEnabled: true
326+ }
327+ },
298328 State {
299329 name: "teasing"
300330 when: teaseTimer.running && teaseTimer.mode == "teasing"