@@ -23,6 +23,7 @@ import Unity.Launcher 0.1
26+ property bool autohideEnabled: false
26 property bool available: true // can be used to disable all interactions
27 property bool available: true // can be used to disable all interactions
28 property int panelWidth: units.gu(8)
29 property int panelWidth: units.gu(8)
@@ -42,14 +43,13 @@ Item {
42 // emitted when the dash icon in the launcher has been tapped
43 // emitted when the dash icon in the launcher has been tapped
43 signal showDashHome()
44 signal showDashHome()
45−// FIXME Similar code will be needed on desktop autohide (see dismissTimer and other code commented out)
46−// onStateChanged: {
46+ onStateChanged: {
47−// if (state == "") {
47+ if (state == "") {
48−// dismissTimer.stop()
48+ dismissTimer.stop()
49−// } else {
49+ } else {
50−// dismissTimer.restart()
50+ dismissTimer.restart()
54 function hide() {
54 function hide() {
55 switchToNextState("")
55 switchToNextState("")
@@ -84,18 +84,20 @@ Item {
84 property string mode: "teasing"
84 property string mode: "teasing"
88−// id: dismissTimer
88+ id: dismissTimer
89−// objectName: "dismissTimer"
89+ objectName: "dismissTimer"
90−// interval: 5000
90+ interval: 5000
91−// onTriggered: {
91+ onTriggered: {
92+ if (root.autohideEnabled) {
92−// if (!panel.preventHiding) {
93+ if (!panel.preventHiding) {
93−// root.state = ""
94+ root.state = ""
94−// } else {
95+ } else {
95−// dismissTimer.restart()
96+ dismissTimer.restart()
100 // Because the animation on x is disabled while dragging
102 // Because the animation on x is disabled while dragging
101 // switching state directly in the drag handlers would not animate
103 // switching state directly in the drag handlers would not animate
@@ -211,11 +213,11 @@ Item {
211 root.showDashHome();
213 root.showDashHome();
214−// onPreventHidingChanged: {
216+ onPreventHidingChanged: {
215−// if (dismissTimer.running) {
217+ if (dismissTimer.running) {
216−// dismissTimer.restart();
218+ dismissTimer.restart();
220 Behavior on x {
222 Behavior on x {
221 enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;
223 enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;