on xenial help sign in
Make the wiggle-rotation happen center-aligned with the icon... even if in folded state.
commitc2934658a5ad240821d37c64f1dd4562d468af01 authorMirco Müller <mirco.mueller@ubuntu.com> dateWed 17 Jun 2015, 16:18 (11 years ago) parentc93a6f7
1 file changed+15−6
qml/Launcher/LauncherDelegate.qml+15−6
qml/Launcher/LauncherDelegate.qml+15−6
@@ -42,6 +42,7 @@ Item {
4242 property real offset: 0
4343 property real itemOpacity: 1
4444 property real brightness: 0
45+ property real wiggleAngle: 0
4546
4647 Connections {
4748 target: mainColumn.parent
@@ -103,7 +104,7 @@ Item {
103104
104105 NumberAnimation {
105106 target: privWiggleAnim.target
106− property: "rotation"
107+ property: "wiggleAngle"
107108 from: 0
108109 to: privWiggleAnim.angle
109110 duration: privWiggleAnim.duration
@@ -112,7 +113,7 @@ Item {
112113
113114 NumberAnimation {
114115 target: privWiggleAnim.target
115− property: "rotation"
116+ property: "wiggleAngle"
116117 from: privWiggleAnim.angle
117118 to: -privWiggleAnim.angle
118119 duration: privWiggleAnim.duration
@@ -121,7 +122,7 @@ Item {
121122
122123 NumberAnimation {
123124 target: privWiggleAnim.target
124− property: "rotation"
125+ property: "wiggleAngle"
125126 from: -privWiggleAnim.angle
126127 to: privWiggleAnim.angle
127128 duration: privWiggleAnim.duration
@@ -130,7 +131,7 @@ Item {
130131
131132 NumberAnimation {
132133 target: privWiggleAnim.target
133− property: "rotation"
134+ property: "wiggleAngle"
134135 from: -privWiggleAnim.angle
135136 to: privWiggleAnim.angle
136137 duration: privWiggleAnim.duration
@@ -139,7 +140,7 @@ Item {
139140
140141 NumberAnimation {
141142 target: privWiggleAnim.target
142− property: "rotation"
143+ property: "wiggleAngle"
143144 from: privWiggleAnim.angle
144145 to: -privWiggleAnim.angle
145146 duration: privWiggleAnim.duration
@@ -148,7 +149,7 @@ Item {
148149
149150 NumberAnimation {
150151 target: privWiggleAnim.target
151− property: "rotation"
152+ property: "wiggleAngle"
152153 from: -privWiggleAnim.angle
153154 to: 0
154155 duration: privWiggleAnim.duration
@@ -287,6 +288,14 @@ Item {
287288 }
288289
289290 transform: [
291+ // The rotation about the icon's center/z-axis for the wiggle
292+ // needs to happen here too, because there's no other way to
293+ // align the wiggle with the icon-folding otherwise
294+ Rotation {
295+ axis { x: 0; y: 0; z: 1 }
296+ origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
297+ angle: root.wiggleAngle
298+ },
290299 // Rotating 3 times at top/bottom because that increases the perspective.
291300 // This is a hack, but as QML does not support real 3D coordinates
292301 // getting a higher perspective can only be done by a hack. This is the most