on xenial help sign in
add hinting to launcher if it changes behind the scenes
73d98aeMichael Zanetti
qml/Launcher/Launcher.qml+25−1
@@ -65,6 +65,14 @@ Item {
65
65
66 function tease() {
66 function tease() {
67 if (available) {
67 if (available) {
68+ teaseTimer.mode = "teasing"
69+ teaseTimer.start();
70+ }
71+ }
72+
73+ function hint() {
74+ if (available && root.state == "") {
75+ teaseTimer.mode = "hinting"
68 teaseTimer.start();
76 teaseTimer.start();
69 }
77 }
70 }
78 }
@@ -72,6 +80,7 @@ Item {
72 Timer {
80 Timer {
73 id: teaseTimer
81 id: teaseTimer
74 interval: 200
82 interval: 200
83+ property string mode: "teasing"
75 }
84 }
76
85
77 Timer {
86 Timer {
@@ -102,6 +111,13 @@ Item {
102 }
111 }
103 }
112 }
104
113
114+ Connections {
115+ target: LauncherModel
116+ onRowsRemoved: hint();
117+ onRowsInserted: hint();
118+ onRowsMoved: hint();
119+ }
120+
105 SequentialAnimation {
121 SequentialAnimation {
106 id: fadeOutAnimation
122 id: fadeOutAnimation
107 ScriptAction {
123 ScriptAction {
@@ -271,11 +287,19 @@ Item {
271 },
287 },
272 State {
288 State {
273 name: "teasing"
289 name: "teasing"
274− when: teaseTimer.running
290+ when: teaseTimer.running && teaseTimer.mode == "teasing"
275 PropertyChanges {
291 PropertyChanges {
276 target: panel
292 target: panel
277 x: -root.panelWidth + units.gu(2)
293 x: -root.panelWidth + units.gu(2)
278 }
294 }
295+ },
296+ State {
297+ name: "hinting"
298+ when: teaseTimer.running && teaseTimer.mode == "hinting"
299+ PropertyChanges {
300+ target: panel
301+ x: 0
302+ }
279 }
303 }
280 ]
304 ]
281}
305}