Merge lp:~dandrader/unity/phablet_fixLauncherTopScroll into lp:unity/phablet

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Michał Sawicz
Approved revision: no longer in the source branch.
Merged at revision: 700
Proposed branch: lp:~dandrader/unity/phablet_fixLauncherTopScroll
Merge into: lp:unity/phablet
Diff against target: 100 lines (+5/-39)
2 files modified
Launcher/Launcher.qml (+1/-18)
Launcher/LauncherShortcuts.qml (+4/-21)
To merge this branch: bzr merge lp:~dandrader/unity/phablet_fixLauncherTopScroll
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Review via email: mp+165896@code.launchpad.net

Commit message

Launcher: Remove fold() unfold() functions as they're interfering with normal behavior

Launcher's "folding icons"/accordeon behavior was disabled a while ago but its
code is still there. After the replacement of DraggingArea with DirectionalDragArea
it began interfering with normal Launcher behavior. Since this code it not needed
anyway, it's simple to remove it than to make it "not interfere with anything"
once again.

Description of the change

Launcher: Remove fold() unfold() functions as they're interfering with normal behavior

Launcher's "folding icons"/accordeon behavior was disabled a while ago but its code is still there. After the replacement of DraggingArea with DirectionalDragArea it began interfering with normal Launcher behavior. Since this code it not needed anyway, it's simple to remove it than to make it "not interfere with anything" once again.

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Launcher/Launcher.qml'
--- Launcher/Launcher.qml 2013-05-23 19:17:21 +0000
+++ Launcher/Launcher.qml 2013-05-27 15:15:33 +0000
@@ -220,10 +220,6 @@
220 function onDragStarted() {220 function onDragStarted() {
221 if (launcher.state == "") launcher.state = "hint"221 if (launcher.state == "") launcher.state = "hint"
222 dismissTimer.stop()222 dismissTimer.stop()
223
224 if (launcher.state == "shortcuts" && !shortcuts.animating) {
225 shortcuts.unfold()
226 }
227 }223 }
228224
229 onDistanceChanged: {225 onDistanceChanged: {
@@ -269,8 +265,6 @@
269265
270 shortcuts.stopScroll()266 shortcuts.stopScroll()
271267
272 //unfoldTimer.stop()
273
274 if (launcher.state == "shortcuts") {268 if (launcher.state == "shortcuts") {
275 dismissTimer.restart()269 dismissTimer.restart()
276 }270 }
@@ -298,16 +292,6 @@
298 }292 }
299 }293 }
300294
301 Timer {
302 id: unfoldTimer
303 interval: 150;
304 running: false;
305 repeat: false
306 onTriggered: {
307 shortcuts.unfold()
308 }
309 }
310
311 states: [295 states: [
312 State {296 State {
313 name: "hint"297 name: "hint"
@@ -365,7 +349,7 @@
365 }349 }
366 ScriptAction {350 ScriptAction {
367 script: {351 script: {
368 shortcuts.fold()352 shortcuts.resetScrollPosition()
369 }353 }
370 }354 }
371 }355 }
@@ -387,7 +371,6 @@
387 if (priv.previousState == "moving") {371 if (priv.previousState == "moving") {
388 priv.shortcutAnimationOngoing = true372 priv.shortcutAnimationOngoing = true
389 }373 }
390 unfoldTimer.start()
391 }374 }
392 }375 }
393 ParallelAnimation {376 ParallelAnimation {
394377
=== modified file 'Launcher/LauncherShortcuts.qml'
--- Launcher/LauncherShortcuts.qml 2013-05-23 19:17:21 +0000
+++ Launcher/LauncherShortcuts.qml 2013-05-27 15:15:33 +0000
@@ -71,6 +71,10 @@
7171
72 Component.onCompleted: init()72 Component.onCompleted: init()
7373
74 function resetScrollPosition() {
75 flickable.contentY = 0
76 }
77
74 function init() {78 function init() {
75 clearModels()79 clearModels()
76 addDashIcon()80 addDashIcon()
@@ -125,27 +129,6 @@
125 }129 }
126 }130 }
127131
128 function unfold() {
129 if (!shortcuts.open) {
130 var addvalue = 0
131 if (shortcuts.currentIndex - shortcuts.openModel.count >= 0) {
132 addvalue = -2 * shortcuts.itemHeight / 3 + shortcuts.fillItemHeight
133 }
134 if (shortcuts.currentIndex - shortcuts.openModel.count > 0) {
135 addvalue += -2 * shortcuts.itemHeight / 3 * (shortcuts.currentIndex - shortcuts.openModel.count)
136 }
137
138 shortcutsContainer.targetY += addvalue
139 shortcuts.open = true
140 }
141 }
142
143 function fold() {
144 flickable.contentY = 0
145 shortcutsContainer.targetY = 0
146 shortcuts.open = false
147 }
148
149 function scroll() {132 function scroll() {
150 if (!scrolling && shortcutsContainer.height > shortcuts.height) {133 if (!scrolling && shortcutsContainer.height > shortcuts.height) {
151 var scrollingAtStart = shortcutsContainer.targetY == 0134 var scrollingAtStart = shortcutsContainer.targetY == 0

Subscribers

People subscribed via source and target branches