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
1=== modified file 'Launcher/Launcher.qml'
2--- Launcher/Launcher.qml 2013-05-23 19:17:21 +0000
3+++ Launcher/Launcher.qml 2013-05-27 15:15:33 +0000
4@@ -220,10 +220,6 @@
5 function onDragStarted() {
6 if (launcher.state == "") launcher.state = "hint"
7 dismissTimer.stop()
8-
9- if (launcher.state == "shortcuts" && !shortcuts.animating) {
10- shortcuts.unfold()
11- }
12 }
13
14 onDistanceChanged: {
15@@ -269,8 +265,6 @@
16
17 shortcuts.stopScroll()
18
19- //unfoldTimer.stop()
20-
21 if (launcher.state == "shortcuts") {
22 dismissTimer.restart()
23 }
24@@ -298,16 +292,6 @@
25 }
26 }
27
28- Timer {
29- id: unfoldTimer
30- interval: 150;
31- running: false;
32- repeat: false
33- onTriggered: {
34- shortcuts.unfold()
35- }
36- }
37-
38 states: [
39 State {
40 name: "hint"
41@@ -365,7 +349,7 @@
42 }
43 ScriptAction {
44 script: {
45- shortcuts.fold()
46+ shortcuts.resetScrollPosition()
47 }
48 }
49 }
50@@ -387,7 +371,6 @@
51 if (priv.previousState == "moving") {
52 priv.shortcutAnimationOngoing = true
53 }
54- unfoldTimer.start()
55 }
56 }
57 ParallelAnimation {
58
59=== modified file 'Launcher/LauncherShortcuts.qml'
60--- Launcher/LauncherShortcuts.qml 2013-05-23 19:17:21 +0000
61+++ Launcher/LauncherShortcuts.qml 2013-05-27 15:15:33 +0000
62@@ -71,6 +71,10 @@
63
64 Component.onCompleted: init()
65
66+ function resetScrollPosition() {
67+ flickable.contentY = 0
68+ }
69+
70 function init() {
71 clearModels()
72 addDashIcon()
73@@ -125,27 +129,6 @@
74 }
75 }
76
77- function unfold() {
78- if (!shortcuts.open) {
79- var addvalue = 0
80- if (shortcuts.currentIndex - shortcuts.openModel.count >= 0) {
81- addvalue = -2 * shortcuts.itemHeight / 3 + shortcuts.fillItemHeight
82- }
83- if (shortcuts.currentIndex - shortcuts.openModel.count > 0) {
84- addvalue += -2 * shortcuts.itemHeight / 3 * (shortcuts.currentIndex - shortcuts.openModel.count)
85- }
86-
87- shortcutsContainer.targetY += addvalue
88- shortcuts.open = true
89- }
90- }
91-
92- function fold() {
93- flickable.contentY = 0
94- shortcutsContainer.targetY = 0
95- shortcuts.open = false
96- }
97-
98 function scroll() {
99 if (!scrolling && shortcutsContainer.height > shortcuts.height) {
100 var scrollingAtStart = shortcutsContainer.targetY == 0

Subscribers

People subscribed via source and target branches