@@ -25,11 +25,12 @@ FocusScope {
27 property bool autohideEnabled: false
27 property bool autohideEnabled: false
28+ property bool lockedVisible: false
28 property bool available: true // can be used to disable all interactions
29 property bool available: true // can be used to disable all interactions
29 property alias inverted: panel.inverted
30 property alias inverted: panel.inverted
30 property bool shadeBackground: true // can be used to disable background shade when launcher is visible
31 property bool shadeBackground: true // can be used to disable background shade when launcher is visible
32− property int panelWidth: units.gu(8)
33+ property int panelWidth: units.gu(10)
33 property int dragAreaWidth: units.gu(1)
34 property int dragAreaWidth: units.gu(1)
34 property int minimizeDistance: units.gu(26)
35 property int minimizeDistance: units.gu(26)
35 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
36 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
@@ -54,6 +55,7 @@ FocusScope {
54 signal showDashHome()
55 signal showDashHome()
56 onStateChanged: {
57 onStateChanged: {
58+ print("state changed", state)
57 if (state == "") {
59 if (state == "") {
58 dismissTimer.stop()
60 dismissTimer.stop()
@@ -92,12 +94,25 @@ FocusScope {
97+ onLockedVisibleChanged: {
98+ if (lockedVisible && state == "") {
99+ print("have to show")
100+ dismissTimer.stop();
101+ fadeOutAnimation.stop();
102+ switchToNextState("visible")
103+ } else if (!lockedVisible && state == "visible") {
95 function hide() {
108 function hide() {
96 switchToNextState("")
109 switchToNextState("")
99 function fadeOut() {
112 function fadeOut() {
113+ if (!root.lockedVisible) {
100− fadeOutAnimation.start();
114+ fadeOutAnimation.start();
103 function switchToNextState(state) {
118 function switchToNextState(state) {
@@ -173,7 +188,7 @@ FocusScope {
173 } else if (panel.highlightIndex >= 0) {
188 } else if (panel.highlightIndex >= 0) {
174 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
189 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
176− root.state = ""
191+ root.hide();
177 event.accepted = true;
192 event.accepted = true;
178 root.focus = false;
193 root.focus = false;
@@ -207,9 +222,9 @@ FocusScope {
207 objectName: "dismissTimer"
222 objectName: "dismissTimer"
208 interval: 500
223 interval: 500
209 onTriggered: {
224 onTriggered: {
210− if (root.autohideEnabled) {
225+ if (root.autohideEnabled && !root.lockedVisible) {
211 if (!panel.preventHiding) {
226 if (!panel.preventHiding) {
212− root.state = ""
227+ root.hide();
214 dismissTimer.restart()
229 dismissTimer.restart()
@@ -227,6 +242,13 @@ FocusScope {
227 interval: 1
242 interval: 1
228 property string nextState: ""
243 property string nextState: ""
229 onTriggered: {
244 onTriggered: {
245+ if (root.lockedVisible && nextState == "") {
246+ // Due to binding updates when switching between modes
247+ // it could happen that our request to show will be overwritten
248+ // with a hide request. Rewrite it when we know hiding is not allowed.
249+ nextState = "visible"
230 // switching to an intermediate state here to make sure all the
252 // switching to an intermediate state here to make sure all the
231 // values are restored, even if we were already in the target state
253 // values are restored, even if we were already in the target state
232 root.state = "tmp"
254 root.state = "tmp"
@@ -262,6 +284,7 @@ FocusScope {
262 script: {
284 script: {
263 panel.layer.enabled = false
285 panel.layer.enabled = false
264 panel.animate = false;
286 panel.animate = false;
287+ print("setting state to \"\"")
265 root.state = "";
288 root.state = "";
266 panel.x = -panel.width
289 panel.x = -panel.width
267 panel.opacity = 1;
290 panel.opacity = 1;
@@ -298,10 +321,10 @@ FocusScope {
298 right: parent.right
321 right: parent.right
299 bottom: parent.bottom
322 bottom: parent.bottom
301− enabled: root.shadeBackground && root.state == "visible"
324+ enabled: root.shadeBackground && root.state == "visible" && !root.lockedVisible
302 visible: enabled // otherwise it will get in the way of cursor selection for some reason
325 visible: enabled // otherwise it will get in the way of cursor selection for some reason
303 onPressed: {
326 onPressed: {
304− root.state = ""
327+ root.hide();
@@ -309,7 +332,7 @@ FocusScope {
309 id: backgroundShade
332 id: backgroundShade
310 anchors.fill: parent
333 anchors.fill: parent
311 color: "black"
334 color: "black"
312− opacity: root.shadeBackground && root.state == "visible" ? 0.6 : 0
335+ opacity: root.shadeBackground && root.state == "visible" && !root.lockedVisible ? 0.6 : 0
314 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }
337 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }
@@ -352,11 +375,11 @@ FocusScope {
352 property bool animate: true
375 property bool animate: true
354 onApplicationSelected: {
377 onApplicationSelected: {
355− root.state = ""
378+ root.hide();
356 launcherApplicationSelected(appId)
379 launcherApplicationSelected(appId)
358 onShowDashHome: {
381 onShowDashHome: {
359− root.state = ""
382+ root.hide();
360 root.showDashHome();
383 root.showDashHome();