on xenial help sign in
Addressed a large chunk of suggestions from MP-comments.
04f0096Mirco Müller
qml/Launcher/LauncherDelegate.qml+28−40
@@ -41,25 +41,13 @@ Item {
41 property real offset: 0
41 property real offset: 0
42 property real itemOpacity: 1
42 property real itemOpacity: 1
43 property real brightness: 0
43 property real brightness: 0
44− property real wiggleAngle: 0
44+ property double maxWiggleAngle: 5.0
45−
46− signal alertingTriggered(int alertIndex)
47− signal alertingEnded(int alertIndex)
48−
49− onAlertingChanged: {
50− if (alerting) {
51− alertingTriggered(index)
52− } else {
53− alertingEnded(index)
54− }
55− }
56
45
57 QtObject {
46 QtObject {
58− id: privWiggleAnim
47+ id: priv
59
48
60− readonly property double angle: 5.0
61− readonly property int duration: UbuntuAnimation.SnapDuration
49+ readonly property int wiggleDuration: UbuntuAnimation.SnapDuration
62− readonly property var target: root
50+ property real wiggleAngle: 0
63 }
51 }
64
52
65 SequentialAnimation {
53 SequentialAnimation {
@@ -70,61 +58,61 @@ Item {
70 alwaysRunToEnd: true
58 alwaysRunToEnd: true
71
59
72 NumberAnimation {
60 NumberAnimation {
73− target: privWiggleAnim.target
61+ target: priv
74 property: "wiggleAngle"
62 property: "wiggleAngle"
75 from: 0
63 from: 0
76− to: privWiggleAnim.angle
64+ to: maxWiggleAngle
77− duration: privWiggleAnim.duration
65+ duration: priv.wiggleDuration
78 easing.type: Easing.InQuad
66 easing.type: Easing.InQuad
79 }
67 }
80
68
81 NumberAnimation {
69 NumberAnimation {
82− target: privWiggleAnim.target
70+ target: priv
83 property: "wiggleAngle"
71 property: "wiggleAngle"
84− from: privWiggleAnim.angle
72+ from: maxWiggleAngle
85− to: -privWiggleAnim.angle
73+ to: -maxWiggleAngle
86− duration: privWiggleAnim.duration
74+ duration: priv.wiggleDuration
87 easing.type: Easing.InOutQuad
75 easing.type: Easing.InOutQuad
88 }
76 }
89
77
90 NumberAnimation {
78 NumberAnimation {
91− target: privWiggleAnim.target
79+ target: priv
92 property: "wiggleAngle"
80 property: "wiggleAngle"
93− from: -privWiggleAnim.angle
81+ from: -maxWiggleAngle
94− to: privWiggleAnim.angle
82+ to: maxWiggleAngle
95− duration: privWiggleAnim.duration
83+ duration: priv.wiggleDuration
96 easing.type: Easing.InOutQuad
84 easing.type: Easing.InOutQuad
97 }
85 }
98
86
99 NumberAnimation {
87 NumberAnimation {
100− target: privWiggleAnim.target
88+ target: priv
101 property: "wiggleAngle"
89 property: "wiggleAngle"
102− from: privWiggleAnim.angle
90+ from: maxWiggleAngle
103− to: -privWiggleAnim.angle
91+ to: -maxWiggleAngle
104− duration: privWiggleAnim.duration
92+ duration: priv.wiggleDuration
105 easing.type: Easing.InOutQuad
93 easing.type: Easing.InOutQuad
106 }
94 }
107
95
108 NumberAnimation {
96 NumberAnimation {
109− target: privWiggleAnim.target
97+ target: priv
110 property: "wiggleAngle"
98 property: "wiggleAngle"
111− from: -privWiggleAnim.angle
99+ from: -maxWiggleAngle
112− to: privWiggleAnim.angle
100+ to: maxWiggleAngle
113− duration: privWiggleAnim.duration
101+ duration: priv.wiggleDuration
114 easing.type: Easing.InOutQuad
102 easing.type: Easing.InOutQuad
115 }
103 }
116
104
117 NumberAnimation {
105 NumberAnimation {
118− target: privWiggleAnim.target
106+ target: priv
119 property: "wiggleAngle"
107 property: "wiggleAngle"
120− from: privWiggleAnim.angle
108+ from: maxWiggleAngle
121 to: 0
109 to: 0
122− duration: privWiggleAnim.duration
110+ duration: priv.wiggleDuration
123 easing.type: Easing.OutQuad
111 easing.type: Easing.OutQuad
124 }
112 }
125
113
126 UbuntuNumberAnimation {
114 UbuntuNumberAnimation {
127− target: privWiggleAnim.target
115+ target: root
128 property: "alerting"
116 property: "alerting"
129 to: 0
117 to: 0
130 }
118 }
@@ -263,7 +251,7 @@ Item {
263 Rotation {
251 Rotation {
264 axis { x: 0; y: 0; z: 1 }
252 axis { x: 0; y: 0; z: 1 }
265 origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
253 origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
266− angle: root.wiggleAngle
254+ angle: priv.wiggleAngle
267 },
255 },
268 // Rotating 3 times at top/bottom because that increases the perspective.
256 // Rotating 3 times at top/bottom because that increases the perspective.
269 // This is a hack, but as QML does not support real 3D coordinates
257 // This is a hack, but as QML does not support real 3D coordinates
qml/Launcher/LauncherPanel.qml+27−26
@@ -119,11 +119,11 @@ Rectangle {
119 // need to be smaller than this size to avoid breakage.
119 // need to be smaller than this size to avoid breakage.
120 property int extensionSize: 0
120 property int extensionSize: 0
121
121
122− QtObject {
122+ // These properties are needed to facilitate implicitly unfolding the
123− id: priv
123+ // launcher to the peeking icon, if it is not already fully flat
124+ // and in view for the user
124− property real moveToIndexYFrom
125+ property real moveToIndexYFrom
125− property real moveToIndexYTo
126+ property real moveToIndexYTo
126− }
127
127
128 // Setting extensionSize after the list has been populated because it has
128 // Setting extensionSize after the list has been populated because it has
129 // the potential to mess up with the intial positioning in combination
129 // the potential to mess up with the intial positioning in combination
@@ -142,8 +142,8 @@ Rectangle {
142 id: moveToIndexAnimation
142 id: moveToIndexAnimation
143 target: launcherListView
143 target: launcherListView
144 property: "contentY"
144 property: "contentY"
145− from: priv.moveToIndexYFrom
145+ from: launcherListView.moveToIndexYFrom
146− to: priv.moveToIndexYTo
146+ to: launcherListView.moveToIndexYTo
147 }
147 }
148
148
149 // The height of the area where icons start getting folded
149 // The height of the area where icons start getting folded
@@ -202,25 +202,25 @@ Rectangle {
202 z: -Math.abs(offset)
202 z: -Math.abs(offset)
203 maxAngle: 55
203 maxAngle: 55
204 property bool dragging: false
204 property bool dragging: false
205− property var peekingItem: launcherListView.peekingIndex === index ? launcherDelegate : undefined
205+ //property var peekingItem: launcherListView.peekingIndex === index ? launcherDelegate : undefined
206−
206+ property bool peeking: launcherListView.peekingIndex === index
207−
207+
208− onAlertingTriggered: {
208+ onAlertingChanged: {
209+ if(alerting) {
209− if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
210+ if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
210− priv.moveToIndexYFrom = launcherListView.contentY
211+ launcherListView.moveToIndexYFrom = launcherListView.contentY
211− launcherListView.positionViewAtIndex(alertIndex, ListView.Center)
212+ launcherListView.positionViewAtIndex(index, ListView.Center)
212− priv.moveToIndexYTo = launcherListView.contentY
213+ launcherListView.moveToIndexYTo = launcherListView.contentY
213− moveToIndexAnimation.start()
214+ moveToIndexAnimation.start()
214− }
215−
216− if (launcherListView.peekingIndex === -1) {
217− launcherListView.peekingIndex = alertIndex
218− }
219− }
215+ }
220
216
221− onAlertingEnded: {
217+ if (launcherListView.peekingIndex === -1) {
218+ launcherListView.peekingIndex = index
219+ }
220+ } else {
222− if (launcherListView.peekingIndex === alertIndex) {
221+ if (launcherListView.peekingIndex === index) {
223− launcherListView.peekingIndex = -1
222+ launcherListView.peekingIndex = -1
223+ }
224 }
224 }
225 }
225 }
226
226
@@ -236,7 +236,8 @@ Rectangle {
236 states: [
236 states: [
237 State {
237 State {
238 name: "peeking"
238 name: "peeking"
239− when: peekingItem === launcherDelegate && !dragging && launcher.state !== "visible"
239+ //when: peekingItem === launcherDelegate && !dragging && launcher.state !== "visible"
240+ when: peeking && !dragging && launcher.state !== "visible"
240 PropertyChanges {
241 PropertyChanges {
241 target: launcherDelegate
242 target: launcherDelegate
242 x: (units.gu(.5) + launcherListView.width * .5) * (root.inverted ? -1 : 1)
243 x: (units.gu(.5) + launcherListView.width * .5) * (root.inverted ? -1 : 1)