Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/WallpaperFader.qml
Show All 32 Lines | 31 | Item { | |||
---|---|---|---|---|---|
33 | property Item clock | 33 | property Item clock | ||
34 | property Item mainStack | 34 | property Item mainStack | ||
35 | property Item footer | 35 | property Item footer | ||
36 | property alias source: wallpaperBlur.source | 36 | property alias source: wallpaperBlur.source | ||
37 | state: lockScreenRoot.uiVisible ? "on" : "off" | 37 | state: lockScreenRoot.uiVisible ? "on" : "off" | ||
38 | property real factor: 0 | 38 | property real factor: 0 | ||
39 | readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5 | 39 | readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5 | ||
40 | 40 | | |||
41 | property bool alwaysShowClock: typeof config === "undefined" || config.alwaysShowClock === true | ||||
42 | | ||||
41 | Behavior on factor { | 43 | Behavior on factor { | ||
42 | NumberAnimation { | 44 | NumberAnimation { | ||
43 | target: wallpaperFader | 45 | target: wallpaperFader | ||
44 | property: "factor" | 46 | property: "factor" | ||
45 | duration: 1000 | 47 | duration: 1000 | ||
46 | easing.type: Easing.InOutQuad | 48 | easing.type: Easing.InOutQuad | ||
47 | } | 49 | } | ||
48 | } | 50 | } | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 106 | State { | |||
114 | PropertyChanges { | 116 | PropertyChanges { | ||
115 | target: wallpaperFader | 117 | target: wallpaperFader | ||
116 | factor: 1 | 118 | factor: 1 | ||
117 | } | 119 | } | ||
118 | PropertyChanges { | 120 | PropertyChanges { | ||
119 | target: clock.shadow | 121 | target: clock.shadow | ||
120 | opacity: 0 | 122 | opacity: 0 | ||
121 | } | 123 | } | ||
124 | PropertyChanges { | ||||
125 | target: clock | ||||
126 | opacity: 1 | ||||
127 | } | ||||
122 | }, | 128 | }, | ||
123 | State { | 129 | State { | ||
124 | name: "off" | 130 | name: "off" | ||
125 | PropertyChanges { | 131 | PropertyChanges { | ||
126 | target: mainStack | 132 | target: mainStack | ||
127 | opacity: 0 | 133 | opacity: 0 | ||
128 | } | 134 | } | ||
129 | PropertyChanges { | 135 | PropertyChanges { | ||
130 | target: footer | 136 | target: footer | ||
131 | opacity: 0 | 137 | opacity: 0 | ||
132 | } | 138 | } | ||
133 | PropertyChanges { | 139 | PropertyChanges { | ||
134 | target: wallpaperFader | 140 | target: wallpaperFader | ||
135 | factor: 0 | 141 | factor: 0 | ||
136 | } | 142 | } | ||
137 | PropertyChanges { | 143 | PropertyChanges { | ||
138 | target: clock.shadow | 144 | target: clock.shadow | ||
139 | opacity: 1 | 145 | opacity: wallpaperFader.alwaysShowClock ? 1 : 0 | ||
146 | } | ||||
147 | PropertyChanges { | ||||
148 | target: clock | ||||
149 | opacity: wallpaperFader.alwaysShowClock ? 1 : 0 | ||||
davidedmundson: Why are we changing this line? | |||||
The clock shadow effectively renders the clock (shader effect with source hidden), so it has to be hidden. broulik: The clock shadow effectively renders the clock (shader effect with source hidden), so it has to… | |||||
140 | } | 150 | } | ||
141 | } | 151 | } | ||
142 | ] | 152 | ] | ||
143 | transitions: [ | 153 | transitions: [ | ||
144 | Transition { | 154 | Transition { | ||
145 | from: "off" | 155 | from: "off" | ||
146 | to: "on" | 156 | to: "on" | ||
147 | //Note: can't use animators as they don't play well with parallelanimations | 157 | //Note: can't use animators as they don't play well with parallelanimations | ||
148 | ParallelAnimation { | | |||
149 | NumberAnimation { | 158 | NumberAnimation { | ||
150 | target: mainStack | 159 | targets: [mainStack, footer, clock] | ||
151 | property: "opacity" | 160 | property: "opacity" | ||
152 | duration: units.longDuration | 161 | duration: units.longDuration | ||
153 | easing.type: Easing.InOutQuad | 162 | easing.type: Easing.InOutQuad | ||
154 | } | 163 | } | ||
155 | NumberAnimation { | | |||
156 | target: footer | | |||
157 | property: "opacity" | | |||
158 | duration: units.longDuration | | |||
159 | easing.type: Easing.InOutQuad | | |||
160 | } | | |||
161 | } | | |||
162 | }, | 164 | }, | ||
163 | Transition { | 165 | Transition { | ||
164 | from: "on" | 166 | from: "on" | ||
165 | to: "off" | 167 | to: "off" | ||
166 | ParallelAnimation { | | |||
167 | NumberAnimation { | 168 | NumberAnimation { | ||
168 | target: mainStack | 169 | targets: [mainStack, footer, clock] | ||
169 | property: "opacity" | 170 | property: "opacity" | ||
170 | duration: 500 | 171 | duration: 500 | ||
171 | easing.type: Easing.InOutQuad | 172 | easing.type: Easing.InOutQuad | ||
172 | } | 173 | } | ||
173 | NumberAnimation { | | |||
174 | target: footer | | |||
175 | property: "opacity" | | |||
176 | duration: 500 | | |||
177 | easing.type: Easing.InOutQuad | | |||
178 | } | | |||
179 | } | | |||
180 | } | 174 | } | ||
181 | ] | 175 | ] | ||
182 | } | 176 | } |
Why are we changing this line?