Changeset View
Changeset View
Standalone View
Standalone View
effects/slidingpopups/slidingpopups.cpp
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | 133 | if (start != 0) { | |||
---|---|---|---|---|---|
142 | } | 142 | } | ||
143 | 143 | | |||
144 | switch(mWindowsData[ w ].from) { | 144 | switch(mWindowsData[ w ].from) { | ||
145 | case West: { | 145 | case West: { | ||
146 | const double splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - start) + qMin(geo.width(), slideLength) * (appearing ? 1.0 - progress : progress); | 146 | const double splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - start) + qMin(geo.width(), slideLength) * (appearing ? 1.0 - progress : progress); | ||
147 | data.quads = data.quads.splitAtX(splitPoint); | 147 | data.quads = data.quads.splitAtX(splitPoint); | ||
148 | WindowQuadList filtered; | 148 | WindowQuadList filtered; | ||
149 | filtered.reserve(data.quads.count()); | 149 | filtered.reserve(data.quads.count()); | ||
150 | foreach (const WindowQuad &quad, data.quads) { | 150 | for (const WindowQuad &quad : qAsConst(data.quads)) { | ||
151 | if (quad.left() >= splitPoint) { | 151 | if (quad.left() >= splitPoint) { | ||
152 | filtered << quad; | 152 | filtered << quad; | ||
153 | } | 153 | } | ||
154 | } | 154 | } | ||
155 | data.quads = filtered; | 155 | data.quads = filtered; | ||
156 | break; | 156 | break; | ||
157 | } | 157 | } | ||
158 | case North: { | 158 | case North: { | ||
159 | const double splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - start) + qMin(geo.height(), slideLength) * (appearing ? 1.0 - progress : progress); | 159 | const double splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - start) + qMin(geo.height(), slideLength) * (appearing ? 1.0 - progress : progress); | ||
160 | data.quads = data.quads.splitAtY(splitPoint); | 160 | data.quads = data.quads.splitAtY(splitPoint); | ||
161 | WindowQuadList filtered; | 161 | WindowQuadList filtered; | ||
162 | filtered.reserve(data.quads.count()); | 162 | filtered.reserve(data.quads.count()); | ||
163 | foreach (const WindowQuad &quad, data.quads) { | 163 | for (const WindowQuad &quad : qAsConst(data.quads)) { | ||
164 | if (quad.top() >= splitPoint) { | 164 | if (quad.top() >= splitPoint) { | ||
165 | filtered << quad; | 165 | filtered << quad; | ||
166 | } | 166 | } | ||
167 | } | 167 | } | ||
168 | data.quads = filtered; | 168 | data.quads = filtered; | ||
169 | break; | 169 | break; | ||
170 | } | 170 | } | ||
171 | case East: { | 171 | case East: { | ||
172 | const double splitPoint = screenRect.x() + screenRect.width() - geo.x() - start - qMin(geo.width(), slideLength) * (appearing ? 1.0 - progress : progress); | 172 | const double splitPoint = screenRect.x() + screenRect.width() - geo.x() - start - qMin(geo.width(), slideLength) * (appearing ? 1.0 - progress : progress); | ||
173 | data.quads = data.quads.splitAtX(splitPoint); | 173 | data.quads = data.quads.splitAtX(splitPoint); | ||
174 | WindowQuadList filtered; | 174 | WindowQuadList filtered; | ||
175 | filtered.reserve(data.quads.count()); | 175 | filtered.reserve(data.quads.count()); | ||
176 | foreach (const WindowQuad &quad, data.quads) { | 176 | for (const WindowQuad &quad : qAsConst(data.quads)) { | ||
177 | if (quad.right() <= splitPoint) { | 177 | if (quad.right() <= splitPoint) { | ||
178 | filtered << quad; | 178 | filtered << quad; | ||
179 | } | 179 | } | ||
180 | } | 180 | } | ||
181 | data.quads = filtered; | 181 | data.quads = filtered; | ||
182 | break; | 182 | break; | ||
183 | } | 183 | } | ||
184 | case South: | 184 | case South: | ||
185 | default: { | 185 | default: { | ||
186 | const double splitPoint = screenRect.y() + screenRect.height() - geo.y() - start - qMin(geo.height(), slideLength) * (appearing ? 1.0 - progress : progress); | 186 | const double splitPoint = screenRect.y() + screenRect.height() - geo.y() - start - qMin(geo.height(), slideLength) * (appearing ? 1.0 - progress : progress); | ||
187 | data.quads = data.quads.splitAtY(splitPoint); | 187 | data.quads = data.quads.splitAtY(splitPoint); | ||
188 | WindowQuadList filtered; | 188 | WindowQuadList filtered; | ||
189 | filtered.reserve(data.quads.count()); | 189 | filtered.reserve(data.quads.count()); | ||
190 | foreach (const WindowQuad &quad, data.quads) { | 190 | for (const WindowQuad &quad : qAsConst(data.quads)) { | ||
191 | if (quad.bottom() <= splitPoint) { | 191 | if (quad.bottom() <= splitPoint) { | ||
192 | filtered << quad; | 192 | filtered << quad; | ||
193 | } | 193 | } | ||
194 | } | 194 | } | ||
195 | data.quads = filtered; | 195 | data.quads = filtered; | ||
196 | break; | 196 | break; | ||
197 | } | 197 | } | ||
198 | } | 198 | } | ||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |