MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / slideOut

Method slideOut

3rdparty/WAF/Animation/SideSlide/SideSlideAnimator.cpp:198–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void SideSlideAnimator::slideOut()
199{
200 //
201 // Прерываем выполнение, если клиент хочет повторить его
202 //
203 if (isAnimated() && isAnimatedBackward()) return;
204 setAnimatedBackward();
205
206 m_decorator->grabSlideWidget(widgetForSlide());
207
208 if (widgetForSlide()->isVisible()) {
209 //
210 // Определим самый верхний виджет
211 //
212 QWidget* topWidget = widgetForSlide()->parentWidget();
213 while (topWidget->parentWidget() != 0 && !topWidget->inherits("QDialog")) {
214 topWidget = topWidget->parentWidget();
215 }
216
217 //
218 // Прячем анимируемый виджет
219 //
220 widgetForSlide()->hide();
221
222 //
223 // Определяем позиции прокатывания
224 //
225 const QSize finalSize = widgetForSlide()->size();
226 QPoint startPosition = widgetForSlide()->pos(), finalPosition;
227 switch (m_side) {
228 case WAF::LeftSide: {
229 startPosition = QPoint(0, 0);
230 finalPosition = QPoint(-finalSize.width(), 0);
231 break;
232 }
233
234 case WAF::TopSide: {
235 startPosition = QPoint(0, 0);
236 finalPosition = QPoint(0, -finalSize.height());
237 break;
238 }
239
240 case WAF::RightSide: {
241 startPosition = QPoint(topWidget->width() - finalSize.width(), 0);
242 finalPosition = QPoint(topWidget->width(), 0);
243 break;
244 }
245
246 case WAF::BottomSide: {
247 startPosition = QPoint(0, topWidget->height() - finalSize.height());
248 finalPosition = QPoint(0, topWidget->height());
249 break;
250 }
251 }
252
253 //
254 // Анимируем закатывание виджета
255 //

Callers

nothing calls this directly

Calls 8

QPointClass · 0.85
grabSlideWidgetMethod · 0.80
isVisibleMethod · 0.80
hideMethod · 0.80
setEasingCurveMethod · 0.80
startMethod · 0.80
decorateMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected