Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/image/imagepackage/contents/ui/main.qml
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Line(s) | 171 | SequentialAnimation { | |||
---|---|---|---|---|---|
172 | id: fadeAnim | 172 | id: fadeAnim | ||
173 | running: false | 173 | running: false | ||
174 | 174 | | |||
175 | ParallelAnimation { | 175 | ParallelAnimation { | ||
176 | OpacityAnimator { | 176 | OpacityAnimator { | ||
177 | target: currentImage | 177 | target: currentImage | ||
178 | from: 0 | 178 | from: 0 | ||
179 | to: 1 | 179 | to: 1 | ||
180 | duration: units.longDuration | 180 | duration: fadeOtherAnimator.duration | ||
181 | } | 181 | } | ||
182 | OpacityAnimator { | 182 | OpacityAnimator { | ||
183 | id: fadeOtherAnimator | 183 | id: fadeOtherAnimator | ||
184 | property bool enabled: true | 184 | property bool enabled: true | ||
185 | target: otherImage | 185 | target: otherImage | ||
186 | from: 1 | 186 | from: 1 | ||
187 | // cannot disable an animation individually, so we just fade from 1 to 1 | 187 | // cannot disable an animation individually, so we just fade from 1 to 1 | ||
188 | to: enabled ? 0 : 1 | 188 | to: enabled ? 0 : 1 | ||
189 | duration: units.longDuration | 189 | | ||
190 | //use configured duration if animations are enabled | ||||
191 | duration: units.longDuration && wallpaper.configuration.TransitionAnimationDuration | ||||
broulik: This works in JS but I'd prefer it to be more explicit
```
units.longDuration > 0 ? wallpaper. | |||||
190 | } | 192 | } | ||
191 | } | 193 | } | ||
192 | ScriptAction { | 194 | ScriptAction { | ||
193 | script: { | 195 | script: { | ||
194 | otherImage.fillMode = fillMode; | 196 | otherImage.fillMode = fillMode; | ||
195 | otherImage.source = ""; | 197 | otherImage.source = ""; | ||
196 | } | 198 | } | ||
197 | } | 199 | } | ||
Show All 29 Lines |
This works in JS but I'd prefer it to be more explicit
(says the one who prefers foo || bar over foo ? foo : bar :D)